Launch
Resources
- Official Documentation @ Ros Index
- Ros2launch Examples
- Ros2 Demos - Add Two Ints Launcher
- Ros2launch Architecture
Motivating Example
def generate_launch_description(): """Launch the mock robot.""" launch_description = launch_ros.get_default_launch_description() launch_description.add_action( launch_ros.actions.Node( package='py_trees_ros_tutorials', node_executable='mock-dashboard', output='screen', node_name='dashboard') ) for node_name in ['led_strip', 'battery']: node_executable = "mock-{}".format(node_name.replace('_', '-')) launch_description.add_action( launch_ros.actions.Node( package='py_trees_ros_tutorials', node_name=node_name, node_executable=node_executable, output='screen' # screen is awkward, it's after the fact ) ) return launch_description
Questions
In order of criticality...
- Stdout Logging: node.get_logger().info("...") shows up, but print do not → ros2/launch/issues/188
Workaround 1: (but has the problem in that it's very spammy on introspection):
def generate_launch_description(): # ... myenv = os.environ myenv["PYTHONUNBUFFERED"] = "1" # ... launch_description.add_action( launch_ros.actions.Node( package='py_trees_ros_tutorials', node_name=node_name, node_executable=node_executable, output='screen' # screen is awkward, it's after the fact env=myenv ) )
Workaround 2: set the emulate_tty flag as directed in ros2/launch/issues/188
sed -i 's/emulate_tty=False/emulate_tty=True/g' /opt/ros/dashing/lib/python3.6/site-packages/launch/actions/execute_process.py
- Symlinks for installed python files → ros2/launch/issues/187
- Introspector failing if env is set → ros2/launch/issues/203
- Multi-Node fails, but with surprising behaviour → ros2/launch/issues/204
- Multi-Node launch support as a feature → ros2/launch/issues/205