Home | Tutorials | Wiki | Issues
Ask Your Question
0

How to change sdf parameter static from GUI plugin?

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

Boris94 gravatar image

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

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
1

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

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
0

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

kumpakri gravatar image

See the Gazebo 9 API for the available functions.

edit flag offensive delete link more

Comments

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

Boris94 gravatar imageBoris94 ( 2019-10-02 10:34:17 -0600 )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 -0600 )edit
1

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 -0600 )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 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 80 times

Last updated: Oct 14