hpp-pinocchio  4.9.1
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
hpp::pinocchio::DeviceSync Class Reference

#include <hpp/pinocchio/device-sync.hh>

Inheritance diagram for hpp::pinocchio::DeviceSync:
Collaboration diagram for hpp::pinocchio::DeviceSync:

Public Member Functions

 DeviceSync (const DevicePtr_t &device, bool lock=true)
 
virtual ~DeviceSync ()
 
DeviceDatad ()
 
DeviceData const & d () const
 
void lock ()
 Lock the current DeviceData. More...
 
bool isLocked () const
 Check if the current DeviceData is locked. More...
 
void unlock ()
 Unlock the current DeviceData. More...
 
- Public Member Functions inherited from hpp::pinocchio::AbstractDevice
ModelConstPtr_t modelPtr () const
 Access to pinocchio model. More...
 
ModelPtr_t modelPtr ()
 Access to pinocchio model. More...
 
const Modelmodel () const
 Access to pinocchio model. More...
 
Modelmodel ()
 Access to pinocchio model. More...
 
GeomModelConstPtr_t geomModelPtr () const
 Access to pinocchio geomModel. More...
 
GeomModelPtr_t geomModelPtr ()
 Access to pinocchio geomModel. More...
 
const GeomModelgeomModel () const
 Access to pinocchio geomModel. More...
 
GeomModelgeomModel ()
 Access to pinocchio geomModel. More...
 
DataConstPtr_t dataPtr () const
 Access to Pinocchio data/. More...
 
DataPtr_t dataPtr ()
 Access to Pinocchio data/. More...
 
const Datadata () const
 Access to Pinocchio data/. More...
 
Datadata ()
 Access to Pinocchio data/. More...
 
GeomDataConstPtr_t geomDataPtr () const
 Access to Pinocchio geomData/. More...
 
GeomDataPtr_t geomDataPtr ()
 Access to Pinocchio geomData/. More...
 
const GeomDatageomData () const
 Access to Pinocchio geomData/. More...
 
GeomDatageomData ()
 Access to Pinocchio geomData/. More...
 
const Configuration_tcurrentConfiguration () const
 Get current configuration. More...
 
virtual bool currentConfiguration (ConfigurationIn_t configuration)
 
const vector_tcurrentVelocity () const
 Get current velocity. More...
 
bool currentVelocity (vectorIn_t velocity)
 Set current velocity. More...
 
const vector_tcurrentAcceleration () const
 Get current acceleration. More...
 
bool currentAcceleration (vectorIn_t acceleration)
 Set current acceleration. More...
 
const value_typemass () const
 Get mass of robot. More...
 
const vector3_tpositionCenterOfMass () const
 Get position of center of mass. More...
 
const ComJacobian_tjacobianCenterOfMass () const
 Get Jacobian of center of mass with respect to configuration. More...
 
virtual void controlComputation (const Computation_t &flag)
 
Computation_t computationFlag () const
 Get computation flag. More...
 
void computeForwardKinematics ()
 Compute forward kinematics. More...
 
void computeFramesForwardKinematics ()
 
void updateGeometryPlacements ()
 Update the geometry placement to the currentConfiguration. More...
 

Additional Inherited Members

- Protected Member Functions inherited from hpp::pinocchio::AbstractDevice
 AbstractDevice ()
 
 AbstractDevice (const ModelPtr_t &m, const GeomModelPtr_t &gm)
 
- Protected Attributes inherited from hpp::pinocchio::AbstractDevice
ModelPtr_t model_
 
GeomModelPtr_t geomModel_
 

Detailed Description

A thread-safe access to a Device.

To ensure thread safety, one can do

// In some place of the code:
DevicePtr_t device = ...;
device->numberDeviceData (4);
// Acquires a lock on the device.
DeviceSync deviceSync (device);
deviceSync.currentConfiguration(q);
deviceSync.computeForwardKinematics();
JointPtr_t joint = ...;
joint->currentTransformation (deviceSync.d());
body->fcl (deviceSync.d());
body->getTransform (deviceSync.d());
// The lock is release when deviceSync is destroyed.

Constructor & Destructor Documentation

◆ DeviceSync()

hpp::pinocchio::DeviceSync::DeviceSync ( const DevicePtr_t device,
bool  lock = true 
)

Constructor

Parameters
deviceto lock
lockwhether to acquire the lock.

◆ ~DeviceSync()

virtual hpp::pinocchio::DeviceSync::~DeviceSync ( )
virtual

Destructor. The lock is released if necessary.

Member Function Documentation

◆ d() [1/2]

DeviceData& hpp::pinocchio::DeviceSync::d ( )
inlinevirtual

Accessor to the locked DeviceData.

Note
this asserts that this isLocked()

Implements hpp::pinocchio::AbstractDevice.

◆ d() [2/2]

DeviceData const& hpp::pinocchio::DeviceSync::d ( ) const
inlinevirtual

Const accessor to the locked DeviceData.

Note
this asserts that this isLocked()

Implements hpp::pinocchio::AbstractDevice.

◆ isLocked()

bool hpp::pinocchio::DeviceSync::isLocked ( ) const
inline

Check if the current DeviceData is locked.

◆ lock()

void hpp::pinocchio::DeviceSync::lock ( )

Lock the current DeviceData.

◆ unlock()

void hpp::pinocchio::DeviceSync::unlock ( )

Unlock the current DeviceData.


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