Skip to content

Commit cdce3e6

Browse files
committed
Migrated launch files
1 parent 7c24d47 commit cdce3e6

File tree

8 files changed

+390
-83
lines changed

8 files changed

+390
-83
lines changed

mocha_core/launch/database_translators_publishers.launch

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/usr/bin/env python3
2+
3+
from launch import LaunchDescription
4+
from launch.actions import DeclareLaunchArgument
5+
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
6+
from launch_ros.actions import Node
7+
from launch_ros.substitutions import FindPackageShare
8+
9+
10+
def generate_launch_description():
11+
"""
12+
Launch database, translator, and topic publisher nodes for MOCHA system
13+
"""
14+
15+
# Declare launch arguments
16+
robot_name_arg = DeclareLaunchArgument(
17+
'robot_name',
18+
default_value='charon',
19+
description='Name of the robot'
20+
)
21+
22+
robot_configs_arg = DeclareLaunchArgument(
23+
'robot_configs',
24+
default_value=PathJoinSubstitution([
25+
FindPackageShare('mocha_core'),
26+
'config', 'testConfigs', 'robot_configs.yaml'
27+
]),
28+
description='Path to robot configuration file'
29+
)
30+
31+
topic_configs_arg = DeclareLaunchArgument(
32+
'topic_configs',
33+
default_value=PathJoinSubstitution([
34+
FindPackageShare('mocha_core'),
35+
'config', 'testConfigs', 'topic_configs.yaml'
36+
]),
37+
description='Path to topic configuration file'
38+
)
39+
40+
radio_configs_arg = DeclareLaunchArgument(
41+
'radio_configs',
42+
default_value=PathJoinSubstitution([
43+
FindPackageShare('mocha_core'),
44+
'config', 'radio_configs.yaml'
45+
]),
46+
description='Path to radio configuration file'
47+
)
48+
49+
# Get launch configurations
50+
robot_name = LaunchConfiguration('robot_name')
51+
robot_configs = LaunchConfiguration('robot_configs')
52+
topic_configs = LaunchConfiguration('topic_configs')
53+
radio_configs = LaunchConfiguration('radio_configs')
54+
55+
# Define nodes
56+
integrate_database_node = Node(
57+
package='mocha_core',
58+
executable='integrate_database.py',
59+
name='integrate_database',
60+
output='screen',
61+
parameters=[{
62+
'robot_name': robot_name,
63+
'robot_configs': robot_configs,
64+
'radio_configs': radio_configs,
65+
'topic_configs': topic_configs,
66+
'rssi_threshold': 35
67+
}]
68+
)
69+
70+
translator_node = Node(
71+
package='mocha_core',
72+
executable='translator.py',
73+
name='translator',
74+
output='screen',
75+
parameters=[{
76+
'robot_name': robot_name,
77+
'robot_configs': robot_configs,
78+
'topic_configs': topic_configs
79+
}]
80+
)
81+
82+
topic_publisher_node = Node(
83+
package='mocha_core',
84+
executable='topic_publisher.py',
85+
name='topic_publisher',
86+
output='screen',
87+
parameters=[{
88+
'robot_name': robot_name,
89+
'robot_configs': robot_configs,
90+
'topic_configs': topic_configs
91+
}]
92+
)
93+
94+
return LaunchDescription([
95+
robot_name_arg,
96+
robot_configs_arg,
97+
topic_configs_arg,
98+
radio_configs_arg,
99+
integrate_database_node,
100+
translator_node,
101+
topic_publisher_node
102+
])

mocha_launch/launch/basestation.launch

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env python3
2+
3+
from launch import LaunchDescription
4+
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
5+
from launch.launch_description_sources import PythonLaunchDescriptionSource
6+
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
7+
from launch_ros.substitutions import FindPackageShare
8+
9+
10+
def generate_launch_description():
11+
"""
12+
Launch basestation robot with database, translators, publishers, and Rajant interface
13+
"""
14+
15+
# Declare launch arguments
16+
robot_name_arg = DeclareLaunchArgument(
17+
'robot_name',
18+
default_value='basestation',
19+
description='Name of the robot'
20+
)
21+
22+
robot_configs_arg = DeclareLaunchArgument(
23+
'robot_configs',
24+
default_value=PathJoinSubstitution([
25+
FindPackageShare('mocha_core'),
26+
'config', 'robot_configs.yaml'
27+
]),
28+
description='Path to robot configuration file'
29+
)
30+
31+
topic_configs_arg = DeclareLaunchArgument(
32+
'topic_configs',
33+
default_value=PathJoinSubstitution([
34+
FindPackageShare('mocha_core'),
35+
'config', 'topic_configs.yaml'
36+
]),
37+
description='Path to topic configuration file'
38+
)
39+
40+
radio_configs_arg = DeclareLaunchArgument(
41+
'radio_configs',
42+
default_value=PathJoinSubstitution([
43+
FindPackageShare('mocha_core'),
44+
'config', 'radio_configs.yaml'
45+
]),
46+
description='Path to radio configuration file'
47+
)
48+
49+
# Get launch configurations
50+
robot_name = LaunchConfiguration('robot_name')
51+
robot_configs = LaunchConfiguration('robot_configs')
52+
topic_configs = LaunchConfiguration('topic_configs')
53+
radio_configs = LaunchConfiguration('radio_configs')
54+
55+
# Include database, translators and publishers launch file
56+
database_translators_publishers_launch = IncludeLaunchDescription(
57+
PythonLaunchDescriptionSource([
58+
PathJoinSubstitution([
59+
FindPackageShare('mocha_core'),
60+
'launch',
61+
'database_translators_publishers.launch.py'
62+
])
63+
]),
64+
launch_arguments={
65+
'robot_name': robot_name,
66+
'robot_configs': robot_configs,
67+
'topic_configs': topic_configs,
68+
'radio_configs': radio_configs
69+
}.items()
70+
)
71+
72+
# Include Rajant interface launch file
73+
rajant_interface_launch = IncludeLaunchDescription(
74+
PythonLaunchDescriptionSource([
75+
PathJoinSubstitution([
76+
FindPackageShare('interface_rajant'),
77+
'launch',
78+
'rajant_nodes.launch.py'
79+
])
80+
]),
81+
launch_arguments={
82+
'robot_name': robot_name,
83+
'robot_configs': robot_configs,
84+
'topic_configs': topic_configs,
85+
'radio_configs': radio_configs
86+
}.items()
87+
)
88+
89+
return LaunchDescription([
90+
robot_name_arg,
91+
robot_configs_arg,
92+
topic_configs_arg,
93+
radio_configs_arg,
94+
database_translators_publishers_launch,
95+
rajant_interface_launch
96+
])

mocha_launch/launch/jackal.launch

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env python3
2+
3+
from launch import LaunchDescription
4+
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
5+
from launch.launch_description_sources import PythonLaunchDescriptionSource
6+
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
7+
from launch_ros.substitutions import FindPackageShare
8+
9+
10+
def generate_launch_description():
11+
"""
12+
Launch jackal robot (callisto) with database, translators, publishers, and Rajant interface
13+
"""
14+
15+
# Declare launch arguments
16+
robot_name_arg = DeclareLaunchArgument(
17+
'robot_name',
18+
default_value='callisto',
19+
description='Name of the robot'
20+
)
21+
22+
robot_configs_arg = DeclareLaunchArgument(
23+
'robot_configs',
24+
default_value=PathJoinSubstitution([
25+
FindPackageShare('mocha_core'),
26+
'config', 'robot_configs.yaml'
27+
]),
28+
description='Path to robot configuration file'
29+
)
30+
31+
topic_configs_arg = DeclareLaunchArgument(
32+
'topic_configs',
33+
default_value=PathJoinSubstitution([
34+
FindPackageShare('mocha_core'),
35+
'config', 'topic_configs.yaml'
36+
]),
37+
description='Path to topic configuration file'
38+
)
39+
40+
radio_configs_arg = DeclareLaunchArgument(
41+
'radio_configs',
42+
default_value=PathJoinSubstitution([
43+
FindPackageShare('mocha_core'),
44+
'config', 'radio_configs.yaml'
45+
]),
46+
description='Path to radio configuration file'
47+
)
48+
49+
# Get launch configurations
50+
robot_name = LaunchConfiguration('robot_name')
51+
robot_configs = LaunchConfiguration('robot_configs')
52+
topic_configs = LaunchConfiguration('topic_configs')
53+
radio_configs = LaunchConfiguration('radio_configs')
54+
55+
# Include database, translators and publishers launch file
56+
database_translators_publishers_launch = IncludeLaunchDescription(
57+
PythonLaunchDescriptionSource([
58+
PathJoinSubstitution([
59+
FindPackageShare('mocha_core'),
60+
'launch',
61+
'database_translators_publishers.launch.py'
62+
])
63+
]),
64+
launch_arguments={
65+
'robot_name': robot_name,
66+
'robot_configs': robot_configs,
67+
'topic_configs': topic_configs,
68+
'radio_configs': radio_configs
69+
}.items()
70+
)
71+
72+
# Include Rajant interface launch file
73+
rajant_interface_launch = IncludeLaunchDescription(
74+
PythonLaunchDescriptionSource([
75+
PathJoinSubstitution([
76+
FindPackageShare('interface_rajant'),
77+
'launch',
78+
'rajant_nodes.launch.py'
79+
])
80+
]),
81+
launch_arguments={
82+
'robot_name': robot_name,
83+
'robot_configs': robot_configs,
84+
'topic_configs': topic_configs,
85+
'radio_configs': radio_configs
86+
}.items()
87+
)
88+
89+
return LaunchDescription([
90+
robot_name_arg,
91+
robot_configs_arg,
92+
topic_configs_arg,
93+
radio_configs_arg,
94+
database_translators_publishers_launch,
95+
rajant_interface_launch
96+
])

mocha_launch/launch/titan.launch

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)