Querying collision geometry primitives from ROS in Gazebo 9?

asked 2021-02-16 17:28:16 -0500

danzimmerman gravatar image

Is there a way to query Gazebo from ROS to get the parameters of a <collision> geometry for the currently loaded world? For example, the radius of a sphere or the dimensions of a box?

I know I can query the world with a /gazebo/get_world_properties service call (or equivalent from C++) and get a list of model names.

I can query each model name and see the geom_names that make up the collision geometry, but I don't see a way to actually query those geometries further?

I can get the obstacles' poses easily enough with /gazebo/get_model_state service calls, but I'm not seeing where I can get the shape and size of the collision geometries to communicate that to my non-ROS planning code.

I can probably figure out how to side-load from the SDF or I can switch to spawning my obstacles from another node that posts their dimensions to the parameter server or something for later queries. But it'd be a fun bonus to actually read out the obstacles' current shape and size so I can also use Scale Mode in the GUI.

Is there a best-practices recipe for communicating the collision geometries of obstacles to ROS code?

Can this be done with a plugin?

edit retag flag offensive close merge delete


Same question, no answers: https://answers.gazebosim.org/questio...

danzimmerman gravatar imagedanzimmerman ( 2021-02-17 08:18:01 -0500 )edit

I guess perhaps it's better to use a minimal world and spawn URDF models with <gazebo> tags here so that the whole thing is posted to the parameter server before its instanced in Gazebo?

danzimmerman gravatar imagedanzimmerman ( 2021-02-17 11:19:09 -0500 )edit

I'm passing some rosparams at launch to work around this for now ¯\_(ツ)_/¯ I thought about parsing the SDF but if it's not tied to the actual shape of the obstacles in the Gazebo GUI anyway I figured I'd do it the easy way.

danzimmerman gravatar imagedanzimmerman ( 2021-02-19 15:20:27 -0500 )edit