Go to the documentation of this file.
11 #ifndef STATEOBSERVATIONTOOLSMISCELANEOUSALGORITHMS
12 #define STATEOBSERVATIONTOOLSMISCELANEOUSALGORITHMS
13 #include <boost/utility.hpp>
16 #include <state-observation/api.h>
33 inline T
derivate(
const T & o1,
const T & o2,
double dt)
43 return (T(0) < x) - (x < T(0));
49 std::stringstream ss(
"");
79 outputSquaredNorm = v.squaredNorm();
98 inline T
clampScalar(
const T & x,
const T & max,
const T & min)
142 return v /
sqrt(squaredNorm);
149 inline double STATE_OBSERVATION_DLLAPI
finiteTimeAccControl(
double x,
double xd,
double kp = -1,
double kv = -1)
151 double sax =
sqrt(fabs(x));
152 double xdr = kp *
signum(x) * sax;
155 return ydr - kp * xd / (2 * sax);
165 for(
Index i = 1; i < x.size(); ++i)
176 return curr == prev ? curr :
sqrtNewtonRaphson(x, 0.5 * (curr + x / curr), curr);
186 double constexpr
sqrt(
double x)
189 : std::numeric_limits<double>::quiet_NaN();
196 #endif // STATEOBSERVATIONTOOLSMISCELANEOUSALGORITHMS
Eigen::VectorXd Vector
Dynamic sized scalar vector.
Definition: definitions.hpp:76
Eigen::Index Index
Definition: definitions.hpp:138
Definitions of types and some structures.
constexpr double epsilon1
number considered zero when compared to 1
Definition: definitions.hpp:672
Eigen::Vector3d Vector3
3D vector
Definition: definitions.hpp:85
Definition: bidim-elastic-inv-pendulum-dyn-sys.hpp:20