mc_rbdyn::ForceSensor Struct Reference

#include <mc_rbdyn/ForceSensor.h>

Inheritance diagram for mc_rbdyn::ForceSensor:
Collaboration diagram for mc_rbdyn::ForceSensor:

Public Member Functions

 ForceSensor ()
 
 ForceSensor (const std::string &name, const std::string &parentBodyName, const sva::PTransformd &X_p_f)
 
 ForceSensor (const ForceSensor &fs)
 
ForceSensoroperator= (const ForceSensor &fs)
 
 ForceSensor (ForceSensor &&)=default
 
ForceSensoroperator= (ForceSensor &&)=default
 
 ~ForceSensor () noexcept override
 
const std::string & parentBody () const
 
const sva::PTransformd & X_p_f () const
 
sva::PTransformd X_0_f (const mc_rbdyn::Robot &robot) const
 
const sva::ForceVecd & wrench () const
 
const Eigen::Vector3d & force () const
 
const Eigen::Vector3d & couple () const
 
void wrench (const sva::ForceVecd &wrench)
 
sva::ForceVecd wrenchWithoutGravity (const mc_rbdyn::Robot &robot) const
 
sva::ForceVecd worldWrench (const mc_rbdyn::Robot &robot) const
 
sva::ForceVecd worldWrenchWithoutGravity (const mc_rbdyn::Robot &robot) const
 
DevicePtr clone () const override
 
Calibration

These functions are related to the sensor's calibration

void loadCalibrator (const detail::ForceSensorCalibData &data) noexcept
 
void loadCalibrator (const std::string &calib_file, const Eigen::Vector3d &gravity={0., 0., 9.81})
 
void copyCalibrator (const mc_rbdyn::ForceSensor &other)
 
void resetCalibrator ()
 
const sva::PTransformd & X_fsmodel_fsactual () const
 
const sva::PTransformd X_fsactual_parent () const
 
double mass () const
 
const sva::ForceVecd & offset () const
 
const detail::ForceSensorCalibDatacalib () const noexcept
 
- Public Member Functions inherited from mc_rbdyn::Device
 Device (const std::string &name)
 
 Device (const std::string &name, const std::string &parent, const sva::PTransformd &X_p_s)
 
 Device (const Device &)=delete
 
Deviceoperator= (const Device &)=delete
 
 Device (Device &&)=default
 
Deviceoperator= (Device &&)=default
 
virtual ~Device () noexcept=default
 
const std::string & name () const
 
const std::string & type () const
 
const std::string & parent () const
 
void parent (const std::string &p)
 
const sva::PTransformd & X_p_d () const
 
const sva::PTransformd & X_p_s () const
 
void X_p_d (const sva::PTransformd &pt)
 
void X_p_s (const sva::PTransformd &pt)
 
sva::PTransformd X_0_d (const mc_rbdyn::Robot &robot) const
 
sva::PTransformd X_0_s (const mc_rbdyn::Robot &robot) const
 

Additional Inherited Members

- Protected Attributes inherited from mc_rbdyn::Device
std::string type_
 
std::string name_
 
std::string parent_
 
sva::PTransformd X_p_s_
 

Detailed Description

This struct is intended to hold static information about a force sensor and the current reading of said sensor. If the appropriate data is provided, a gravity-free reading can be provided.

Constructor & Destructor Documentation

◆ ForceSensor() [1/4]

mc_rbdyn::ForceSensor::ForceSensor ( )

Default constructor, this does not represent a valid force sensor

◆ ForceSensor() [2/4]

mc_rbdyn::ForceSensor::ForceSensor ( const std::string &  name,
const std::string &  parentBodyName,
const sva::PTransformd &  X_p_f 
)

Construct a valid force sensor based on static information, this force sensor can then be used to provide sensing information to the robot. However, filtering will have no effect

Parameters
nameName of the sensor
parentBodyNameName of the sensor's parent body
X_p_fModel transformation from the parent body to the model (not real) sensor frame

◆ ForceSensor() [3/4]

mc_rbdyn::ForceSensor::ForceSensor ( const ForceSensor fs)

◆ ForceSensor() [4/4]

mc_rbdyn::ForceSensor::ForceSensor ( ForceSensor &&  )
default

◆ ~ForceSensor()

mc_rbdyn::ForceSensor::~ForceSensor ( )
overridenoexcept

Destructor

Member Function Documentation

◆ calib()

const detail::ForceSensorCalibData& mc_rbdyn::ForceSensor::calib ( ) const
inlinenoexcept

Access the calibration object

◆ clone()

DevicePtr mc_rbdyn::ForceSensor::clone ( ) const
overridevirtual

Perform a device copy

Implements mc_rbdyn::Device.

◆ copyCalibrator()

void mc_rbdyn::ForceSensor::copyCalibrator ( const mc_rbdyn::ForceSensor other)

Copy the calibration data from another force sensor

Parameters
otherOther force sensor from which the data is copied

◆ couple()

const Eigen::Vector3d& mc_rbdyn::ForceSensor::couple ( ) const
inline

Return the couple reading

Shortcut for wrench().couple()

◆ force()

const Eigen::Vector3d& mc_rbdyn::ForceSensor::force ( ) const
inline

Return the force reading

Shortcut for wrench().force()

◆ loadCalibrator() [1/2]

void mc_rbdyn::ForceSensor::loadCalibrator ( const detail::ForceSensorCalibData data)
noexcept

Load data from a file, using a gravity vector. The file should contain 13 parameters in that order: mass (1), rpy for X_f_ds (3), position for X_p_vb (3), wrench offset (6).

Parameters
calib_fileCalibration file, the file should exist
gravityGravity vector, defaults to Z

◆ loadCalibrator() [2/2]

void mc_rbdyn::ForceSensor::loadCalibrator ( const std::string &  calib_file,
const Eigen::Vector3d &  gravity = {0., 0., 9.81} 
)

Load data from a file, using a gravity vector. The file should contain 13 parameters in that order: mass (1), rpy for X_f_ds (3), position for X_p_vb (3), wrench offset (6).

Parameters
calib_fileCalibration file, the file should exist
gravityGravity vector, defaults to Z

◆ mass()

double mc_rbdyn::ForceSensor::mass ( ) const

Return the mass of the sensor

◆ offset()

const sva::ForceVecd& mc_rbdyn::ForceSensor::offset ( ) const

Return the sensor offset

◆ operator=() [1/2]

ForceSensor& mc_rbdyn::ForceSensor::operator= ( const ForceSensor fs)

◆ operator=() [2/2]

ForceSensor& mc_rbdyn::ForceSensor::operator= ( ForceSensor &&  )
default

◆ parentBody()

const std::string& mc_rbdyn::ForceSensor::parentBody ( ) const
inline

Return the sensor's parent body

◆ resetCalibrator()

void mc_rbdyn::ForceSensor::resetCalibrator ( )

Reset the force calibration to its default values such that the calibrator has no effect on the sensor wrench

◆ worldWrench()

sva::ForceVecd mc_rbdyn::ForceSensor::worldWrench ( const mc_rbdyn::Robot robot) const

Return measured wrench in the inertial frame

Parameters
robotRobot that the sensor belongs to
Returns
w_0 Spatial force vector of measured wrench

◆ worldWrenchWithoutGravity()

sva::ForceVecd mc_rbdyn::ForceSensor::worldWrenchWithoutGravity ( const mc_rbdyn::Robot robot) const

Return measured gravity-free wrench in the inertial frame

Parameters
robotRobot that the sensor belongs to
Returns
w_0 Spatial force vector of measured wrench

◆ wrench() [1/2]

const sva::ForceVecd& mc_rbdyn::ForceSensor::wrench ( ) const
inline

Return the current wrench

◆ wrench() [2/2]

void mc_rbdyn::ForceSensor::wrench ( const sva::ForceVecd &  wrench)
inline

Set the current wrench expressed in sensor frame

Parameters
wrenchNew wrench reading

◆ wrenchWithoutGravity()

sva::ForceVecd mc_rbdyn::ForceSensor::wrenchWithoutGravity ( const mc_rbdyn::Robot robot) const

Return a gravity-free wrench in sensor frame

Parameters
robotRobot that the sensor belongs to
Returns
A gravity-free reading of the wrench

◆ X_0_f()

sva::PTransformd mc_rbdyn::ForceSensor::X_0_f ( const mc_rbdyn::Robot robot) const
inline

Return the sensor pose in the inertial frame (convenience function)

◆ X_fsactual_parent()

const sva::PTransformd mc_rbdyn::ForceSensor::X_fsactual_parent ( ) const

Return the transform from the parent body to the real force sensor

◆ X_fsmodel_fsactual()

const sva::PTransformd& mc_rbdyn::ForceSensor::X_fsmodel_fsactual ( ) const

Return the local rotation associated to the sensor, i.e. the error between the model forceSensor and real one

◆ X_p_f()

const sva::PTransformd& mc_rbdyn::ForceSensor::X_p_f ( ) const
inline

Return the transformation from the parent body to the sensor (model)


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