Repository navigation
[Question] Self Collision with robot #3352
Replies: 3 comments
|
Thank you for posting this. The current Isaac Lab contact sensor system primarily detects contact forces between the sensor's body and other filtered bodies, but it cannot directly specify if a contact is due to self-collision (robot against itself) versus collision with the environment (e.g., ground) using a single default sensor configuration. I'll move this post to our Discussions section for the team and others to follow up. |
|
Yes. You can do this with the existing First, check that self-collision is turned on. Most bundled robot configs turn it off (for example, the Unitree configs use robot_cfg = UNITREE_GO2_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot")
robot_cfg.spawn.articulation_props.enabled_self_collisions = True
# spawn.activate_contact_sensors must also be True (it already is in these configs)PhysX never makes contacts between two links that a joint connects directly. Only non-adjacent links can collide. Option 1: filter against the robot's own links. This gives explicit self-contact: knee_self = ContactSensorCfg(
prim_path="{ENV_REGEX_NS}/Robot/FL_calf", # one body per sensor
filter_prim_paths_expr=[
"{ENV_REGEX_NS}/Robot/FR_calf",
"{ENV_REGEX_NS}/Robot/base",
],
)
# data.force_matrix_w[:, 0, j] -> force from filter jOption 2: filter only against the ground, and treat the rest as non-ground. foot = ContactSensorCfg(
prim_path="{ENV_REGEX_NS}/Robot/FL_foot",
filter_prim_paths_expr=["/World/ground/terrain/GroundPlane/CollisionPlane"],
)
s = env.scene["foot"]
ground = s.data.force_matrix_w[:, 0, 0]
other = s.data.net_forces_w[:, 0] - ground # self-contact (+ any other object)Use the path of your ground's collision prim. Find it in the Stage tree. The path above is the one IsaacLab's contact sensor tests use for a Limit on the PhysX backend: filtering is one-to-many only. The current To check: put the robot in a pose where two non-adjacent links touch, and print |
Uh oh!
There was an error while loading. Please reload this page.
I want to differentiate between a contact sensors collision with the ground and with the robot itself. Is there any way to do this with the current contact sensor application. If not is there a way to figure out if a robot (articulation object) has collided with itself.
All reactions