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

Problem with message transfer from Gazebo to ROS #685

Open
wzhugit opened this issue Jan 20, 2025 · 0 comments
Open

Problem with message transfer from Gazebo to ROS #685

wzhugit opened this issue Jan 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@wzhugit
Copy link

wzhugit commented Jan 20, 2025

Environment

OS Version: Ubuntu 22.04.5 LTS

  • Source or binary build?

Source
branch:ros2

Description

  • Expected behavior:
    When publishing messages from Gazebo via 'gz topic --topic /chatter -m gz.msgs.StringMsg -p 'data:"Hello"'
    in one terminal and 'ros2 topic echo /chatter' in another while 'ros2 run ros_gz_bridge parameter_bridge /chatter@std_msgs/msg/String@gz.msgs.StringMsg' on a background terminal C, there should be a message printed to the 'ros2 topic echo /chatter' terminal.
  • Actual behavior:
    On terminal C which running 'ros2 topic echo /chatter', there is nothing printed when 'ros2 run ros_gz_bridge parameter_bridge /chatter@std_msgs/msg/String@gz.msgs.StringMsg' terminal on background.

Steps to reproduce

1.Create a workspace "mkdir bridge_ws" and create src directory in it "cd bridge_ws;mkdir src"
2.run "rosdep install -r --from-paths src -i -y --rosdistro humble" and "#All required rosdeps installed successfully" is returned.
3.run "source /opt/ros/humble/setup.bash"
4.run "colcon build" and wait
5.open a new terminal, run "cd bridge_ws" ,"source /opt/ros/humble/setup.bash" and "source install/setup.bash",then run "ros2 run ros_gz_bridge parameter_bridge /chatter@std_msgs/msg/String@gz.msgs.StringMsg",the terminal should return something similar to “[INFO] [1737355395.023715821] [ros_gz_bridge]: Creating GZ->ROS Bridge: [/chatter (gz.msgs.StringMsg) -> /chatter (std_msgs/msg/String)] (Lazy 0)
[INFO] [1737355395.026791266] [ros_gz_bridge]: Creating ROS->GZ Bridge: [/chatter (std_msgs/msg/String) -> /chatter (gz.msgs.StringMsg)] (Lazy 0)
[INFO] [1737355649.022489895] [ros_gz_bridge]: Passing message from ROS std_msgs/msg/String to Gazebo gz.msgs.StringMsg (showing msg only once per type)

6.Open a new terminal and run "source /opt/ros/humble/setup.bash" "ros2 topic echo /chatter"
7.Open a new terminal and run "gz topic --topic /chatter -m gz.msgs.StringMsg -p 'data:"Message from Gazebo"'" and "Message from Gazebo" should be printed to terminal which running "ros2 topic echo /chatter"

Output

Nothing appears in the terminal which running "ros2 topic echo /chatter"

Image

@wzhugit wzhugit added the bug Something isn't working label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Inbox
Development

No branches or pull requests

1 participant