Skip to content

Commit f388859

Browse files
authored
Merge pull request #32 from pariaspe/rolling
Added namespace and config file as launch arguments
2 parents cd166d0 + 7ef9cfe commit f388859

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mocap4r2_optitrack_driver/launch/optitrack2.launch.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
from launch import LaunchDescription
2626
from launch.actions import EmitEvent
27-
from launch.actions import SetEnvironmentVariable
27+
from launch.actions import SetEnvironmentVariable,DeclareLaunchArgument
28+
from launch.substitutions import LaunchConfiguration
2829
from launch_ros.actions import LifecycleNode
2930
from launch_ros.events.lifecycle import ChangeState
3031

@@ -45,11 +46,11 @@ def generate_launch_description():
4546

4647
driver_node = LifecycleNode(
4748
name='mocap4r2_optitrack_driver_node',
48-
namespace='',
49+
namespace=LaunchConfiguration('namespace'),
4950
package='mocap4r2_optitrack_driver',
5051
executable='mocap4r2_optitrack_driver_main',
5152
output='screen',
52-
parameters=[params_file_path],
53+
parameters=[LaunchConfiguration('config_file')],
5354
)
5455

5556
# Make the driver node take the 'configure' transition
@@ -72,6 +73,8 @@ def generate_launch_description():
7273
ld = LaunchDescription()
7374

7475
ld.add_action(stdout_linebuf_envvar)
76+
ld.add_action(DeclareLaunchArgument('namespace', default_value=''))
77+
ld.add_action(DeclareLaunchArgument('config_file', default_value=params_file_path))
7578
ld.add_action(driver_node)
7679
ld.add_action(driver_configure_trans_event)
7780
# ld.add_action(driver_activate_trans_event)

0 commit comments

Comments
 (0)