Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logger child not publish in /rosout #1407

Open
halejo-as opened this issue Jan 30, 2025 · 1 comment
Open

Logger child not publish in /rosout #1407

halejo-as opened this issue Jan 30, 2025 · 1 comment
Assignees

Comments

@halejo-as
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

Execute the next code.

import rclpy                                                    
from rclpy.node import Node                                     
                                                                
                                                                
def main():                                                     
    rclpy.init()                                                
    node = Node("Test")                                         
    node.get_logger().info("Message parent")                    
    node.get_logger().get_child("child").info("Message child")  
    node.destroy_node()                                         
    rclpy.try_shutdown()                                        
                                                                
if __name__ == "__main__":                                      
    main()                                                      
                  

Expected behavior
Both loggers should be apeear in rosout.
Screenshots
Only the message from the parent is received in the topic /rosout
Image

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Version ROS: humble
@fujitatomoya
Copy link
Collaborator

@halejo-as thanks for creating issue.

this problem has been addressed by ros2/rcl#1115, jazzy and rolling do not have this problem anymore.

### console output
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run prover_rclpy rclpy_1407 
[INFO] [1738264388.590734963] [Test]: Message parent
[INFO] [1738264388.591074152] [Test.child]: Message child

### rosout
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 topic echo /rosout
stamp:
  sec: 1738264388
  nanosec: 590734963
level: 20
name: Test
msg: Message parent
file: /root/ros2_ws/colcon_ws/build/prover_rclpy/src/rclpy_1407.py
function: main
line: 8
---
stamp:
  sec: 1738264388
  nanosec: 591074152
level: 20
name: Test.child
msg: Message child
file: /root/ros2_ws/colcon_ws/build/prover_rclpy/src/rclpy_1407.py
function: main
line: 9
---

ros2/rcl#1115 created the new return code RCL_RET_NOT_FOUND and added it to rcl_logging_rosout_add_sublogger, so technically this does not break the API/ABI. However, if client code is compiled with assumptions about a fixed set of return values and behaves incorrectly when receiving a new value, it might cause unintended behavior without breaking ABI in the strictest sense.

at this moment, i do not think we are going to work on the backport for humble.

@fujitatomoya fujitatomoya self-assigned this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants