Git Product home page Git Product logo

graspit2urdf's Introduction

GraspIt2URDF

Simple Python utility to convert hand model from GraspIt! to a ROS-compatible URDF. An example of the conversion of HumanHand20DOF.xml from GraspIt! is included.

Quick demo

  • Install GraspIt!
  • Install the urdf_tutorial ROS package
  • Run python graspit2urdf.py --input_filename ${GRASPIT}/models/robots/HumanHand/HumanHand20DOF.xml from the scripts directory. This will produce a URDF file for the 20-dof Human Hand from GraspIt! in the urdf directory.
  • Run roslaunch urdf_tutorial display.launch model:=urdf/HumanHand20DOF.urdf from the root of this repository. You should see GraspIt!'s 20-dof human hand model in Rviz, with sliders to manipulate the joints: human-hand-example

Converting a GraspIt! hand to URDF

  • Create a directory in data, named with the GraspIt! robot name (e.g. HumanHand20DOF). It will hold the meshes and data files for your URDF model.
  • Convert all .wrl files from ~/.graspit/models/robots/<ROBOT_NAME>/iv into .stl files of the same name (using Meshlab) and save them to data/<ROBOT_NAME>.
  • Next, you need to find the inertia tensors and centers of mass of all the links.
    • I have included a Meshlab script that computes these for you. In short, it first closes holes in the link mesh, ensures watertightness by doing a simple Poisson reconstruction, and then computes the required quantities.
    • You can run it like so, from inside data/<ROBOT_NAME>: meshlab.meshlabserver -s info_script.mlx -i thumb2.wrl.
    • It should print out the required physical quantities towards the end. You need to make a text file of the same name (e.g. thumb2.txt) containing the inertia tensor on the first line and the center of mass on the second line. See the included example files in data/HumanHand20DOF.
    • For info about which values to include, see this article. The 1/s^5 scaling mentioned in that article is already implemented in the code.
  • Next step is to convert! Run e.g. for the human hand: python graspit2urdf.py --input_filename ~/.graspit/models/robots/HumanHand/HumanHand20DOF.xml, and it should create HumanHand20DOF.urdf in the urdf directory for you.
  • You can test this URDF in Rviz by first installing the urdf_tutorial package and running roslaunch urdf_tutorial display.launch model:=urdf/<your-urdf-file>.urdf, as mentioned in this ROS Wiki article.

graspit2urdf's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

graspit2urdf's Issues

3d mesh model to urdf.

hello, now i just have 3d mesh model with my gripper. what should i do to convert my mesh to urdf?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.