Home > Project Update > OpenRAVE ForceSensor

OpenRAVE ForceSensor

November 20th, 2011

As of Nov. 14th, a new version of the OpenGRASP toolkit has been released to work with the latest stable version of OpenRAVE (0.5.0).  This toolkit provides a useful suite of tools to solve grasping and manipulation problems.  While this seems liek a rather specialized goal, some of the plugins in this toolkit are extremely useful for legged locomotion and humanoids.  One particilarly useful plugin is the ForceSensor, which measures  the constraint forces on a particular body, as applied across a joint.  This is based on the dJointGetFeedback function in the Open Dynamics Engine (ODE) API.

Here’s how to use the force sensor with the latest version of openRAVE:

Download Source

Download the tarball from the and extract the source from the latest version to a local folder, such as ~/ForceSensor.

Edit setup.sh

Once the files are extracted, edit setup.sh to reflect this folder location.  The 2nd line in setup.sh looks like this by default:

export FORCESENSOR_PATH=$HOME/grasp/workspace/OpenGRASP/OpenRAVE_Plugins/sensors/ForceSensor

Change the line to point to your ForceSensor folder, something like this:

export FORCESENSOR_PATH=$HOME/ForceSensor

Build Source

In the ForceSensor folder, run cmake to produce the appropriate Makefile, then run make to build the code.

cmake ./
make

Install the library

There should now be a file called libForceSensor.so in the lib subfolder.  Normally, you would install this library to the openrave share folder like so:

sudo make install

Don’t do this! Currently, the install location cmake produces is wrong for versions later than 0.3.  In the meantime, you need to tell openrave how to find this library when it runs.  So, add setup.sh to your .bashrc file like so:

echo "source ~/ForceSensor/setup.sh" >> .bashrc

Or, just manually add the line to your .bashrc file, or just source if yourself when you open a new terminal.

Run the example code

Change to the examples folder, and run the python script inside to load a simple robot, and demonstrate the force sensor plugin:

python testForceSensor.py

If it works, you should see output in the terminal that reflects the force joint J1 is experiencing at each timestep. With some tweaks to the code, you should be able to dump the data to the terminal and plot it, or even use the numpy tools to plot results.

Categories: Project Update Tags:

Comments are closed.