SelfCollisionBarrier to avoid robotic arm hitting itself? #113
-
Hi there, Given a urdf file with specified collision. What would be the right approach, to avoid the robot hitting itself (or go through itself) ? I also tried to modify the code in examples/arm_ur5.py and adding (line 52) robot.collision_model.addAllCollisionPairs()
collision_barrier = SelfCollisionBarrier(
n_collision_pairs=len(robot.collision_model.collisionPairs),
gain=20.0,
safe_displacement_gain=1.0,
d_min=0.05,
)
barriers = [collision_barrier]
configuration = pink.Configuration(robot.model, robot.data, q_ref,
collision_model=robot.collision_model,
# Collision model is required for self_collision_barrier
collision_data=robot.collision_data, ) I then added Would be grateful for any hint! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can take a look at the self-collision examples in the examples/barriers directory. Those should be closer to what you are looking for here:
For a single-arm you can just skip the dual-arm duplication step at the beginning of these scripts. |
Beta Was this translation helpful? Give feedback.
You can take a look at the self-collision examples in the examples/barriers directory. Those should be closer to what you are looking for here:
kukas_self_collision.py
: whole-body self-collision avoidanceyumi_self_collision.py
: self-collision avoidance with spheresFor a single-arm you can just skip the dual-arm duplication step at the beginning of these scripts.