Gazebo | Ignition | Community
Ask Your Question

How to change sdf parameter static from GUI plugin?

asked 2019-10-01 09:55:13 -0500

Boris94 gravatar image

updated 2019-10-01 09:56:40 -0500

I created GUI plugin with button that spawns objects. For objects i have sdf files with default parameters. Only parameter that i change in plugin is pose, where i use mutable_pose like this:

msgs::Set(msg_.mutable_pose(), ignition::math::Pose3d(0, 0, 0, 0, 0, 0);

This is working correctly. Is there any way to do something similar for static parameter? My sdf objects have static set to false, but i'd like to change it to true by clicking button. Thanks for any help.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-10-14 08:24:46 -0500

chapulina gravatar image

I assume you're using a gazebo::msgs::Factory message to spawn your models. As you can see in the message description, there's a field to override pose, which you're using, but no field to override static. So one thing you could do is edit the model's SDF before spawning.

edit flag offensive delete link more

answered 2019-10-02 04:41:18 -0500

kumpakri gravatar image

See the Gazebo 9 API for the available functions.

edit flag offensive delete link more


i tried, but i cant even find mutable_pose(), which i used in example above

Boris94 gravatar imageBoris94 ( 2019-10-02 10:34:17 -0500 )edit

You are supposed to call the void SetStatic (const bool & _static) function on a model object.

kumpakri gravatar imagekumpakri ( 2019-10-03 03:36:10 -0500 )edit

The Entity API shouldn't apply in this case, since they're using a GUI plugin. Also note that the SetStatic function doesn't work. To understand why mutable_pose is not in the Gazebo API, see this answer

chapulina gravatar imagechapulina ( 2019-10-14 08:28:09 -0500 )edit

i called SetStatic on model, when i click on model it appears that static is true, but model is still colliding and moving

Boris94 gravatar imageBoris94 ( 2019-11-04 04:07:42 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-10-01 09:55:13 -0500

Seen: 157 times

Last updated: Oct 14 '19