Simulation application stops subscribing to topics when I run gzclient

asked 2022-06-05 09:20:28 -0600

MatteoSartoni gravatar image

I am working with ROS, Docker and Gazebo. In my ROS environment I have a robotic application and a simulation one, from which I have built two docker images.

I run the with the following commands:

$ docker run -it -e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ -u robomaker -e ROBOMAKER_GAZEBO_MASTER_URI=http://localhost:5555 -e ROBOMAKER_ROS_MASTER_URI=http://localhost:11311 \robomaker-helloworld-robot-app:latest roslaunch hello_world_robot rotate.launch

and

$ export DISPLAY=:0

$ xhost +

$ docker run -it -v /tmp/.X11-unix/:/tmp/.X11-unix/ -u robomaker -e ROBOMAKER_GAZEBO_MASTER_URI=http://localhost:5555 -e ROBOMAKER_ROS_MASTER_URI=http://localhost:11311 \robomaker-helloworld-sim-app:latest roslaunch hello_world_simulation empty_world.launch

for the robotapp and the simapp respectively. If I go inside the simapp image, after all the required sourcing, and run the command

$ rostopic list

I get the following output

$ /camera/parameter_descriptions

/camera/parameter_updates

/camera/rgb/camera_info

/camera/rgb/image_raw

/clock

/cmd_vel

/gazebo/link_states

/gazebo/model_states

/gazebo/parameter_descriptions

/gazebo/parameter_updates

/gazebo/set_link_state

/gazebo/set_model_state

/imu

/joint_states

/odom

/rosout

/rosout_agg

/scan

/tf

The problem is that, when I run the

$ rosrun gazebo_ros gzclient

command from the simapp image, it spans the robot inside Gazebo but it stays still (instead doing the task described in the robotapp) and, if I close the gzclient and I look again to the topics inside the image, I get only these:

$/clock

/joint_states

/rosout

/rosout_agg

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

edit retag flag offensive close merge delete