GithubHelp home page GithubHelp logo

sefgit / urdf2webots Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cyberbotics/urdf2webots

0.0 0.0 0.0 111.3 MB

Utility to convert URDF files to Webots PROTO nodes

License: Apache License 2.0

Python 100.00%

urdf2webots's Introduction

urdf2webots

Build Status

This tool converts URDF files into Webots PROTO files.

Install

From pip

pip install urdf2webots

On macOS, export the pip binary path to the PATH: export PATH="/Users/$USER/Library/Python/3.7/bin:$PATH"

From Sources

git clone https://github.com/cyberbotics/urdf2webots.git
cd urdf2webots
pip install -r requirements.txt

Usage

From pip

python -m urdf2webots.importer --input=someRobot.urdf [--output=outputFile] [--box-collision] [--normal] [--disable-mesh-optimization] [--multi-file] [--static-base] [--tool-slot=linkName] [--help]

From Sources

python demo.py --input=someRobot.urdf [--output=outputFile] [--box-collision] [--normal] [--disable-mesh-optimization] [--multi-file] [--static-base] [--tool-slot=linkName] [--help]

Arguments

The script accepts the following arguments:

  • -h, --help: Show the help message and exit.
  • --input=INFILE: Specifies the urdf file to convert.
  • --output=OUTFILE: If set, specifies the path and, if ending in ".proto", name of the resulting PROTO file. The filename minus the .proto extension will be the robot name.
  • --normal: If set, the normals are exported if present in the URDF definition.
  • --box-collision: If set, the bounding objects are approximated using boxes.
  • --disable-mesh-optimization: If set, the duplicated vertices are not removed from the meshes (this can speed up a lot the conversion).
  • --multi-file: If set, the mesh files are exported as separated PROTO files.
  • --static-base: If set, the base link will have the option to be static (disable physics)
  • --tool-slot=LinkName: Specify the link that you want to add a tool slot to (exact link name from urdf).
  • --rotation="0 1 0 0": Set the rotation field of your PROTO file. If your URDF file uses the z-axis as 'up', use --rotation="1 0 0 -1.5708".
  • --init-pos=JointPositions: Set the initial positions of your robot joints. Example: --init-pos="[1.2, 0.5, -1.5]" would set the first 3 joints of your robot to the specified values, and leave the rest with their default value.

In your Python Code

from urdf2webots.importer import convert2urdf
convert2urdf('MY_PATH/MY_URDF.urd')

In-Depth Tutorial

Check out this tutorial for a more in-depth, step by step instruction, on how to:

  • Generate a URDF file from a ROS repository.
  • Convert your URDF file to a Webots PROTO file.
  • Load your converted model into Webots and make final adjustments.

Notes

This tool have been tested using Webots R2020b on Ubuntu16.04 and Windows.
You can find the sources of these URDF files here:

Acknowledgement

rosin_logo

Supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components.
More information: rosin-project.eu

eu_flag

This project has received funding from the European Union’s Horizon 2020
research and innovation programme under grant agreement no. 732287.

urdf2webots's People

Contributors

davidmansolino avatar simon-steinmann avatar omichel avatar fabienrohrer avatar vidicon avatar tahir1069 avatar wasabifan avatar michou214 avatar tpjnorton avatar

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.