ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

communication gz->ROS2 doesn't work, how to debug ?

asked 2023-05-04 03:23:38 -0600

SébastienL gravatar image

Hello, I have a pb with ros_gz_bridge, I use ROS2-Humble, Gazebo-Garden, get ros_gz from source, branche humble and after compilation (and source my env in each shell) in a new workspace I tried exemple from ros_gz_bridge. (changing ignition for gz in commands)

  • Example 1a: communication gz -> ROS2 => KO nothing is received in ROS2 topic
  • Example 1b: communication ROS2 -> gz => OK

I can't understand what's going wrong.

# shell A
$ ros2 run ros_gz_bridge parameter_bridge /chatter@std_msgs/msg/String@gz.msgs.StringMsg
[INFO] [1683186627.556779317] [ros_gz_bridge]: Creating GZ->ROS Bridge: [/chatter (gz.msgs.StringMsg) -> /chatter (std_msgs/msg/String)] (Lazy 0)
[INFO] [1683186627.558527086] [ros_gz_bridge]: Creating ROS->GZ Bridge: [/chatter (std_msgs/msg/String) -> /chatter (gz.msgs.StringMsg)] (Lazy 0)

# shell B
$ ros2 topic echo /chatter
# nothing

# shell C
$ gz topic -t /chatter -m gz.msgs.StringMsg -p 'data:"Hello"'

# shell D (to control msg is really sent)
$ gz topic --echo -t /chatter
data: "Hello"

As far as I understand, it is probably a pb with message type.

$ ros2 topic type /chatter
std_msgs/msg/String

$ gz topic -t /chatter --info
Publishers [Address, Message Type]:
  tcp://192.168.21.112:37511, ignition.msgs.StringMsg

This ignition message is suspicious to me.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2023-05-04 04:27:33 -0600

SébastienL gravatar image

Ok got it from https://github.com/gazebosim/ros_gz/i...

I have to export GZ_VERSION=garden before compiling.

$ gz topic --info -t /chatter
Publishers [Address, Message Type]:
  tcp://127.0.0.1:39363, gz.msgs.StringMsg
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-05-04 03:23:38 -0600

Seen: 787 times

Last updated: May 04 '23