Skip to content

Commit

Permalink
Add Robotis Darwin OP 3 Resources and Tutorial (#148)
Browse files Browse the repository at this point in the history
* Add Robotis Darwin OP 3 resources.

* Add tutorial for Robotis OP 3.

* Correct issue with target values being hard-coded, rectify by passing target variable. Adjust target location to demonstrate elbow bend.
  • Loading branch information
zaksadiq authored Jul 6, 2024
1 parent 041945a commit d22a63d
Show file tree
Hide file tree
Showing 32 changed files with 1,889 additions and 0 deletions.
113 changes: 113 additions & 0 deletions resources/robotis_op3/generate_chains.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
from ikpy import chain


###### Left Arm ######

robotis_op3_left_arm_links = ["body_link",
"l_sho_pitch_link",
"l_sho_roll_link",
"l_el_link"]

robotis_op3_left_arm_joints = ["l_sho_pitch",
"l_sho_roll",
"l_el"]

robotis_op3_left_arm_elements = [x for pair in zip(robotis_op3_left_arm_links, robotis_op3_left_arm_joints) for x in pair] + ["l_el_link"]

# Note: 'Links' in IKPY correspond to 'Joints' in URDF terminology. 'Links' in URDF are stripped by IKPY.
robotis_op3_left_arm_chain = chain.Chain.from_urdf_file(
"urdf/robotis_op3.urdf",
base_elements=robotis_op3_left_arm_elements,
last_link_vector=[0, 0.10, 0],
active_links_mask=[False] + 3 * [True] + [False],
symbolic=False,
name="robotis_op3_left_arm")

robotis_op3_left_arm_chain.to_json_file(force=True)


###### Right Arm ######

robotis_op3_right_arm_links = ["body_link",
"r_sho_pitch_link",
"r_sho_roll_link",
"r_el_link"]

robotis_op3_right_arm_joints = ["r_sho_pitch",
"r_sho_roll",
"r_el"]

robotis_op3_right_arm_elements = [x for pair in zip(robotis_op3_right_arm_links, robotis_op3_right_arm_joints) for x in pair] + ["r_el_link"]

robotis_op3_right_arm_chain = chain.Chain.from_urdf_file(
"urdf/robotis_op3.urdf",
base_elements=robotis_op3_right_arm_elements,
last_link_vector=[0, -0.10, 0],
active_links_mask=[False] + 3 * [True] + [False],
symbolic=False,
name="robotis_op3_right_arm"
)

robotis_op3_right_arm_chain.to_json_file(force=True)


###### Left Leg ######

robotis_op3_left_leg_links = ["body_link",
"l_hip_yaw_link",
"l_hip_roll_link",
"l_hip_pitch_link",
"l_knee_link",
"l_ank_pitch_link",
"l_ank_roll_link"]

robotis_op3_left_leg_joints = ["l_hip_yaw",
"l_hip_roll",
"l_hip_pitch",
"l_knee",
"l_ank_pitch",
"l_ank_roll"]

robotis_op3_left_leg_elements = [x for pair in zip(robotis_op3_left_leg_links, robotis_op3_left_leg_joints) for x in pair] + ["l_ank_roll_link"]

robotis_op3_left_leg_chain = chain.Chain.from_urdf_file(
"urdf/robotis_op3.urdf",
base_elements=robotis_op3_left_leg_elements,
last_link_vector=[0, 0, -0],
active_links_mask=[False] + 6 * [True] + [False],
symbolic=False,
name="robotis_op3_left_leg"
)

robotis_op3_left_leg_chain.to_json_file(force=True)


###### Right Leg ######

robotis_op3_right_leg_links = ["body_link",
"r_hip_yaw_link",
"r_hip_roll_link",
"r_hip_pitch_link",
"r_knee_link",
"r_ank_pitch_link",
"r_ank_roll_link"]

robotis_op3_right_leg_joints = ["r_hip_yaw",
"r_hip_roll",
"r_hip_pitch",
"r_knee",
"r_ank_pitch",
"r_ank_roll"]

robotis_op3_right_leg_elements = [x for pair in zip(robotis_op3_right_leg_links, robotis_op3_right_leg_joints) for x in pair] + ["r_ank_roll_link"]

robotis_op3_right_leg_chain = chain.Chain.from_urdf_file(
"urdf/robotis_op3.urdf",
base_elements=robotis_op3_right_leg_elements,
last_link_vector=[0, 0, 0],
active_links_mask=[False] + 6 * [True] + [False],
symbolic=False,
name="robotis_op3_right_leg"
)

robotis_op3_right_leg_chain.to_json_file(force=True)
4 changes: 4 additions & 0 deletions resources/robotis_op3/generate_urdf_tree.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from ikpy.urdf.utils import get_urdf_tree

# Generate URDF Tree PDF
dot, urdf_tree = get_urdf_tree('robotis_op3.urdf', out_image_path='robotis_op3', root_element='body_link')
Binary file added resources/robotis_op3/meshes/base.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/body.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/h1.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/h2.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/la1.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/la2.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/la3.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/ll1.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/ll2.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/ll3.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/ll4.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/ll5.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/ll6.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/ra1.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/ra2.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/ra3.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/rl1.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/rl2.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/rl3.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/rl4.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/rl5.stl
Binary file not shown.
Binary file added resources/robotis_op3/meshes/rl6.stl
Binary file not shown.
91 changes: 91 additions & 0 deletions resources/robotis_op3/robotis_op3
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
digraph robot {
link_body_link [label=body_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_hip_yaw [label=l_hip_yaw color=green fillcolor=lightgrey style=filled]
link_body_link -> joint_l_hip_yaw
link_l_hip_yaw_link [label=l_hip_yaw_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_hip_yaw -> link_l_hip_yaw_link
joint_l_hip_roll [label=l_hip_roll color=green fillcolor=lightgrey style=filled]
link_l_hip_yaw_link -> joint_l_hip_roll
link_l_hip_roll_link [label=l_hip_roll_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_hip_roll -> link_l_hip_roll_link
joint_l_hip_pitch [label=l_hip_pitch color=green fillcolor=lightgrey style=filled]
link_l_hip_roll_link -> joint_l_hip_pitch
link_l_hip_pitch_link [label=l_hip_pitch_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_hip_pitch -> link_l_hip_pitch_link
joint_l_knee [label=l_knee color=green fillcolor=lightgrey style=filled]
link_l_hip_pitch_link -> joint_l_knee
link_l_knee_link [label=l_knee_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_knee -> link_l_knee_link
joint_l_ank_pitch [label=l_ank_pitch color=green fillcolor=lightgrey style=filled]
link_l_knee_link -> joint_l_ank_pitch
link_l_ank_pitch_link [label=l_ank_pitch_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_ank_pitch -> link_l_ank_pitch_link
joint_l_ank_roll [label=l_ank_roll color=green fillcolor=lightgrey style=filled]
link_l_ank_pitch_link -> joint_l_ank_roll
link_l_ank_roll_link [label=l_ank_roll_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_ank_roll -> link_l_ank_roll_link
joint_r_hip_yaw [label=r_hip_yaw color=green fillcolor=lightgrey style=filled]
link_body_link -> joint_r_hip_yaw
link_r_hip_yaw_link [label=r_hip_yaw_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_r_hip_yaw -> link_r_hip_yaw_link
joint_r_hip_roll [label=r_hip_roll color=green fillcolor=lightgrey style=filled]
link_r_hip_yaw_link -> joint_r_hip_roll
link_r_hip_roll_link [label=r_hip_roll_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_r_hip_roll -> link_r_hip_roll_link
joint_r_hip_pitch [label=r_hip_pitch color=green fillcolor=lightgrey style=filled]
link_r_hip_roll_link -> joint_r_hip_pitch
link_r_hip_pitch_link [label=r_hip_pitch_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_r_hip_pitch -> link_r_hip_pitch_link
joint_r_knee [label=r_knee color=green fillcolor=lightgrey style=filled]
link_r_hip_pitch_link -> joint_r_knee
link_r_knee_link [label=r_knee_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_r_knee -> link_r_knee_link
joint_r_ank_pitch [label=r_ank_pitch color=green fillcolor=lightgrey style=filled]
link_r_knee_link -> joint_r_ank_pitch
link_r_ank_pitch_link [label=r_ank_pitch_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_r_ank_pitch -> link_r_ank_pitch_link
joint_r_ank_roll [label=r_ank_roll color=green fillcolor=lightgrey style=filled]
link_r_ank_pitch_link -> joint_r_ank_roll
link_r_ank_roll_link [label=r_ank_roll_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_r_ank_roll -> link_r_ank_roll_link
joint_l_sho_pitch [label=l_sho_pitch color=green fillcolor=lightgrey style=filled]
link_body_link -> joint_l_sho_pitch
link_l_sho_pitch_link [label=l_sho_pitch_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_sho_pitch -> link_l_sho_pitch_link
joint_l_sho_roll [label=l_sho_roll color=green fillcolor=lightgrey style=filled]
link_l_sho_pitch_link -> joint_l_sho_roll
link_l_sho_roll_link [label=l_sho_roll_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_sho_roll -> link_l_sho_roll_link
joint_l_el [label=l_el color=green fillcolor=lightgrey style=filled]
link_l_sho_roll_link -> joint_l_el
link_l_el_link [label=l_el_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_l_el -> link_l_el_link
joint_r_sho_pitch [label=r_sho_pitch color=green fillcolor=lightgrey style=filled]
link_body_link -> joint_r_sho_pitch
link_r_sho_pitch_link [label=r_sho_pitch_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_r_sho_pitch -> link_r_sho_pitch_link
joint_r_sho_roll [label=r_sho_roll color=green fillcolor=lightgrey style=filled]
link_r_sho_pitch_link -> joint_r_sho_roll
link_r_sho_roll_link [label=r_sho_roll_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_r_sho_roll -> link_r_sho_roll_link
joint_r_el [label=r_el color=green fillcolor=lightgrey style=filled]
link_r_sho_roll_link -> joint_r_el
link_r_el_link [label=r_el_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_r_el -> link_r_el_link
joint_head_pan [label=head_pan color=green fillcolor=lightgrey style=filled]
link_body_link -> joint_head_pan
link_head_pan_link [label=head_pan_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_head_pan -> link_head_pan_link
joint_head_tilt [label=head_tilt color=green fillcolor=lightgrey style=filled]
link_head_pan_link -> joint_head_tilt
link_head_tilt_link [label=head_tilt_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_head_tilt -> link_head_tilt_link
joint_cam [label=cam color=green fillcolor=lightgrey style=filled]
link_head_tilt_link -> joint_cam
link_cam_link [label=cam_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_cam -> link_cam_link
joint_cam_gazebo [label=cam_gazebo color=green fillcolor=lightgrey style=filled]
link_head_tilt_link -> joint_cam_gazebo
link_cam_gazebo_link [label=cam_gazebo_link color=blue fillcolor=lightgrey shape=box style=filled]
joint_cam_gazebo -> link_cam_gazebo_link
}
Binary file added resources/robotis_op3/robotis_op3.pdf
Binary file not shown.
Loading

0 comments on commit d22a63d

Please sign in to comment.