gazebo-yarp-plugins
Gazebo Plugins exposing YARP interfaces.
Loading...
Searching...
No Matches
yarp::dev::GazeboYarpContactLoadCellArrayDriver Class Reference

YARP Device Driver for an array of contact load cells giving 1-axis force at different locations. More...

#include <ContactLoadCellArrayDriver.h>

Inheritance diagram for yarp::dev::GazeboYarpContactLoadCellArrayDriver:
Collaboration diagram for yarp::dev::GazeboYarpContactLoadCellArrayDriver:

Public Member Functions

 GazeboYarpContactLoadCellArrayDriver ()
 
virtual ~GazeboYarpContactLoadCellArrayDriver ()
 
void onUpdate (const gazebo::common::UpdateInfo &)
 Update callback from Gazebo Gets the contact information from the link contact sensor Computes equivalent wrench at the link CG (location CG, rotation link origin) Transforms this wrench to the link origin (same force, moment is transformed) Maps the transformed wrench to contact normal forces at load cell locations.
 
virtual bool open (yarp::os::Searchable &config)
 
virtual bool close ()
 
virtual int read (yarp::sig::Vector &out)
 
virtual int getState (int ch)
 
virtual int getChannels ()
 
virtual int calibrateChannel (int ch)
 
virtual int calibrateChannel (int ch, double v)
 
virtual int calibrateSensor ()
 
virtual int calibrateSensor (const yarp::sig::Vector &value)
 
virtual yarp::os::Stamp getLastInputStamp ()
 

Detailed Description

YARP Device Driver for an array of contact load cells giving 1-axis force at different locations.

This device is used to simulate the contact normal forces that might be measured by an arbitrary number of load cells at specific locations with respect to a given link's origin frame. It uses the instance of a Gazebo Contact Sensor which provides contact information of the link (specifically providing wrenches - 6 axis force torque components, acting at different position with respect to the link). The equivalent wrench acts on the Center of Gravity(CG) of the link expressed in link origin frame. The CG of thee link is defined by the <inertial > in the sdf as a child of <link> tag. This information is transformed and mapped to the desired contact normal forces.

MAJOR ASSUMPTION: The load cells are distributed over a plane perpendicular to the z-axis of the link frame and the load cells are measuring the force over the z-direction

In its current version, this device reads the location of the load cells (to be copied manually from the urdf or sdf onto the configuration file) from a configuration file. Reads the contact forces and torques acting at the gazebo collision level through a gazebo ContactSensor instance. Finds an equivalent wrench acting at the CG of the specified link(location CG, rotation same as link origin). Transforms this equivalent wrench to the origin of the specified link. This transformation is necessary since the load cell locations are with respect to the link origin. Finally, the transformed equivalent wrench is mapped to an array of contact normal forces acting at the load cell locations.

This mapping problem is an infinite solution problem and is solved by obtaining a pseudo inverse, which gives the results with a minimized norm.

The configuation file must be specified in the sdf within the plugin element within the yarpConfigurationFile tags The configuration file must contain two groups [WRAPPER] and [DRIVER]

Parameters accepted in the config argument of the open method for [WRAPPER]:

Parameter name Type Units Default Value Required Description Notes
name string - - Yes full name of the port opened by the device MUST start with a '/' character
period double ms 20 No refresh period of broadcast value in ms optional, default 20ms
device string - - Yes name of the network wrapper to connect to MUST be set to analogServer

Parameters accepted in the config argument of the open method for [DRIVER]:

Parameter name Type Units Default Value Required Description Notes
device string - - Yes name of the device driver to instantiate MUST be set to gazebo_contactloadcellarray
loadCellNames list of strings - - Yes list of load cell names, eg. (lr rr lf rf) locations MUST be obtained manually from urdf/sdf
loadCellX list of doubles m - Yes list of load cell location X coordinate wrt link origin MUST be the same size and order as loadCellName
loadCellY list of doubles m - Yes list of load cell location Y coordinate wrt link origin MUST be the same size and order as loadCellName
loadCellZ list of doubles m - Yes list of load cell location Z coordinate wrt link origin MUST be the same size and order as loadCellName
linkName string - - Yes name of the link associated to the contact sensor -

NOTE: Although being sensor-related, this plugin is implemented as a model plugin instead of a sensor plugin. This design choice is due to the fact that transformations related to the link were required for computations in this device; which could not be achieved through a sensor plugin, since Gazebo inherently divides its physics engine and sensor engine in its software architecture. As a model plugin, the link information can be directly accessed, however the sensor name and collision name related to the link are obtained by parsing through the SDF directly. Again, this design decision of parsing through the sdf is made due to the fact that the Link information does not give the type of sensors but only sensor counts.

This plugin in its current version assumes a only single collision element is associated to the specified link This sensor plugin in its current version handles only one link with a plugin instance (i.e., multiple links cannot be specified per plugin, but multiple plugins can be instantiated through the sdf) The collision element in the contact sensor added to the specific link in the sdf should be set to {link_name}_collision The name of the collision element associated to the link should be set to default (i.e. "name" parameter should not be set so that it can take the default name {link_name}_collision. Otherwise, things become worse).

WARNING: Please note that the current version of this plugin is not tested on (heavily) nested models and also rather does not support the models having links with non-default collision element names. Refer discussion in \url https://github.com/robotology/gazebo-yarp-plugins/pull/338/files/e757d8a40d21eebf8c55db9e1c47bf397a134c43#r161473858 for further information.

Constructor & Destructor Documentation

◆ GazeboYarpContactLoadCellArrayDriver()

GazeboYarpContactLoadCellArrayDriver::GazeboYarpContactLoadCellArrayDriver ( )

◆ ~GazeboYarpContactLoadCellArrayDriver()

GazeboYarpContactLoadCellArrayDriver::~GazeboYarpContactLoadCellArrayDriver ( )
virtual

Member Function Documentation

◆ onUpdate()

void GazeboYarpContactLoadCellArrayDriver::onUpdate ( const gazebo::common::UpdateInfo & _info)

Update callback from Gazebo Gets the contact information from the link contact sensor Computes equivalent wrench at the link CG (location CG, rotation link origin) Transforms this wrench to the link origin (same force, moment is transformed) Maps the transformed wrench to contact normal forces at load cell locations.

◆ open()

bool GazeboYarpContactLoadCellArrayDriver::open ( yarp::os::Searchable & config)
virtual

◆ close()

bool GazeboYarpContactLoadCellArrayDriver::close ( )
virtual

◆ read()

int GazeboYarpContactLoadCellArrayDriver::read ( yarp::sig::Vector & out)
virtual

◆ getState()

int GazeboYarpContactLoadCellArrayDriver::getState ( int ch)
virtual

◆ getChannels()

int GazeboYarpContactLoadCellArrayDriver::getChannels ( )
virtual

◆ calibrateChannel() [1/2]

int GazeboYarpContactLoadCellArrayDriver::calibrateChannel ( int ch)
virtual

◆ calibrateChannel() [2/2]

int GazeboYarpContactLoadCellArrayDriver::calibrateChannel ( int ch,
double v )
virtual

◆ calibrateSensor() [1/2]

int GazeboYarpContactLoadCellArrayDriver::calibrateSensor ( )
virtual

◆ calibrateSensor() [2/2]

int GazeboYarpContactLoadCellArrayDriver::calibrateSensor ( const yarp::sig::Vector & value)
virtual

◆ getLastInputStamp()

yarp::os::Stamp GazeboYarpContactLoadCellArrayDriver::getLastInputStamp ( )
virtual

The documentation for this class was generated from the following files: