47 template <
typename flt,
class spec>
333 template <
class other_t>
350 template <
class other_t>
452 template <
typename flt,
class spec>
467 template <
typename flt,
class spec>
480 template <
typename flt,
class spec>
483 return (out << ang.
value());
492 static constexpr double minimum = 0;
493 static constexpr double supremum = 2 *
M_PI;
502 static constexpr double minimum = -
M_PI;
503 static constexpr double supremum =
M_PI;
512 static constexpr double minimum = 0;
513 static constexpr double supremum = 360;
522 static constexpr double minimum = -180;
523 static constexpr double supremum = 180;
bool operator>(const cyclic< flt, spec > &lhs, const cyclic< flt, spec > &rhs)
Implementation of the comparison operation between two angles.
Definition cyclic.h:468
bool operator<(const cyclic< flt, spec > &lhs, const cyclic< flt, spec > &rhs)
Implementation of the comparison operation between two angles.
Definition cyclic.h:453
std::ostream & operator<<(std::ostream &out, const cyclic< flt, spec > &ang)
Implementation of the stream output operator.
Definition cyclic.h:481
All mrs_lib functions, classes, variables and definitions are contained in this namespace.
Definition attitude_converter.h:24
Implementation of the a general cyclic value (such as angles in radians/degrees etc).
Definition cyclic.h:49
flt value() const
Getter for val.
Definition cyclic.h:80
static flt pinterpUnwrapped(const flt from, const flt to, const flt coeff)
Interpolation between two circular quantities in the positive direction without wrapping of the resul...
Definition cyclic.h:288
static flt interpUnwrapped(const flt from, const flt to, const flt coeff)
Interpolation between two circular quantities without wrapping of the result.
Definition cyclic.h:242
static flt unwrap(const flt what, const flt from)
Returns value of the parameter what modified so that there is no "jump" between from and \t what.
Definition cyclic.h:157
cyclic & operator-=(const cyclic &other)
Subtraction compound operator.
Definition cyclic.h:409
static constexpr flt range
Range of the valid interval of wrapped values (also the period of the cyclic quantity).
Definition cyclic.h:87
static flt pdist(const flt from, const flt to)
Returns length of the shortest walk in the positive direction from the first parameter to the second ...
Definition cyclic.h:171
friend spec operator+(const cyclic &lhs, const cyclic &rhs)
Addition operator.
Definition cyclic.h:422
static constexpr flt half_range
Half of the range of the valid interval of wrapped values (used for some calculations).
Definition cyclic.h:89
static other_t convert(const cyclic &what)
Conversion between two different circular quantities.
Definition cyclic.h:334
cyclic & operator=(cyclic &&other)
Move operator.
Definition cyclic.h:385
static flt pinterp(const flt from, const flt to, const flt coeff)
Interpolation between two circular quantities in the positive direction.
Definition cyclic.h:311
cyclic(const cyclic &other)
Copy constructor.
Definition cyclic.h:67
friend flt operator-(const cyclic &lhs, const cyclic &rhs)
Subtraction operator (uses the diff() method).
Definition cyclic.h:434
static flt dist(const flt from, const flt to)
Returns the distance between the two circular values.
Definition cyclic.h:219
cyclic & operator+=(const cyclic &other)
Addition compound operator.
Definition cyclic.h:397
static flt diff(const flt minuend, const flt subtrahend)
Returns the difference between the two circular values.
Definition cyclic.h:193
other_t convert() const
Conversion between two different circular quantities.
Definition cyclic.h:351
cyclic & operator=(const flt nval)
Assignment operator.
Definition cyclic.h:363
cyclic & operator=(const cyclic &other)
Assignment operator.
Definition cyclic.h:374
cyclic()
Default constructor.
Definition cyclic.h:55
cyclic(const spec &other)
Copy constructor.
Definition cyclic.h:73
static flt wrap(const flt val)
Returns val, converted to the valid interval of values.
Definition cyclic.h:114
static constexpr flt minimum
Minimum of the valid interval of wrapped values .
Definition cyclic.h:85
static constexpr flt supremum
Supremum of the valid interval of wrapped values .
Definition cyclic.h:86
cyclic(const flt val)
Constructor overload.
Definition cyclic.h:61
static bool inRange(const flt val)
Checks if val is within the valid interval of wrapped values.
Definition cyclic.h:100
static flt interp(const flt from, const flt to, const flt coeff)
Interpolation between two circular quantities.
Definition cyclic.h:264
Convenience specialization of the cyclic class for unsigned degrees (from $0$ to $360$).
Definition cyclic.h:510
Convenience specialization of the cyclic class for unsigned radians (from $0$ to $2\pi$).
Definition cyclic.h:490
Convenience specialization of the cyclic class for signed degrees (from $-180$ to $180$).
Definition cyclic.h:520
Convenience specialization of the cyclic class for signed radians (from $-\pi$ to $\pi$).
Definition cyclic.h:500