jrl-umi3218 / mc_rtc

mc_rtc is an interface for simulated and real robotic systems suitable for real-time control
BSD 2-Clause "Simplified" License
122 stars 36 forks source link

[Collisions] Allow to select unactive joints #416

Closed arntanguy closed 10 months ago

arntanguy commented 11 months ago

This PR adds the ability to select unactive joints in a collision constraint. Without this we do not have the ability to disable all joints of a robot in a collision constraint, and more often than not it's more natural to specify which joints we want to disable.

This:

- type: collision
  r1: hrp4
  r2: human
  collisions:
    - body1: L_ELBOW_P_LINK
      body2: TorsoLink
      iDist: 0.03
      sDist: 0.001
      r2UnactiveJoints: &unactiveJoints
        [Root, base, Torso_0, Torso_1, Torso_2, Head_0, Head_1, Head_2, LArm_0, LArm_1, LArm_2, LElbow, LForearm, LWrist_0, LWrist_1, LHand, LHandThumbLink1, LHandThumbLink2, LHandThumbLink3, LHandIndexLink1, LHandIndexLink2, LHandIndexLink3, LHandMiddleLink1, LHandMiddleLink2, LHandMiddleLink3, LHandRingLink1, LHandRingLink2, LHandRingLink3, LHandBabyLink1, LHandBabyLink2, LHandBabyLink3, RArm_0, RArm_1, RArm_2, RElbow, RForearm, RWrist_0, RWrist_1, RHand, RHandThumbLink1, RHandThumbLink2, RHandThumbLink3, RHandIndexLink1, RHandIndexLink2, RHandIndexLink3, RHandMiddleLink1, RHandMiddleLink2, RHandMiddleLink3, RHandRingLink1, RHandRingLink2, RHandRingLink3, RHandBabyLink1, RHandBabyLink2, RHandBabyLink3, LLeg_0, LLeg_1, LLeg_2, LShin_0, LAnkle_0, LAnkle_1, RLeg_0, RLeg_1, RLeg_2, RShin_0, RAnkle_0, RAnkle_1]
    - body1: L_WRIST_Y_LINK
      body2: TorsoLink
      iDist: 0.03
      sDist: 0.001
      damping: 0
      r2UnactiveJoints: *unactiveJoints

Slightly annoying, with this way of describing it we do not have a direct way of disabling all joints short of listing them all in YAML.

arntanguy commented 10 months ago

Sorry I mistakenly thought r1ActiveJoints was the currently supported option.

I chose the following:

I think this should cover all cases this time ;)