ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Do you know how to create maps in gazebo from c++?

asked 2020-03-02 11:57:22 -0500

FranJRO gravatar image

Hi, I'd like to create a map for gazebo from c++. I need to run a node which need to change the map when it need it from time to time. I've been looking for and I know that I need to code a pluging for gazebo, but I don't find out information about doing this stuff in c++. If some of you know how to do it or when I can obtain informatio I'll apreciate it so much. I'm using gazebo 7.

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-02 13:33:55 -0500

create a map for gazebo

Maybe nomenclature issues, but there's no concept of a map in gazebo, or in a simulation in general. You have a world which consists of a robot (probably), some scene / obstacles, lighting figures, etc.

If you're referring to a 2D map or something, then you need to create one using SLAM in the simulation prior, or code just a quick tool to take a 2D slice of a world and save it in the appropriate format.

From Gazebo plugins, you can move, add, remove, or otherwise play with the scene at any time. You should be able to create a gazebo plugin to load on request some formatted information of obstacles and locations and load them into the scene (and probably delete existing stuff).

edit flag offensive delete link more

Comments

Sorry, I called it wrong. I mean to set or delete object on the simulation (like wall or a cube), but from c++.

FranJRO gravatar image FranJRO  ( 2020-03-03 11:04:55 -0500 )edit

If you only want to delete a model in simulation programatically you can create a world plugin and use the model name to call RemoveModel function.

Furthermore, if you want to create a map from the world you can check this tool.

Since this type of question is related more to Gazebo than ROS try to post it in Gazebo answers instead here maybe you can find more help.

Weasfas gravatar image Weasfas  ( 2020-03-04 08:10:22 -0500 )edit

thanks, i'll ask right there.

FranJRO gravatar image FranJRO  ( 2020-03-04 14:16:36 -0500 )edit

Question Tools

Stats

Asked: 2020-03-02 11:57:22 -0500

Seen: 459 times

Last updated: Mar 02 '20