예제 #1
0
 def _close_hand(self):
     self._zero_tactile()
     self._enable_tactile_stops()
     # Close the hand at constant velocity until it contacts object
     vel_cmd = VelocityCommand()
     vel_cmd.f1 = 1.0
     vel_cmd.f2 = 1.0  # bad finger
     vel_cmd.f3 = 1.0
     vel_cmd.preshape = 0.0
     for i in range(10):
         self.vel_cmd_pub.publish(vel_cmd)
예제 #2
0
 def vel_pub(self, event=None, v=None):
     """
     While the internal representation holds to Romano's conventions of
     negative velocity => closing, the reflex hand has the opposite convention,
     so this function exists to abstract that detail away from the rest of
     the functions. This way, we can remain as close as possible to Romano's
     representation.
     """
     if v is None:
         v = self.v_des
     vel_cmd = VelocityCommand()
     # Potentially halve each velocity, since the closure is coming from both directions?
     vel_cmd.f1 = -v
     vel_cmd.f2 = -v
     vel_cmd.f3 = -v
     vel_cmd.preshape = 0.0
     self.vel_cmd_pub.publish(vel_cmd)