Cannot spawn a model with namespace for sensors

asked 2018-09-07 16:35:49 -0600

anna.sarp gravatar image

Hi,

I am using ROS kinetic 1.12.13 and gazebo 7.13.0.

I am trying to spawn multiple copies of an sdf model at different location. SDF file can be found here. The model is basically a kinect sensor (camera + depth) with a contact sensor to detect collision. I am able to spawn the model successfully by running the following command

rosrun gazebo_ros spawn_model -sdf -file $SENSEAI_MODEL_PATH/camera/model.sdf -model raytrace_agent -x -6.5 -y 42.8 -z 1

However I am trying to spawn multiple copies of the same model at different locations in the world. I would like to differentiate the sensor output topics of each sensor listed below.

/raytrace_camera/depth/image_raw
/raytrace_camera/depth/points
/raytrace_camera/contact

Question 1: What is the ideal way to achieve this ?

I did try adding robot_namespace argument to the spawn command like below

rosrun gazebo_ros spawn_model -sdf -file $SENSEAI_MODEL_PATH/camera/model.sdf -robot_namespace rt1 -model raytrace_agent1 -x -6.5 -y 42.8 -z 1

When I did this, I was expecting topic to be like

rt1/raytrace_camera/depth/image_raw
rt1/raytrace_camera/depth/points
rt1/raytrace_camera/contact

but the sensor output topics continued to be the same without namesapce prefix. Only the camera_updates and couple other topics changed

/rt/raytrace_camera/depth/camera_info
/rt/raytrace_camera/parameter_descriptions
/rt/raytrace_camera/parameter_updates

Question 2: Is the command correct ? If not, what is the correct way to spawn a model with namesapce so that I can sensor outputs of diiferent copies on different topics?

edit retag flag offensive close merge delete