Example #1
0
    def test(self):
        self.comp_class = ariac_example.MyCompetitionClass()
        ariac_example.connect_callbacks(self.comp_class)
        time.sleep(1.0)
        self.prepare_tf()

        # Pre-defined initial pose because sometimes the arm starts "droopy"
        self._send_arm_to_initial_pose()

        # Pre-defined pose that puts the gripper in contact with a product.
        self._send_arm_to_product()

        # Enable the gripper so that it picks up the product.
        self._test_enable_gripper()

        # Move the product over the shipping box using a pre-defined sequence of poses.
        self._send_arm_to_shipping_box()
        self.assertTrue(self.comp_class.current_gripper_state.enabled,
                        'Gripper no longer enabled')
        self.assertFalse(self.comp_class.current_gripper_state.attached,
                         'Product is still attached')

        self._test_dropped_product_pose()

        time.sleep(1.0)
    def test(self):
        self.comp_class = ariac_example.MyCompetitionClass()
        ariac_example.connect_callbacks(self.comp_class)
        time.sleep(1.0)

        # Pre-defined initial pose because sometimes the arm starts "droopy"
        self._send_arm_to_initial_pose()

        # Pre-defined pose that puts the gripper in contact with a part.
        self._send_arm_to_part()

        # Pick up and drop the part multiple times.
        # Regression test for https://bitbucket.org/osrf/ariac/issues/61
        for i in range(100):
            print(
                'Enabling & disabling gripper for the {0}th time...'.format(i))
            self._enable_gripper()
            self._disable_gripper()

        # Enable the gripper so that it picks up the part.
        self._test_enable_gripper()

        # Move the part over the tray using a pre-defined sequence of poses.
        self._send_arm_to_tray()
        self.assertTrue(self.comp_class.current_gripper_state.enabled,
                        'Gripper no longer enabled')
        self.assertTrue(self.comp_class.current_gripper_state.attached,
                        'Part no longer attached')

        # Disable the gripper so that it drops the part.
        self._test_disable_gripper()

        time.sleep(1.0)
Example #3
0
    def test(self):
        self.comp_class = ariac_example.MyCompetitionClass()
        ariac_example.connect_callbacks(self.comp_class)
        time.sleep(1.0)

        # Pre-defined initial pose because sometimes the arm starts "droopy"
        self._send_arm_to_initial_pose()

        # Pre-defined pose that puts the gripper in contact with a part.
        self._send_arm_to_part()

        # Enable the gripper so that it picks up the part.
        self._test_enable_gripper()

        # Move the part over the tray using a pre-defined sequence of poses.
        self._send_arm_to_tray()
        self.assertTrue(self.comp_class.current_gripper_state.enabled,
                        'Gripper no longer enabled')
        self.assertTrue(self.comp_class.current_gripper_state.attached,
                        'Part no longer attached')

        # Disable the gripper so that it drops the part.
        self._test_disable_gripper()

        time.sleep(1.0)
Example #4
0
    def prepare_tester(self):
        self.comp_class = ariac_example.MyCompetitionClass()
        ariac_example.connect_callbacks(self.comp_class)

        self.current_comp_score = None
        self.comp_state_sub = rospy.Subscriber("/ariac/current_score", Float32,
                                               self.comp_score_callback)

        # Pre-defined initial pose because sometimes the arm starts "droopy"
        self._send_arm_to_initial_pose()
def main():
    rospy.init_node("ariac_example_node")

    comp_class = ariac_example.MyCompetitionClass()
    ariac_example.connect_callbacks(comp_class)

    rospy.loginfo("Setup complete.")
    ariac_example.start_competition()

    if not comp_class.has_been_zeroed:
        comp_class.has_been_zeroed = True
        rospy.loginfo("Sending arm to zero joint positions...")
        comp_class.send_arm_to_state([0] * len(comp_class.arm_joint_names))

    rospy.spin()
    def test(self):
        self.comp_class = ariac_example.MyCompetitionClass()
        ariac_example.connect_callbacks(self.comp_class)
        time.sleep(1.0)

        self._send_arms_to_initial_pose()

        self._send_arm1_to_product()

        self._enable_gripper(arm=1)
        time.sleep(2.0)
        self.assertTrue(self.comp_class.arm_1_current_gripper_state.enabled)
        self.assertTrue(self.comp_class.arm_1_current_gripper_state.attached)

        self._send_arm1_to_tray()
        self.assertTrue(self.comp_class.arm_1_current_gripper_state.enabled)
        self.assertFalse(self.comp_class.arm_1_current_gripper_state.attached)
Example #7
0
    def test(self):
        self.comp_class = ariac_example.MyCompetitionClass()
        ariac_example.connect_callbacks(self.comp_class)
        time.sleep(1.0)

        # Pre-defined initial pose because sometimes the arms start "droopy"
        self._send_arms_to_initial_pose()

        # Pre-defined pose that puts the gripper in contact with a product.
        self._send_arm1_to_product()
        self._send_arm2_to_product()

        # Enable the gripper so that it picks up the product.
        self._test_enable_gripper()

        self._send_arm1_to_tray()
        self._send_arm2_to_tray()

        # Disable the gripper so that it drops the product.
        self._test_disable_gripper()
Example #8
0
def main():
    rospy.init_node("ariac_example_node")

    comp_class = ariac_example.MyCompetitionClass()
    ariac_example.connect_callbacks(comp_class)

    rospy.loginfo("Setup complete.")
    ariac_example.start_competition()

    if not comp_class.arm_1_has_been_zeroed:
        comp_class.send_arm_to_state(
            [0] * len(comp_class.arm_joint_names),
            comp_class.arm_1_joint_trajectory_publisher)
        comp_class.arm_1_has_been_zeroed = True

    if not comp_class.arm_2_has_been_zeroed:
        comp_class.send_arm_to_state(
            [0] * len(comp_class.arm_joint_names),
            comp_class.arm_2_joint_trajectory_publisher)
        comp_class.arm_2_has_been_zeroed = True

    rospy.spin()