IsaacLab icon indicating copy to clipboard operation
IsaacLab copied to clipboard

[Question] How to set the gravity mode of object?

Open tesollo-admin opened this issue 2 years ago • 1 comments

Hi,

When setting up my scene in isaac lab, if I defined an object using RigidObjectCfg and initially set disable_gravity=False via rigid_pros parameter using sim_utils.RigidBodyPropertiesCfg, how can I change it to disable_gravity=True (means zero gravity mode) at a specific point during the simulation?

If it doesn't work, Is there any solution?

Thank you in advance.

tesollo-admin avatar Jun 18 '24 07:06 tesollo-admin

Hi @cjoattesollo ,

If you go to the root PhysX view for the rigid body asset class, there is a function named: set_disable_gravities which allows you to set this attribute.

You can probably do something like this (not tested):

current_gravity_status = my_cube.root_physx_view.get_disable_gravities()
current_gravity_status[env_ids] = 0  # need to check if 0 means enable or disable
my_cube.root_physx_view.get_disable_gravities(current_gravity_status, env_ids)

Mayankm96 avatar Jun 18 '24 08:06 Mayankm96