ros2 / ros2/launch

[launch] not wiring python prints to stdout in realtime

Open
#188 14 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog bug
Dominant language
Python
Stars
155
Forks
182
Avg merge
2d 14h
Merged PRs (30d)
6

Description

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • Crystal
  • DDS implementation:
    • Default
  • Client library (if applicable):
    • rclpy
Steps to reproduce issue

Add them both to a launcher:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import launch
import launch_ros.actions

def generate_launch_description():
    launch_description = launch.LaunchDescription()
    launch_description.add_action(
        launch_ros.actions.Node(
            package='demo_nodes_cpp', node_executable='talker', output='screen'),
    )
    launch_description.add_action(
        launch_ros.actions.Node(
            package='demo_nodes_py', node_executable='talker', output='screen'),
    )
    return launch_description

and call ros2 launch ... on it.

Expected behavior

Both logged messages and cout/print messages make it in realtime to stdout.

Actual behavior

All make it there except the python print statements. They only show on stdout after interrupting the launch with CTRL-C.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided ros2 launch description, comparing demo_nodes_cpp/src/topics/talker.cpp with demo_nodes_py/demo_nodes_py/topics/talker.py. Trace how the launch command handles each process's output; done means Python print messages appear on stdout in realtime alongside the logged and C++ messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.