Replace hard-coded inCollision check with num_contacts from the status dictionary. Whereas the inCollision method in the Robot class has a bunch of hard-coded effort values to try to estimate if the robot is in collision with an object, the num_contacts integer is a counter that increments each time the robot detects that the joint has made a collision / contact with another object. Furthermore, the thresholds that num_contacts is calculated from is calibrated uniquely for each robot.
Replace hard-coded
inCollision
check withnum_contacts
from the status dictionary. Whereas theinCollision
method in the Robot class has a bunch of hard-coded effort values to try to estimate if the robot is in collision with an object, thenum_contacts
integer is a counter that increments each time the robot detects that the joint has made a collision / contact with another object. Furthermore, the thresholds thatnum_contacts
is calculated from is calibrated uniquely for each robot.