示例#1
0
    parser.add_argument('--host',
                        default='172.16.0.2',
                        help='FCI IP of the robot')
    args = parser.parse_args()

    robot = Robot(args.host)
    gripper = robot.get_gripper()

    robot.set_default_behavior()
    robot.recover_from_errors()
    robot.set_dynamic_rel(0.2)

    home_left = Waypoint(Affine(0.480, -0.15, 0.40), 1.65)
    home_right = Waypoint(Affine(0.450, 0.05, 0.35), 1.65)

    motion = WaypointMotion([home_left], return_when_finished=False)
    thread = robot.move_async(motion)

    gripper_thread = gripper.move_unsafe_async(0.05)

    for new_affine, new_width in [(home_right, 0.02), (home_left, 0.07),
                                  (home_right, 0.0)]:
        input('Press enter for new affine (also while in motion!)\n')
        motion.set_next_waypoint(new_affine)
        gripper_thread = gripper.move_unsafe_async(new_width)

    input('Press enter to stop\n')
    motion.finish()
    thread.join()
    gripper_thread.join()
示例#2
0
    # Connect to the robot
    robot = Robot('172.16.0.2')
    robot.set_default_behavior()
    robot.recover_from_errors()

    # Reduce the acceleration and velocity dynamic
    robot.set_dynamic_rel(0.2)

    joint_motion = JointMotion([
        -1.811944, 1.179108, 1.757100, -2.14162, -1.143369, 1.633046, -0.432171
    ])
    robot.move(joint_motion)

    # Define and move forwards
    impedance_motion = ImpedanceMotion(200.0, 20.0)
    robot_thread = robot.move_async(impedance_motion)

    sleep(0.05)

    initial_target = impedance_motion.target
    print('initial target: ', initial_target)

    sleep(0.5)

    impedance_motion.target = Affine(y=0.15) * initial_target
    print('set new target: ', impedance_motion.target)

    sleep(2.0)

    impedance_motion.finish()
    robot_thread.join()