#include <mc_rbdyn/ForceSensor.h>
Public Member Functions | |
ForceSensor () | |
ForceSensor (const std::string &name, const std::string &parentBodyName, const sva::PTransformd &X_p_f) | |
ForceSensor (const ForceSensor &fs) | |
ForceSensor & | operator= (const ForceSensor &fs) |
ForceSensor (ForceSensor &&)=default | |
ForceSensor & | operator= (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::ForceSensorCalibData & | calib () 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 | |
Device & | operator= (const Device &)=delete |
Device (Device &&)=default | |
Device & | operator= (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_ |
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.
mc_rbdyn::ForceSensor::ForceSensor | ( | ) |
Default constructor, this does not represent a valid force sensor
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
name | Name of the sensor |
parentBodyName | Name of the sensor's parent body |
X_p_f | Model transformation from the parent body to the model (not real) sensor frame |
mc_rbdyn::ForceSensor::ForceSensor | ( | const ForceSensor & | fs | ) |
|
default |
|
overridenoexcept |
Destructor
|
inlinenoexcept |
Access the calibration object
|
overridevirtual |
Perform a device copy
Implements mc_rbdyn::Device.
void mc_rbdyn::ForceSensor::copyCalibrator | ( | const mc_rbdyn::ForceSensor & | other | ) |
Copy the calibration data from another force sensor
other | Other force sensor from which the data is copied |
|
inline |
|
inline |
|
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).
calib_file | Calibration file, the file should exist |
gravity | Gravity vector, defaults to Z |
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).
calib_file | Calibration file, the file should exist |
gravity | Gravity vector, defaults to Z |
double mc_rbdyn::ForceSensor::mass | ( | ) | const |
Return the mass of the sensor
const sva::ForceVecd& mc_rbdyn::ForceSensor::offset | ( | ) | const |
Return the sensor offset
ForceSensor& mc_rbdyn::ForceSensor::operator= | ( | const ForceSensor & | fs | ) |
|
default |
|
inline |
Return the sensor's parent body
void mc_rbdyn::ForceSensor::resetCalibrator | ( | ) |
Reset the force calibration to its default values such that the calibrator has no effect on the sensor wrench
sva::ForceVecd mc_rbdyn::ForceSensor::worldWrench | ( | const mc_rbdyn::Robot & | robot | ) | const |
Return measured wrench in the inertial frame
robot | Robot that the sensor belongs to |
sva::ForceVecd mc_rbdyn::ForceSensor::worldWrenchWithoutGravity | ( | const mc_rbdyn::Robot & | robot | ) | const |
Return measured gravity-free wrench in the inertial frame
robot | Robot that the sensor belongs to |
|
inline |
Return the current wrench
|
inline |
Set the current wrench expressed in sensor frame
wrench | New wrench reading |
sva::ForceVecd mc_rbdyn::ForceSensor::wrenchWithoutGravity | ( | const mc_rbdyn::Robot & | robot | ) | const |
Return a gravity-free wrench in sensor frame
robot | Robot that the sensor belongs to |
|
inline |
Return the sensor pose in the inertial frame (convenience function)
const sva::PTransformd mc_rbdyn::ForceSensor::X_fsactual_parent | ( | ) | const |
Return the transform from the parent body to the real force sensor
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
|
inline |
Return the transformation from the parent body to the sensor (model)