Replies: 2 comments 2 replies
-
|
Hi @cjoattesollo , If you go to the root PhysX view for the rigid body asset class, there is a function named: 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) |
Beta Was this translation helpful? Give feedback.
-
|
Does anyone know why this doesn't work for me? @configclass
class MySceneCfg(InteractiveSceneCfg):
# objects
object: RigidObjectCfg = RigidObjectCfg(
prim_path="{ENV_REGEX_NS}/object",
spawn=sim_utils.UsdFileCfg(
usd_path=".../objec.usd",
rigid_props=sim_utils.RigidBodyPropertiesCfg(
kinematic_enabled=False,
disable_gravity=True,
enable_gyroscopic_forces=True,
solver_position_iteration_count=8,
solver_velocity_iteration_count=0,
sleep_threshold=0.005,
stabilization_threshold=0.0025,
max_depenetration_velocity=1000.0,
),
mass_props=sim_utils.MassPropertiesCfg(density=400.0),
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.95, 0.8, 0.3)),
),
init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, 0.0, 0.5), rot=(1.0, 0.0, 0.0, 0.0)),
)
# lights
light = AssetBaseCfg(
prim_path="/World/light",
spawn=sim_utils.DistantLightCfg(color=(0.95, 0.95, 0.95), intensity=1000.0),
)
dome_light = AssetBaseCfg(
prim_path="/World/domeLight",
spawn=sim_utils.DomeLightCfg(color=(0.02, 0.02, 0.02), intensity=1000.0),
)As shown, I set After one second, I run the following function (triggered by one of my def enable_object_gravity(
env: ManagerBasedEnv,
env_ids: torch.Tensor,
asset_cfg: SceneEntityCfg = SceneEntityCfg("object"),
):
"""Enable gravity for the given asset.
"""
# extract the used quantities (to enable type-hinting)
asset: RigidObject = env.scene[asset_cfg.name]
cur_gravity_status = asset.root_physx_view.get_disable_gravities()
cur_gravity_status[env_ids] = 0
asset.root_physx_view.set_disable_gravities(cur_gravity_status, env_ids.to(cur_gravity_status.device))I confirmed that:
However, despite these checks, the object does not fall as expected. It stays in its initial position as if gravity were still disabled. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
When setting up my scene in isaac lab, if I defined an object using
RigidObjectCfgand initially setdisable_gravity=Falseviarigid_prosparameter usingsim_utils.RigidBodyPropertiesCfg, how can I change it todisable_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.
Beta Was this translation helpful? Give feedback.
All reactions