Gazebo | Ignition | Community
Ask Your Question
0

Gazebo stops subscribing to a topic when I run gzclient

asked 2022-06-03 03:22:07 -0500

MatteoSartoni gravatar image

I'm working with ROS1, Docker and Gazebo. When I run the robotic application and the simulation application using docker run and I enter in the container images, using the command

$ rostopic list

I can see that the topic /cmd_vel appears in both the images, and when I retrieve the information using

$ rostopic info cmd_vel

I obtain:

Type: geometry_msgs/Twist

Publishers:

Subscribers: None

and

Type: geometry_msgs/Twist

Publishers: None

Subscribers:

for the robotapp and the simapp respectively. The point is that, when inside the simapp image, I run the command

$ rosrun gazebo_ros gzclient

I obtain the following output:

the robot stands still inside the Gazebo GUI (instead rotating around the z axis with an angular velocity of 0.1 rad/s) and the /cmd_vel topic disappears from the ones available in the simapp image (together with others).

Do you know what could be the cause of this error?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-07-05 16:54:33 -0500

peci1 gravatar image

updated 2022-07-05 16:55:04 -0500

You need to make sure the containers can see each other (be in the same IP subnet) and that the hostnames they report can be resolved in the other container (I see for example a hostname 225f2aebfbbd in your output). To test it, attach to container a47864a79463 and try ping 225f2aebfbbd. If you get a failure to resolve the hostname, ROS will not work.

One way to circumvent the hostname resolution is exporting variable ROS_IP in each of the containers. This will make sure the topics are not advertised using hostname of the container, but using its IP address. If the containers can ping the IP addresses of each other, it should work. If they can't ping each other using IP addresses, you have to fix your networking setup so that they can (i.e. run the containers with networking in the bridging mode).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2022-06-03 03:22:07 -0500

Seen: 79 times

Last updated: Jul 05 '22