Example #1
0
 def object_in_gripper(self, width_object):
     """
     This method checks if the object is in the gripper, then position_value of gripper should be greater as -0.5
     :param width_object: float
     :return: false or true, boolean
     """
     self.move_gripper(-2, 1, 0.8)
     l = Listener()
     l.set_topic_and_typMEssage("/hsrb/joint_states", JointState)
     l.listen_topic_with_sensor_msg()
     current_hand_motor_value = l.get_value_from_sensor_msg(
         "hand_motor_joint")
     print("Current hand motor joint is:")
     print current_hand_motor_value
     print("Is object in gripper ?")
     print current_hand_motor_value >= -0.5
     return current_hand_motor_value >= -0.5