state-observation 1.7.0
Loading...
Searching...
No Matches
stateObservation::tools Namespace Reference

Namespaces

namespace  Detail
 

Classes

class  Logger
 
class  ProbabilityLawSimulation
 
struct  SimplestStopwatch
 

Functions

std::string STATE_OBSERVATION_DLLAPI matrixToString (const Matrix &mat)
 
std::string STATE_OBSERVATION_DLLAPI vectorToString (const Vector &v)
 
Matrix STATE_OBSERVATION_DLLAPI stringToMatrix (const std::string &str, Index rows, Index cols)
 
Vector STATE_OBSERVATION_DLLAPI stringToVector (const std::string &str, Index length)
 
Vector STATE_OBSERVATION_DLLAPI stringToVector (const std::string &str)
 
template<class T >
T square (const T &x)
 computes the square of a value of any type
 
template<class T >
T derivate (const T &o1, const T &o2, double dt)
 derivates any type with finite differences
 
template<typename T >
int signum (T x)
 gives the sign of a variable (1, 0 or -1)
 
template<typename T >
std::string toString (T val)
 
bool checkIfNormalized (const Vector3 &v)
 checks if the vector is already normalized or not
 
bool checkIfNormalized (const Vector3 &v, double &outputSquaredNorm)
 checks if the vector is already normalized or not
 
template<typename T >
T clampScalar (const T &x, const T &max, const T &min)
 returns the value clamped between min and max
 
template<typename T >
T clampScalar (const T &x, const T &limit)
 returns the value clamped between limit and -limit
 
Vector3 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 finiteTimeAccControl (double x, double xd, double kp=-1, double kv=-1)
 
Vector STATE_OBSERVATION_DLLAPI 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 sqrt (double x)
 Constexpr version of the square root.
 

Function Documentation

◆ checkIfNormalized() [1/2]

bool stateObservation::tools::checkIfNormalized ( const Vector3 v)
inline

checks if the vector is already normalized or not

Parameters
vthe vector to normalize
Returns
true the vector is normalized
false The vector is not normalized

◆ checkIfNormalized() [2/2]

bool stateObservation::tools::checkIfNormalized ( const Vector3 v,
double outputSquaredNorm 
)
inline

checks if the vector is already normalized or not

Parameters
vthe vector to normalize
outputSquaredNormthe squared norm as an output
Returns
true the vector is normalized
false The vector is not normalized

◆ clampScalar() [1/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
TThe type of the scalar
Parameters
xthe input value
limitis the maximum absolute value allowed, has to be positive
Returns
T the clamped value

◆ clampScalar() [2/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
TThe type of the scalar
Parameters
xthe input value
maxthe max value
minthe min value
Returns
T the calmped value

◆ derivate()

template<class T >
T stateObservation::tools::derivate ( const T o1,
const T o2,
double  dt 
)
inline

derivates any type with finite differences

◆ finiteTimeAccControl() [1/2]

Vector STATE_OBSERVATION_DLLAPI stateObservation::tools::finiteTimeAccControl ( const Vector x,
const Vector xd,
double  kp = -1,
double  kv = -1 
)
inline

sqme as the scalar version but for every member of the vector

◆ finiteTimeAccControl() [2/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

◆ matrixToString()

std::string STATE_OBSERVATION_DLLAPI stateObservation::tools::matrixToString ( const Matrix mat)
protected

◆ 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
vthe input vector
Returns
Vector3

◆ signum()

template<typename T >
int stateObservation::tools::signum ( T  x)
inline

gives the sign of a variable (1, 0 or -1)

◆ 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
x
Returns
double constexpr

◆ square()

template<class T >
T stateObservation::tools::square ( const T x)
inline

computes the square of a value of any type

◆ stringToMatrix()

Matrix STATE_OBSERVATION_DLLAPI stateObservation::tools::stringToMatrix ( const std::string &  str,
Index  rows,
Index  cols 
)
protected

◆ stringToVector() [1/2]

Vector STATE_OBSERVATION_DLLAPI stateObservation::tools::stringToVector ( const std::string &  str)
protected

◆ stringToVector() [2/2]

Vector STATE_OBSERVATION_DLLAPI stateObservation::tools::stringToVector ( const std::string &  str,
Index  length 
)
protected

◆ toString()

template<typename T >
std::string stateObservation::tools::toString ( T  val)
inline

◆ vectorToString()

std::string STATE_OBSERVATION_DLLAPI stateObservation::tools::vectorToString ( const Vector v)
protected