Worldsim Utility Functions
These functions are globally availables, just include worldsimconfig.h to use them. More...
Functions | |
| float | invLinearMap (float x, float min=-10, float max=10, float outMin=-1, float outMax=1) |
| Inversed Linear mapping from [min,max] to [outMin, outMax]. | |
| float | linearMap (float x, float min=-10, float max=10, float outMin=-1, float outMax=1) |
| Linear mapping from [min,max] to [outMin, outMax]. | |
| template<class T , class U > | |
| const T | max (const T &t1, const U &t2) |
| Template for max calculation. | |
| template<class T , class U > | |
| const T | min (const T &t1, const U &t2) |
| Template for min calculation. | |
| real | ramp (real minv, real maxv, real value) |
| Function for imposing a range for a real variable. | |
| real | toDegree (real x) |
| convert radians to degree | |
| real | toRad (real x) |
| convert degree to radians | |
Detailed Description
These functions are globally availables, just include worldsimconfig.h to use them.
Function Documentation
| float farsa::invLinearMap | ( | float | x, |
| float | min = -10, |
||
| float | max = 10, |
||
| float | outMin = -1, |
||
| float | outMax = 1 |
||
| ) | [inline] |
Inversed Linear mapping from [min,max] to [outMin, outMax].
--------\ outMax
\
\-------- outMin
min max
Definition at line 149 of file worldsimconfig.h.
References farsa::max(), and farsa::min().
| float farsa::linearMap | ( | float | x, |
| float | min = -10, |
||
| float | max = 10, |
||
| float | outMin = -1, |
||
| float | outMax = 1 |
||
| ) | [inline] |
Linear mapping from [min,max] to [outMin, outMax].
/-------- outMax
/
--------/ outMin
min max
Definition at line 130 of file worldsimconfig.h.
References farsa::max(), and farsa::min().
| const T farsa::max | ( | const T & | t1, |
| const U & | t2 | ||
| ) |
Template for max calculation.
Definition at line 104 of file worldsimconfig.h.
Referenced by Frame::alignWithFrame(), RenderWObjectContainer::drawSkyGroundBox(), wMatrix::getEuleroAngles(), RenderWorld::init(), farsa::invLinearMap(), farsa::linearMap(), PhyiCub::PhyiCub(), wPID::pidloop(), RenderWorld::resourceChanged(), MultiMotorController::setLimits(), World::setMultiThread(), and wPID::wPID().
| const T farsa::min | ( | const T & | t1, |
| const U & | t2 | ||
| ) |
Template for min calculation.
Definition at line 92 of file worldsimconfig.h.
Referenced by RenderWObjectContainer::drawSkyGroundBox(), wMatrix::getEuleroAngles(), RenderWorld::init(), farsa::invLinearMap(), farsa::linearMap(), PhyiCub::PhyiCub(), wPID::pidloop(), RenderWorld::resourceChanged(), MultiMotorController::setLimits(), and wPID::wPID().
| real farsa::ramp | ( | real | minv, |
| real | maxv, | ||
| real | value | ||
| ) | [inline] |
Function for imposing a range for a real variable.
Definition at line 115 of file worldsimconfig.h.
Referenced by PhyiCub::PhyiCub(), MultiMotorController::positionMove(), MultiMotorController::relativeMove(), PhyDOF::setDesiredPosition(), PhyDOF::setLimits(), PhyDOF::setStiffness(), and DOFStatusListener::update().
| real farsa::toDegree | ( | real | x | ) | [inline] |
convert radians to degree
Definition at line 84 of file worldsimconfig.h.
Referenced by MultiMotorController::getEncoder(), MultiMotorController::getEncoders(), MultiMotorController::getEncoderSpeed(), MultiMotorController::getEncoderSpeeds(), MultiMotorController::getLimits(), MultiMotorController::getLimitsRaw(), MultiMotorController::getRefAcceleration(), MultiMotorController::getRefAccelerations(), MultiMotorController::getRefSpeed(), and MultiMotorController::getRefSpeeds().
| real farsa::toRad | ( | real | x | ) | [inline] |
convert degree to radians
Definition at line 77 of file worldsimconfig.h.
Referenced by PhyiCub::configurePosture(), MultiMotorController::MultiMotorController(), PhyiCub::PhyiCub(), PhyMarXbot::PhyMarXbot(), MultiMotorController::positionMove(), MultiMotorController::relativeMove(), MultiMotorController::setLimits(), MultiMotorController::setLimitsRaw(), MultiMotorController::setRefAcceleration(), MultiMotorController::setRefAccelerations(), MultiMotorController::setRefSpeed(), MultiMotorController::setRefSpeeds(), and MultiMotorController::velocityMove().