0
$\begingroup$

Gazebo Answers logo

I'm using Gazebo 2.3 and ROS Indigo but I can also use Gazebo 7 if that will help me with my problem.

I would like to model a swarm of identical robots, each with a laser scanner and depth camera. I am spawning each robot from within a Python script and I'd like to use the same SDF model for each robot. At first this appears to work well since when I view the topics in Gazebo using the "Topic Visualization" menu item, each robot gets a unique sensor topic name for its lidar and camera. The problem is that these topics are not visible in ROS. In other words, when I run 'rostopic list', the simulated robot sensor topics do not appear. If I add a topic name to the sensor plugins in the robot SDF, then all robots get the same sensor topic names in ROS.

So does anyone know how I can get unique sensor topic names in ROS without cloning the SDF file multiple times, each one with a different set of topic names? As far as I can tell, I cannot programmatically pass a topic name when I spawn each robot model. I'd be happy with a Gazebo plugin or C++ node that republishes the Gazebo topics to ROS. Or perhaps there is a hack to the Gazebo source itself I could implement to make all Gazebo topics available to ROS?

Thanks,
patrick


Originally posted by Pi Robot on Gazebo Answers with karma: 7 on 2018-01-10

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

Gazebo itself has no support for ROS or any other robotics framework using it, so you can not expect out of the box conversion from gazebo topics to ROS topics. You will need to write a gazebo plugin that also uses ROS and interact with both systems doing the data translation. Probably you can find inspiration in the gazebo_plugins directory in the https://github.com/ros-simulation/gazebo_ros_pkgs repository.

Answering other of your question, yes, it is possible to create SDF programmatically: http://answers.gazebosim.org/question/5228/how-to-programmatically-create-sdf-modelsfiles/.


Originally posted by Jose Luis Rivero with karma: 1485 on 2018-01-11

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Pi Robot on 2018-01-12:
OK, andthanks for the link for creating SDFs programmatically.

$\endgroup$

Your Answer

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