ros2 / ros2cli

ROS 2 command line interface tools
Apache License 2.0
172 stars 161 forks source link

Ros2 Topic Echo Not Working #922

Closed MichaelrMentele closed 1 month ago

MichaelrMentele commented 1 month ago

Bug report

Required Info:

Steps to reproduce issue

https://docs.ros.org/en/jazzy/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.html

ros2 run turtlesim turtle_teleop_key
ros2 run turtlesim turtlesim_node # seperate shell
ros2 topic echo /turtle1/cmd_vel # separate shell

Expected behavior

Should print out some kind of output for the turtles position and vector direction

Actual behavior

Nothing is printed out when I move the turtle

Additional information

Perhaps this is a symptom of this error: 2024-08-02 10:50:18.217 [RTPS_TRANSPORT_SHM Error] Failed init_port fastrtps_port7001: open_and_lock_file failed -> Function open_port_internal

But I only see this when I run rqt.

Also, I notice in graph_viz that the intermediate node that is supposed to be subscribing does not exist. image

There should be a subscribing node for the echo attached to cmd_vel

MichaelrMentele commented 1 month ago

Complete ROS n00b may be user error.

MichaelrMentele commented 1 month ago

Yeah looks like a subscription issue -- the echo subscription is orphaned:

ros2 topic info /turtle1/cmd_vel
Type: geometry_msgs/msg/Twist
Publisher count: 1
Subscription count: 1

It's odd, i would have expected some kind of error message if it failed to connect. That's the secondary issue here. I wonder if this is all downstream of the transport error but why don't I see it when I run the command i.e. only with rqt?

MichaelrMentele commented 1 month ago

So, I still had the issue after sourcing and opening a new shell but the issue went away once I killed the terminal application completely.

Not sure if we want to leave this open, but after killing my terminal and all shells and reopening -- I'm good.

fujitatomoya commented 1 month ago

@MichaelrMentele you can keep this open. actually i assigned myself to this, just in case i want to make sure this problem does not happen with my environment as well.

fujitatomoya commented 1 month ago

i cannot reproduce this issue with jazzy: ros-jazzy-rqt 1.6.0-2noble.20240712.140504

image