IsaacLab
IsaacLab copied to clipboard
[Question] How to set the gravity mode of object?
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.
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)