Robotics StackExchange | Archived questions

How can I add models to Gazebo during runtime?

I am currently working on a project at my university that uses ROS Indigo in combination with Gazebo 1.9. What I need is to input some basic cylinders to my simulation after my robot model has moved to a certain position. I have tried using a Gazebo world plugin, but I only manage to input models at simulation start. Is it possible to use a launch file to spawn models in a running simulation? I tried opening a world file with the command gazebo myworld.world, and then roslaunch mylaunch.launch for spawning my robot model, but the launch stops at

[INFO] [WallTime: 1478007130.941782] Waiting for service /gazebo/spawn_urdf_model

I am using ros_control to position my robot, and then I want to put some objects right next to it. Any suggestions will be appreciated!

Asked by Stian on 2016-11-01 09:00:11 UTC

Comments

You can edit the Gazebo world plugin to input models at a certain time (for instance when the status of a topic changes, or for a ROS service).

Another option is using the Gazebo GUI to add objects. You can either use them from the model database or from your own database.

Asked by JoshMarino on 2016-11-01 18:24:52 UTC

Answers