diff --git a/2dof_description/meshes/base_link.STL b/2dof_description/meshes/base_link.STL new file mode 100644 index 0000000000000000000000000000000000000000..f411eb0ca2f85996ad754b5996b0ebf490110fe2 Binary files /dev/null and b/2dof_description/meshes/base_link.STL differ diff --git a/2dof_description/meshes/link1.STL b/2dof_description/meshes/link1.STL new file mode 100644 index 0000000000000000000000000000000000000000..3ec331c7a74bd1b98f4fd8c41aca87460864d042 Binary files /dev/null and b/2dof_description/meshes/link1.STL differ diff --git a/2dof_description/meshes/link2.STL b/2dof_description/meshes/link2.STL new file mode 100644 index 0000000000000000000000000000000000000000..3a7c9aee40d124ff2923aa3d8add33ecfba4e44d Binary files /dev/null and b/2dof_description/meshes/link2.STL differ diff --git a/2dof_description/urdf/2dof_planar.urdf b/2dof_description/urdf/2dof_planar.urdf new file mode 100644 index 0000000000000000000000000000000000000000..98fd66fb0027823a02d336698cec5bf09e7b8ca1 --- /dev/null +++ b/2dof_description/urdf/2dof_planar.urdf @@ -0,0 +1,167 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com) + Commit Version: 1.5.1-0-g916b5db Build Version: 1.5.7152.31018 + For more information, please see http://wiki.ros.org/sw_urdf_exporter --> +<robot + name="2dof_planar"> + <link + name="base_link"> + <inertial> + <origin + xyz="0.0030299 2.6279E-13 0.02912" + rpy="0 0 0" /> + <mass + value="0.10159" /> + <inertia + ixx="2.636E-05" + ixy="-1.007E-16" + ixz="-2.3835E-06" + iyy="1.8042E-05" + iyz="-4.6617E-09" + izz="1.8795E-05" /> + </inertial> + <visual> + <origin + xyz="0 0 0" + rpy="0 0 0" /> + <geometry> + <mesh + filename="package://2dof_description/meshes/base_link.STL" /> + </geometry> + <material + name=""> + <color + rgba="0.96078 1 0 1" /> + </material> + </visual> + <collision> + <origin + xyz="0 0 0" + rpy="0 0 0" /> + <geometry> + <mesh + filename="package://2dof_description/meshes/base_link.STL" /> + </geometry> + </collision> + </link> + <link + name="link1"> + <inertial> + <origin + xyz="0.0086107 2.1727E-06 0.036012" + rpy="0 0 0" /> + <mass + value="0.26703" /> + <inertia + ixx="0.00040827" + ixy="1.2675E-09" + ixz="1.8738E-05" + iyy="0.00038791" + iyz="3.5443E-08" + izz="3.6421E-05" /> + </inertial> + <visual> + <origin + xyz="0 0 0" + rpy="0 0 0" /> + <geometry> + <mesh + filename="package://2dof_description/meshes/link1.STL" /> + </geometry> + <material + name=""> + <color + rgba="0.64706 0.61961 0.58824 1" /> + </material> + </visual> + <collision> + <origin + xyz="0 0 0" + rpy="0 0 0" /> + <geometry> + <mesh + filename="package://2dof_description/meshes/link1.STL" /> + </geometry> + </collision> + </link> + <joint + name="joint1" + type="revolute"> + <origin + xyz="0.0060872 0 0.035" + rpy="0 0 0" /> + <parent + link="base_link" /> + <child + link="link1" /> + <axis + xyz="1 0 0" /> + <limit + lower="0" + upper="0" + effort="0" + velocity="0" /> + <dynamics + damping="0.05" /> + </joint> + <link + name="link2"> + <inertial> + <origin + xyz="-0.0050107 1.9371E-10 0.10088" + rpy="0 0 0" /> + <mass + value="0.33238" /> + <inertia + ixx="0.0011753" + ixy="-3.854E-13" + ixz="-2.9304E-08" + iyy="0.0011666" + iyz="-5.2365E-12" + izz="1.4553E-05" /> + </inertial> + <visual> + <origin + xyz="0 0 0" + rpy="0 0 0" /> + <geometry> + <mesh + filename="package://2dof_description/meshes/link2.STL" /> + </geometry> + <material + name=""> + <color + rgba="0.64706 0.61961 0.58824 1" /> + </material> + </visual> + <collision> + <origin + xyz="0 0 0" + rpy="0 0 0" /> + <geometry> + <mesh + filename="package://2dof_description/meshes/link2.STL" /> + </geometry> + </collision> + </link> + <joint + name="joint2" + type="revolute"> + <origin + xyz="0.023 0 0.1" + rpy="0 0 0" /> + <parent + link="link1" /> + <child + link="link2" /> + <axis + xyz="1 0 0" /> + <limit + lower="0" + upper="0" + effort="0" + velocity="0" /> + <dynamics + damping="0.05" /> + </joint> +</robot> diff --git a/CMakeLists.txt b/CMakeLists.txt index b4a94efc5d347a49fc527d5b350efaf22a44f3c4..b91bca73c4bf822c365611b76c0cb3f8c59796bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ IF(NOT INSTALL_PYTHON_INTERFACE_ONLY) INSTALL(DIRECTORY tiago_description DESTINATION share/${PROJECT_NAME}) INSTALL(DIRECTORY ur_description DESTINATION share/${PROJECT_NAME}) INSTALL(DIRECTORY hector_description DESTINATION share/${PROJECT_NAME}) + INSTALL(DIRECTORY 2dof_description DESTINATION share/${PROJECT_NAME}) ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY) SETUP_PROJECT_FINALIZE() diff --git a/python/example_robot_data/__init__.py b/python/example_robot_data/__init__.py index 43e7bfd55d151758deacb944a8ba0b6a26ac0dd3..4ae36c3b5c20e465ec0d4d175801309d85fa134f 100644 --- a/python/example_robot_data/__init__.py +++ b/python/example_robot_data/__init__.py @@ -1,3 +1,3 @@ # flake8: noqa from .robots_loader import (getModelPath, loadANYmal, loadHyQ, loadICub, loadSolo, loadTalos, loadTalosArm, - loadTalosLegs, loadTiago, loadTiagoNoHand, loadUR, loadHector, readParamsFromSrdf) + loadTalosLegs, loadTiago, loadTiagoNoHand, loadUR, loadHector, load2dof, readParamsFromSrdf) diff --git a/python/example_robot_data/__main__.py b/python/example_robot_data/__main__.py index 016466962ec10ed7b9e32d6fd76a3ea68ad21dc8..8af682185e77b5abe79f336680a782f59309ba60 100644 --- a/python/example_robot_data/__main__.py +++ b/python/example_robot_data/__main__.py @@ -3,7 +3,7 @@ from argparse import ArgumentParser from . import robots_loader ROBOTS = [ - 'anymal', 'hyq', 'solo', 'solo12', 'talos', 'talos_arm', 'talos_legs', 'tiago', 'tiago_no_hand', 'icub', 'ur5' + 'anymal', 'hyq', 'solo', 'solo12', 'talos', 'talos_arm', 'talos_legs', 'tiago', 'tiago_no_hand', 'icub', 'ur5', 'hector', '2dof' ] parser = ArgumentParser() @@ -65,3 +65,14 @@ elif args.robot == 'ur5': ur5 = robots_loader.loadUR() ur5.initViewer(loadModel=True) ur5.display(ur5.q0) + +if args.robot == 'hector': + hector = robots_loader.loadHector() + hector.initViewer(loadModel=True) + hector.display(hector.q0) + + +if args.robot == '2dof': + planar2dof = robots_loader.load2dof() + planar2dof.initViewer(loadModel=True) + planar2dof.display(planar2dof.q0) diff --git a/python/example_robot_data/robots_loader.py b/python/example_robot_data/robots_loader.py index f0f0d6e1269dd1c1c34cf7aa61b19a5c3868ce35..439f1b724702ca55c35188d5e91419989396e93d 100644 --- a/python/example_robot_data/robots_loader.py +++ b/python/example_robot_data/robots_loader.py @@ -236,3 +236,11 @@ def loadHector(): modelPath = getModelPath(URDF_SUBPATH) robot = RobotWrapper.BuildFromURDF(modelPath + URDF_SUBPATH, [modelPath], pinocchio.JointModelFreeFlyer()) return robot + + +def load2dof(): + URDF_FILENAME = "2dof_planar.urdf" + URDF_SUBPATH = "/2dof_description/urdf/" + URDF_FILENAME + modelPath = getModelPath(URDF_SUBPATH) + robot = RobotWrapper.BuildFromURDF(modelPath + URDF_SUBPATH, [modelPath]) + return robot