Skip to content

roboticslab-uc3m/openrave-yarp-plugins

Repository files navigation

openrave-yarp-plugins

OpenRAVE plugins to interface OpenRAVE with YARP.

Link to Doxygen generated documentation: https://robots.uc3m.es/openrave-yarp-plugins/

Installation

Installation instructions for installing from source can be found here.

Contributing

Posting Issues

  1. Read CONTRIBUTING.md
  2. Post an issue / Feature request / Specific documentation request

Fork & Pull Request

  1. Fork the repository
  2. Create your feature branch (git checkout -b my-new-feature) off the master branch, following the Forking Git workflow
  3. Commit your changes
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Status

Continuous Integration

Issues

Description

The main approach is to develop OpenRAVE plugins (contained in the libraries/OpenravePlugins/ folder), which enable YARP communications. Among these, OpenraveYarpPluginLoader is a generic component that allows to internally load any of the YARP plugins contained in the libraries/YarpPlugins/ folder. These YARP plugins open ports thanks to their network wrappers. This can be seen in the following figure.

Architecture Block Diagram

Technically, the OpenRAVE plugin can directly open YARP ports, or contain one or many yarp::dev::PolyDriver. In the latter, it calls yarp::dev::PolyDriver::open(yarp::os::Searchable &config) passing a yarp::os::Property (note that Property is a Searchable), typically with the following contents:

  • "device": A YARP plugin that is a general purpose network wrapper and thus opens YARP ports (controlboardwrapper2, grabber...).
  • "subdevice": A YARP plugin from this repository (implementing controlboard, grabber... functionality).
  • "penv": A C-style pointer to the OpenRAVE::Environment to be used by the "subdevice".
  • "name": Can be extracted from the OpenRAVE::Environment and can be used for the port names opened by the "device" too.
  • Plus, whatever other information the "subdevice" YARP plugin requires (e.g. which robotIndex and/or manipulatorIndex for control).

Tutorials

How to use openrave-yarp-plugins for collision avoidance of a simulated robot

The following commands explain how to use the openrave-yarp-plugins for collision avoidance, using the previous instance of openrave-yarp-plugins as the remote robot.

# new terminal to open the simulated robot
python examples/python/openraveYarpPluginLoader-controlboard-allManipulators.py

# new terminal to open the collision avoidance simulator
# NOTE: Expect LONG wait to load the padding model
python examples/python/openraveYarpPluginLoader-controlboard-collision-sim.py

# Then the robot can be commanded via yarp with:
yarp rpc /safe/teoSim/[kinematic chain name]/rpc:i

How to use openrave-yarp-plugins for collision avoidance of a real robot

The following commands explain how to use the openrave-yarp-plugins for collision avoidance, using a real remote robot.

# new terminal
python examples/python/openraveYarpPluginLoader-controlboard-collision-real.py

# wait for the system to load the padding model
# Then the robot can be commanded via yarp with:
yarp rpc /safe/teo/[kinematic chain name]/rpc:i

How to extract a .pp model from ConvexDecomposition

The following commands explain how to use openrave to create a 3D model (.pp) of the collision space that OpenRAVE uses to calculate collisions. Whereas OpenRAVE uses it continuously, here we can save the 3D files to use them.

openrave.py --database convexdecomposition --robot=/usr/local/share/teo-openrave-models/openrave/teo/teo.robot.xml # --padding=PADDING --maxHullVertices=MAXHULLVERTICES --mergeThresholdPercent=MERGETHRESHOLDPERCENT

At the time of generating the .pp file, different parameters can be set. In our case, the most relevant parameters are the padding, the maxHullVertices and the mergeThresholdPercent. padding represents the distance from the real plane to the one generated. The last two are used to reduce the number of triangles generated in the model.

More options can be found here.

# To check the results, execute the following command. It is worth noting that, the triangle count is not correct, this was contrasted using other tool.
openrave.py --database convexdecomposition --robot=/usr/local/share/teo-openrave-models/openrave/teo/teo.robot.xml --show

To convert the generated .pp file into an .stl file that can be used by other programs, openrave-pp-to-stl.py (perma) can be used.

Similar and Related Projects