2 import robowflex_visualization
as rv
7 importlib.reload(rv.robot)
8 importlib.reload(rv.scene)
9 importlib.reload(rv.primitives)
10 importlib.reload(rv.utils)
13 fetch = rv.robot.Robot(
"Fetch",
"package://robowflex_resources/fetch/robots/fetch.urdf")
16 fetch.set_joint(
"l_gripper_finger_joint", 0.05)
17 fetch.set_joint(
"r_gripper_finger_joint", 0.05)
20 fetch.set_joint(
"head_pan_joint", 0)
21 fetch.set_joint(
"head_tilt_joint", 0)
22 fetch.add_keyframe(
"head_pan_joint", 0)
23 fetch.add_keyframe(
"head_tilt_joint", 0)
26 fetch.set_joint(
"head_pan_joint", math.radians(50))
27 fetch.set_joint(
"head_tilt_joint", math.radians(30))
28 fetch.add_keyframe(
"head_pan_joint", 60)
29 fetch.add_keyframe(
"head_tilt_joint", 60)
32 scene = rv.scene.Scene(
"Scene",
33 "package://robowflex_library/yaml/test_fetch.yml")
36 frame = fetch.animate_path(
37 "package://robowflex_visualization/yaml/fetch_pick.yml",
43 fetch.add_keyframe(
"l_gripper_finger_joint", frame)
44 fetch.add_keyframe(
"r_gripper_finger_joint", frame)
47 fetch.add_keyframe(
"head_pan_joint", frame)
48 fetch.add_keyframe(
"head_tilt_joint", frame)
51 cube = scene.get_object(
"Cube3")
52 fetch.attach_object(
"wrist_roll_link", cube, frame)
55 fetch.set_joint(
"l_gripper_finger_joint", 0.04)
56 fetch.set_joint(
"r_gripper_finger_joint", 0.04)
57 fetch.add_keyframe(
"l_gripper_finger_joint", frame + 30)
58 fetch.add_keyframe(
"r_gripper_finger_joint", frame + 30)
61 frame = fetch.animate_path(
62 "package://robowflex_visualization/yaml/fetch_pick.yml",
69 fetch.set_joint(
"head_pan_joint", 0)
70 fetch.set_joint(
"head_tilt_joint", 0)
71 fetch.add_keyframe(
"head_pan_joint", frame)
72 fetch.add_keyframe(
"head_tilt_joint", frame)