Gazebo | Ignition | Community
Ask Your Question

How to set the pose of a box importing data

asked 2020-09-09 09:37:32 -0500

Simone gravatar image

Hi there! I am using gazebo-11 to test the navigation algorithm based on visual odometry implemented on NASA's Curiosity rover.

In particular, I created a stereo camera model and I made it move along a line and take photos at a certain rate. In order to simulate osbtacles I introduced manually (it took me a great amount of time!!!) in the .world file a number of boxes (about 200) which are different from each other in terms of dimensions, position and orientation.

Is there a way to import from a .txt file (or other formats) the information about pose and size of each box so that a box of such size and pose is actually introduced in the Gazebo world (the GUI)?

Probably I have to write a plugin or something similar. Than you so much in advance!!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-09-10 05:34:19 -0500

Yes, you can write a world plugin and spawn the models dynamically at runtime.

You can prepare your input data as a yaml file (probably the easiest) and read it in with yaml-cpp. Then you can construct model messages based on that input and publish them so that gazebo can then spawn the models.

See the GUIExampleSpawnWidget example (ignore the gui part).

edit flag offensive delete link more


Thank you so much!!

Simone gravatar imageSimone ( 2020-09-10 09:48:47 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-09-09 09:37:32 -0500

Seen: 94 times

Last updated: Sep 10 '20