0
$\begingroup$

Rosanswers logo

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/[email protected]
[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.


Originally posted by SébastienL on ROS Answers with karma: 32 on 2023-05-04

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

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

Originally posted by SébastienL with karma: 32 on 2023-05-04

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.