LocalGuidance
A library that generates velocity references to follow a path.
robot_utils::AverageForceCalibrator Class Reference

Calibrates the force offset using a Cumulative Moving Average filter. More...

#include <AverageForceCalibrator.hpp>

Inheritance diagram for robot_utils::AverageForceCalibrator:
Inheritance graph

Classes

class  Config
 

Public Member Functions

 AverageForceCalibrator (const std::string &name, const Config &config=Config())
 
 ~AverageForceCalibrator () override=default
 
bool getCalibratedForce (kindr::Force3D &calibratedForce, const kindr::Force3D &uncalibratedForce) override
 
bool getCalibratedTorque (kindr::Torque3D &calibratedTorque, const kindr::Torque3D &uncalibratedTorque) override
 
bool initialize (double dt) override
 
bool advance (double dt) override
 
bool command (ForceCalibratorCommand &command) override
 
bool isCalibrating () override
 
bool startCalibration (bool wait=false) override
 
void stopCalibration ()
 
bool continueSampling ()
 
bool wait () override
 
bool store (const std::string &filename) override
 
bool load (const std::string &filename) override
 
void setConfig (const Config &config)
 
void getConfig (Config &config)
 
void getWrenchOffset (kindr::WrenchD &wrenchOffset)
 
void getStatistics (ForceCalibratorStats &statistics) override
 
- Public Member Functions inherited from robot_utils::ForceCalibratorBase
 ForceCalibratorBase (const std::string &name)
 
virtual ~ForceCalibratorBase ()=default
 
virtual bool getCalibratedWrench (kindr::WrenchD &calibratedWrench, const kindr::WrenchD &uncalibratedWrench)
 
const std::string & getName () const
 
void setWrench (const kindr::WrenchD &wrench)
 
void setForce (const kindr::Force3D &force)
 
void setTorque (const kindr::Torque3D &torque)
 

Protected Member Functions

bool initSampling (bool continueSampling)
 
void calibrateWrenchOffset ()
 
void notifyEndOfCalibration ()
 
bool isForceAnOutlier (const kindr::Force3D &sample, const kindr::Force3D &mean)
 
bool isTorqueAnOutlier (const kindr::Torque3D &sample, const kindr::Torque3D &mean)
 
bool isZForceOutsideClamp (double zForce)
 

Protected Attributes

boost::atomic< bool > isCalibrating_
 Indicates whether the calibration process is ongoing. More...
 
boost::condition_variable_any cvCalibrating_
 
boost::shared_mutex mutexCalibrating_
 
boost::atomic< bool > isSampling_
 Indicates wether the sampling process within the calibration process is ongoing. More...
 
unsigned int numGoodSamples_
 Number of good samples collected during one sampling process. More...
 
unsigned int numSamples_
 Number of samples collected during one sampling process. More...
 
kindr::WrenchD wrenchOffset_
 
boost::shared_mutex mutexWrenchOffset_
 
CumulativeMovingAverageFilter< kindr::WrenchD > cmaFilter_
 
boost::shared_mutex mutexCmaFilter_
 
Config config_
 
boost::shared_mutex mutexConfig_
 
ForceCalibratorStats statistics_
 
boost::shared_mutex mutexStatistics_
 
- Protected Attributes inherited from robot_utils::ForceCalibratorBase
std::string name_
 
kindr::WrenchD wrench_
 
boost::shared_mutex mutexWrench_
 

Detailed Description

Calibrates the force offset using a Cumulative Moving Average filter.

Constructor & Destructor Documentation

robot_utils::AverageForceCalibrator::AverageForceCalibrator ( const std::string &  name,
const Config config = Config() 
)
robot_utils::AverageForceCalibrator::~AverageForceCalibrator ( )
overridedefault

Member Function Documentation

bool robot_utils::AverageForceCalibrator::advance ( double  dt)
overridevirtual
void robot_utils::AverageForceCalibrator::calibrateWrenchOffset ( )
protected
bool robot_utils::AverageForceCalibrator::command ( ForceCalibratorCommand command)
overridevirtual
bool robot_utils::AverageForceCalibrator::continueSampling ( )
bool robot_utils::AverageForceCalibrator::getCalibratedForce ( kindr::Force3D &  calibratedForce,
const kindr::Force3D &  uncalibratedForce 
)
overridevirtual
bool robot_utils::AverageForceCalibrator::getCalibratedTorque ( kindr::Torque3D &  calibratedTorque,
const kindr::Torque3D &  uncalibratedTorque 
)
overridevirtual
void robot_utils::AverageForceCalibrator::getConfig ( Config config)
inline
void robot_utils::AverageForceCalibrator::getStatistics ( ForceCalibratorStats statistics)
inlineoverridevirtual
void robot_utils::AverageForceCalibrator::getWrenchOffset ( kindr::WrenchD &  wrenchOffset)
inline
bool robot_utils::AverageForceCalibrator::initialize ( double  dt)
overridevirtual
bool robot_utils::AverageForceCalibrator::initSampling ( bool  continueSampling)
protected
bool robot_utils::AverageForceCalibrator::isCalibrating ( )
overridevirtual
bool robot_utils::AverageForceCalibrator::isForceAnOutlier ( const kindr::Force3D &  sample,
const kindr::Force3D &  mean 
)
protected
bool robot_utils::AverageForceCalibrator::isTorqueAnOutlier ( const kindr::Torque3D &  sample,
const kindr::Torque3D &  mean 
)
protected
bool robot_utils::AverageForceCalibrator::isZForceOutsideClamp ( double  zForce)
protected
bool robot_utils::AverageForceCalibrator::load ( const std::string &  filename)
overridevirtual
void robot_utils::AverageForceCalibrator::notifyEndOfCalibration ( )
protected
void robot_utils::AverageForceCalibrator::setConfig ( const Config config)
inline
bool robot_utils::AverageForceCalibrator::startCalibration ( bool  wait = false)
overridevirtual
void robot_utils::AverageForceCalibrator::stopCalibration ( )
bool robot_utils::AverageForceCalibrator::store ( const std::string &  filename)
overridevirtual
bool robot_utils::AverageForceCalibrator::wait ( )
overridevirtual

Member Data Documentation

CumulativeMovingAverageFilter<kindr::WrenchD> robot_utils::AverageForceCalibrator::cmaFilter_
protected
Config robot_utils::AverageForceCalibrator::config_
protected
boost::condition_variable_any robot_utils::AverageForceCalibrator::cvCalibrating_
protected
boost::atomic<bool> robot_utils::AverageForceCalibrator::isCalibrating_
protected

Indicates whether the calibration process is ongoing.

boost::atomic<bool> robot_utils::AverageForceCalibrator::isSampling_
protected

Indicates wether the sampling process within the calibration process is ongoing.

boost::shared_mutex robot_utils::AverageForceCalibrator::mutexCalibrating_
protected
boost::shared_mutex robot_utils::AverageForceCalibrator::mutexCmaFilter_
protected
boost::shared_mutex robot_utils::AverageForceCalibrator::mutexConfig_
protected
boost::shared_mutex robot_utils::AverageForceCalibrator::mutexStatistics_
protected
boost::shared_mutex robot_utils::AverageForceCalibrator::mutexWrenchOffset_
protected
unsigned int robot_utils::AverageForceCalibrator::numGoodSamples_
protected

Number of good samples collected during one sampling process.

unsigned int robot_utils::AverageForceCalibrator::numSamples_
protected

Number of samples collected during one sampling process.

ForceCalibratorStats robot_utils::AverageForceCalibrator::statistics_
protected
kindr::WrenchD robot_utils::AverageForceCalibrator::wrenchOffset_
protected

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