Launch



Resources

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...

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