Home | Tutorials | Wiki | Issues
Ask Your Question
0

Making Gazebo sensor topics visible in ROS

asked 2018-01-10 09:18:41 -0600

Pi Robot gravatar image

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

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2018-01-11 11:43:38 -0600

Jose Luis Rivero gravatar image

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_pluginsdirectory in the https://github.com/ros-simulation/gaz... repository.

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

edit flag offensive delete link more

Comments

OK, andthanks for the link for creating SDFs programmatically.

Pi Robot gravatar imagePi Robot ( 2018-01-12 16:30:56 -0600 )edit
0

answered 2018-01-12 10:19:30 -0600

lasitus gravatar image

I ran across this researching another problem and noticed you question. Maybe it will help. I have no ROS experience, just researching whether or not I want to use it on top of or instead of Dronekit talking to APM.

https://answers.ros.org/question/4690...

http://answers.gazebosim.org/question...

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-01-10 09:18:41 -0600

Seen: 497 times

Last updated: Jan 11