Isaac Sim Version
4.5.0
Operating System
Ubuntu 22.04
GPU Information
- Model: NVIDIA GeForce RTX 4060
- Driver Version: 550.144.03
Topic Description
Detailed Description
I can access and modify restitution coefficient for both terrains and rigid_objects in IsaacGym.
I can do the same things to terrains in IsaacLab too,
but I tried to check many class configuring files in the source category of IsaacLab repository,
still don’t know how to access and modify restitution coefficient of rigid object in IsaacLab.
Can anyone give a help, thank you a lot!
In IsaacGym,
- as the example code file(IsaacGym/python/examples/body_physics_props.py) shows,
the restitution attribute of rigid object can be easily accessed via the returned class of function get_actor_rigid_shape_properties() —— isaacgym.gymapi.RigidShapeProperties.
# add box actor
pose = gymapi.Transform()
pose.p = gymapi.Vec3(0.0, 0.5, 0.0)
pose.r = gymapi.Quat(0, 2, 2, 1) # 怎么改变四元数呢?
box_handle = gym.create_actor(env, asset_box, pose, "actor1", i, 0) # actor 创建的时候要制定位置和姿态
actor_handles.append(box_handle)
# set restitution for box actor
shape_props = gym.get_actor_rigid_shape_properties(env, box_handle)
shape_props[0].restitution = 1.0
shape_props[0].compliance = 0.5
gym.set_actor_rigid_shape_properties(env, box_handle, shape_props)
# add capsule actor
pose.p = gymapi.Vec3(0.0, 2.0, 0.0)
capsule_handle = gym.create_actor(env, asset_capsule, pose, "actor2", i, 0)
- the restitution exponent of a terrain can also be modified with class isaacgym.gymapi.PlaneParams
In IsaacLab, similarly, the restitution attribute of terrain, which is often configured by RigidBodyMaterialCfg can be accessed.
members of isaaclab.sim.spawners.materials.RigidBodyMaterialCfg
An example is as follows:
terrain = TerrainImporterCfg(
prim_path="/World/ground",
terrain_type="plane",
collision_group=-1,
physics_material=sim_utils.RigidBodyMaterialCfg(
friction_combine_mode="average",
restitution_combine_mode="average",
# friction coefficient
static_friction=1.0,
dynamic_friction=1.0,
# elastic coefficient
restitution=0.0,
),
debug_vis=False,
)
However, I didn’t found that how to access the restitution attribute of a rigid_body or articulation.
members of isaaclab.assets.RigidObject
members of isaaclab.assets.RigidObjectCfg
members of isaaclab.sim.spawners.SpawnerCfg
members of isaaclab.sim.spawners.RigidObjectSpawnerCfg
members of isaaclab.sim.spawners.from_files.UsdFileCfg
An example(IsaacLab/scripts/tutorials/01_assets/run_rigid_object.py) is as follows:
cone_cfg = RigidObjectCfg(
prim_path="/World/Origin.*/Cone",
spawn=sim_utils.ConeCfg(
radius=0.1,
height=0.2,
rigid_props=sim_utils.RigidBodyPropertiesCfg(),
mass_props=sim_utils.MassPropertiesCfg(mass=1.0),
collision_props=sim_utils.CollisionPropertiesCfg(),
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.0, 1.0, 0.0), metallic=0.2),
),
init_state=RigidObjectCfg.InitialStateCfg(),
)
cone_object = RigidObject(cfg=cone_cfg)
I can’t figure out how to modify the restitution coefficient of rigid object in the code example