Gathers many kinds of algorithms.
More...
#include <boost/utility.hpp>
#include <cmath>
#include <state-observation/api.h>
#include <state-observation/tools/definitions.hpp>
Go to the source code of this file.
|
| namespace | stateObservation |
| | Filtering of divergent component of motion (DCM) and estimation of a bias betweeen the DCM and the corresponding zero moment point for a linearized inverted pendulum model.
|
|
| template<class T> |
| T | stateObservation::tools::square (const T &x) |
| | computes the square of a value of any type
|
| template<class T> |
| T | stateObservation::tools::derivate (const T &o1, const T &o2, double dt) |
| | derivates any type with finite differences
|
| template<typename T> |
| int | stateObservation::tools::signum (T x) |
| | gives the sign of a variable (1, 0 or -1)
|
| template<typename T> |
| std::string | stateObservation::tools::toString (T val) |
| bool | stateObservation::tools::checkIfNormalized (const Vector3 &v) |
| | checks if the vector is already normalized or not
|
| bool | stateObservation::tools::checkIfNormalized (const Vector3 &v, double &outputSquaredNorm) |
| | checks if the vector is already normalized or not
|
| template<typename T> |
| T | stateObservation::tools::clampScalar (const T &x, const T &max, const T &min) |
| | returns the value clamped between min and max
|
| template<typename T> |
| T | stateObservation::tools::clampScalar (const T &x, const T &limit) |
| | returns the value clamped between limit and -limit
|
| Vector3 | stateObservation::tools::normalizedLazy (const Vector3 &v) |
| | normalize the vector only if it is not normalized already. Useful if the vector is likely to be normalized
|
| double STATE_OBSERVATION_DLLAPI | stateObservation::tools::finiteTimeAccControl (double x, double xd, double kp=-1, double kv=-1) |
| Vector STATE_OBSERVATION_DLLAPI | stateObservation::tools::finiteTimeAccControl (const Vector &x, const Vector &xd, double kp=-1, double kv=-1) |
| | sqme as the scalar version but for every member of the vector
|
| double constexpr | stateObservation::tools::Detail::sqrtNewtonRaphson (double x, double curr, double prev) |
| double constexpr | stateObservation::tools::sqrt (double x) |
| | Constexpr version of the square root.
|
Gathers many kinds of algorithms.
- Author
- Mehdi Benallegue
- Date
- 2013
Definition in file miscellaneous-algorithms.hpp.
◆ square()
template<class T>
| T stateObservation::tools::square |
( |
const T & | x | ) |
|
|
inline |
◆ derivate()
template<class T>
| T stateObservation::tools::derivate |
( |
const T & | o1, |
|
|
const T & | o2, |
|
|
double | dt ) |
|
inline |
◆ signum()
template<typename T>
| int stateObservation::tools::signum |
( |
T | x | ) |
|
|
inline |
◆ toString()
template<typename T>
| std::string stateObservation::tools::toString |
( |
T | val | ) |
|
|
inline |
◆ checkIfNormalized() [1/2]
| bool stateObservation::tools::checkIfNormalized |
( |
const Vector3 & | v | ) |
|
|
inline |
checks if the vector is already normalized or not
- Parameters
-
- Returns
- true the vector is normalized
-
false The vector is not normalized
Definition at line 59 of file miscellaneous-algorithms.hpp.
◆ checkIfNormalized() [2/2]
| bool stateObservation::tools::checkIfNormalized |
( |
const Vector3 & | v, |
|
|
double & | outputSquaredNorm ) |
|
inline |
checks if the vector is already normalized or not
- Parameters
-
| v | the vector to normalize |
| outputSquaredNorm | the squared norm as an output |
- Returns
- true the vector is normalized
-
false The vector is not normalized
Definition at line 77 of file miscellaneous-algorithms.hpp.
◆ clampScalar() [1/2]
template<typename T>
| T stateObservation::tools::clampScalar |
( |
const T & | x, |
|
|
const T & | max, |
|
|
const T & | min ) |
|
inline |
returns the value clamped between min and max
- Template Parameters
-
- Parameters
-
| x | the input value |
| max | the max value |
| min | the min value |
- Returns
- T the calmped value
Definition at line 98 of file miscellaneous-algorithms.hpp.
◆ clampScalar() [2/2]
template<typename T>
| T stateObservation::tools::clampScalar |
( |
const T & | x, |
|
|
const T & | limit ) |
|
inline |
returns the value clamped between limit and -limit
- Template Parameters
-
- Parameters
-
| x | the input value |
| limit | is the maximum absolute value allowed, has to be positive |
- Returns
- T the clamped value
Definition at line 124 of file miscellaneous-algorithms.hpp.
◆ normalizedLazy()
| Vector3 stateObservation::tools::normalizedLazy |
( |
const Vector3 & | v | ) |
|
|
inline |
normalize the vector only if it is not normalized already. Useful if the vector is likely to be normalized
- Parameters
-
- Returns
- Vector3
Definition at line 133 of file miscellaneous-algorithms.hpp.
◆ finiteTimeAccControl() [1/2]
| double STATE_OBSERVATION_DLLAPI stateObservation::tools::finiteTimeAccControl |
( |
double | x, |
|
|
double | xd, |
|
|
double | kp = -1, |
|
|
double | kv = -1 ) |
|
inline |
provides an acceleration giving a finite time convergence to zero the state is the position x and the derivative xd and the output is the acceleration. The gains kp, kv must be negative
Definition at line 149 of file miscellaneous-algorithms.hpp.
◆ finiteTimeAccControl() [2/2]
| Vector STATE_OBSERVATION_DLLAPI stateObservation::tools::finiteTimeAccControl |
( |
const Vector & | x, |
|
|
const Vector & | xd, |
|
|
double | kp = -1, |
|
|
double | kv = -1 ) |
|
inline |
◆ sqrtNewtonRaphson()
| double constexpr stateObservation::tools::Detail::sqrtNewtonRaphson |
( |
double | x, |
|
|
double | curr, |
|
|
double | prev ) |
|
constexpr |
◆ sqrt()
| double constexpr stateObservation::tools::sqrt |
( |
double | x | ) |
|
|
constexpr |
Constexpr version of the square root.
For a finite and non-negative value of "x", returns an approximation for the square root of "x" -Otherwise, returns NaN
- Parameters
-
- Returns
- double constexpr
Definition at line 186 of file miscellaneous-algorithms.hpp.