4namespace tinyrobotics {
7
8
9
10
14
15
16
17
20 float otherValue = other.getValue(unit);
25 float otherValue = other.getValue(unit);
39 return angularVelocity == other.getValue(unit);
42 bool operator!=(
const AngularVelocity& other)
const {
return !(*
this == other); }
45 return angularVelocity < other.getValue(unit);
49 return angularVelocity <= other.getValue(unit);
53 return angularVelocity > other.getValue(unit);
57 return angularVelocity >= other.getValue(unit);
61 angularVelocity += other.getValue(unit);
66 angularVelocity -= other.getValue(unit);
71 angularVelocity *= scalar;
79 angularVelocity /= scalar;
84 float angularVelocity = 0.0f;
87 AngularVelocity() =
default;
89 : angularVelocity(angularVelocity), unit(unit) {}
92 angularVelocity = newAngularVelocity;
96 if (unit == desiredUnit)
return angularVelocity;
100 return angularVelocity * 180.0f /
static_cast<
float>(M_PI);
104 return angularVelocity *
static_cast<
float>(M_PI) / 180.0f;
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
130
131
132
133
141 AngularVelocity3D() =
default;
143 : x(x), y(y), z(z), unit(unit) {}
146 if (unit == desiredUnit)
return x;
148 return temp.getValue(desiredUnit);
151 if (unit == desiredUnit)
return y;
153 return temp.getValue(desiredUnit);
156 if (unit == desiredUnit)
return z;
158 return temp.getValue(desiredUnit);
Represents a 3D angular velocity vector with unit support.
Definition: AngularVelocity.h:134
Represents a 1D angular velocity with unit support.
Definition: AngularVelocity.h:18
AngularVelocityUnit
Supported angular velocity units for conversion and representation.
Definition: AngularVelocity.h:11