def __init__(self):
        super(ReflexTakktileHand, self).__init__('/reflex_takktile2',
                                                 ReflexTakktileMotor)
        self.motor_cmd_pub = rospy.Publisher(
            self.namespace + '/radian_hand_command',
            reflex_msgs2.msg.RadianServoCommands,
            queue_size=10)
        self.fingers = {
            self.namespace + '_f1': finger.Finger(),
            self.namespace + '_f2': finger.Finger(),
            self.namespace + '_f3': finger.Finger()
        }
        self._connect_motors_to_fingers()
        self.set_speed_service = rospy.ServiceProxy(
            self.namespace + '/set_speed', reflex_msgs2.srv.SetSpeed)
        self.calibrate_fingers_service = rospy.ServiceProxy(
            self.namespace + '/calibrate_fingers', Empty)
        self.calibrate_tactile_service = rospy.ServiceProxy(
            self.namespace + '/calibrate_tactile', Empty)

        # ............................................TODO(LANCE): Figure this out! Use this for prompts similar to the two lines above
        self.calibrate_imus = rospy.ServiceProxy(
            self.namespace + '/imu_calibrate', Empty)

        rospy.Service(self.namespace + '/enable_tactile_stops', Empty,
                      self.enable_tactile_stops)
        rospy.Service(self.namespace + '/disable_tactile_stops', Empty,
                      self.disable_tactile_stops)
        self.tactile_stops_enabled = False
        self.comms_timeout = 5.0  # Seconds with no communications until hand stops
        self.latest_update = rospy.get_rostime()
        rospy.Subscriber(self.namespace + '/hand_state', reflex_msgs2.msg.Hand,
                         self._receive_hand_state_cb)
Esempio n. 2
0
    def __init__(self):
        super(ReflexTakktileHand, self).__init__('/reflex_takktile',
                                                 ReflexTakktileMotor)
        self.motor_cmd_pub = rospy.Publisher(
            self.namespace + '/radian_hand_command',
            reflex_msgs.msg.RadianServoCommands,
            queue_size=10)
        self.fingers = {
            self.namespace + '_f1': finger.Finger(),
            self.namespace + '_f2': finger.Finger(),
            self.namespace + '_f3': finger.Finger()
        }
        self._connect_motors_to_fingers()
        self.set_speed_service = rospy.ServiceProxy(
            self.namespace + '/set_speed', reflex_msgs.srv.SetSpeed)
        self.calibrate_fingers_service = rospy.ServiceProxy(
            self.namespace + '/calibrate_fingers', Empty)
        self.zero_pose_service = rospy.ServiceProxy(
            self.namespace + '/zero_pose', Empty)
        self.calibrate_tactile_service = rospy.ServiceProxy(
            self.namespace + '/calibrate_tactile', Empty)
        rospy.Service(self.namespace + '/enable_tactile_stops', Empty,
                      self.enable_tactile_stops)
        rospy.Service(self.namespace + '/disable_tactile_stops', Empty,
                      self.disable_tactile_stops)
        rospy.Service(self.namespace + '/calibrate_fingers_manual', Empty,
                      self.calibrate_fingers_manual)

        self.tactile_stops_enabled = False
        self.comms_timeout = 5.0  # Seconds with no communications until hand stops
        self.latest_update = rospy.get_rostime()
        rospy.Subscriber(self.namespace + '/hand_state', reflex_msgs.msg.Hand,
                         self._receive_hand_state_cb)
Esempio n. 3
0
    def __init__(self):
        self.obj = bpy.data.objects["violin"]
        ### coordinates in violin-space
        ### (can't change parents during animation, so no string-space coords)
        self.string_coords    = self.get_string_coords()

        ### normalized "coordinate system" of violin
        self.away_from_bridge = self.get_away_from_bridge()
        self.towards_frog     = self.get_towards_frog()
        self.away_from_string = self.get_away_from_string()

        ### other stup
        self.string_length    = self.get_string_length()
        self.string_angles    = self.get_string_angles()

        ### pluck
        self.pluck = pluck.Pluck(self)

        ### bow
        self.bow = bow.Bow(self)

        ### fingers
        self.fingers = list(map(lambda x: finger.Finger(self, x),
                            range(len(STRINGS))))

        ### camera
        self.camera = 0

        ### initialize positions
        self.bow_action(0, 0, 0, 0, 1)
        for i in range(len(STRINGS)):
            self.finger_action(i, 0.0, 1)