0
$\begingroup$

Gazebo Answers logo

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!!


Originally posted by Simone on Gazebo Answers with karma: 30 on 2020-09-09

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

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).


Originally posted by nlamprian with karma: 833 on 2020-09-10

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Simone on 2020-09-10:
Thank you so much!!

$\endgroup$

Your Answer

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