Gazebo | Ignition | Community
Ask Your Question

SetStatic doesnt make my object immovable

asked 2019-11-04 03:34:26 -0500

Boris94 gravatar image

updated 2019-11-04 08:20:19 -0500

I'm spawning my SDF model with static parameter as false, model spawns, moves and is affected by physics.
What i'd like to do is to make this model static from plugin somewhere in the middle of simulation.

I tried to call model->SetStatic(true), which doesnt work. When i check model in simulation i can see that static is checked, but object is still moving and affected by other models.

image description

is_static is clearly true but model is still moving for some reason

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-04 11:27:41 -0500

chapulina gravatar image

I'm spawning my SDF model with static parameter as false

How are you setting the model to static at spawn time?

Setting a model to static after it's been spawned doesn't work, so the model should be static from startup. As far as I know, the only way of doing this is having <static>true</static> inside your model's SDF.

edit flag offensive delete link more


well i wanted object to spawn as static-false and after some time, i would change this from plugin at runtime to statit-true so its not affected by physics, but seems like it is not possible right now

Boris94 gravatar imageBoris94 ( 2019-11-04 11:32:43 -0500 )edit

Yes, unfortunately that's not possible yet. You could delete and respawn the model, or attach it with a fixed joint to the world and then detach it.

chapulina gravatar imagechapulina ( 2019-11-04 11:49:47 -0500 )edit

Question Tools



Asked: 2019-11-04 03:34:26 -0500

Seen: 1,136 times

Last updated: Nov 04 '19