27 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
28 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
29 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, v.
Acc(time),
epsilon);
33 CPPUNIT_ASSERT_DOUBLES_EQUAL(4.0, v.
Pos(time),
epsilon);
34 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Vel(time),
epsilon);
35 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
39 CPPUNIT_ASSERT_DOUBLES_EQUAL(6.0, v.
Pos(time),
epsilon);
40 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Vel(time),
epsilon);
41 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
45 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time),
epsilon);
46 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Vel(time),
epsilon);
47 CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, v.
Acc(time),
epsilon);
51 CPPUNIT_ASSERT_DOUBLES_EQUAL(9.5, v.
Pos(time),
epsilon);
52 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, v.
Vel(time),
epsilon);
53 CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, v.
Acc(time),
epsilon);
57 CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, v.
Pos(time),
epsilon);
58 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
59 CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, v.
Acc(time),
epsilon);
63 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
64 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
65 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
67 CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, v.
Pos(time),
epsilon);
68 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
69 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
111 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
112 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
113 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25, v.
Acc(time),
epsilon);
117 CPPUNIT_ASSERT_DOUBLES_EQUAL(4.0, v.
Pos(time),
epsilon);
118 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, v.
Vel(time),
epsilon);
119 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
123 CPPUNIT_ASSERT_DOUBLES_EQUAL(6.0, v.
Pos(time),
epsilon);
124 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, v.
Vel(time),
epsilon);
125 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
129 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time),
epsilon);
130 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, v.
Vel(time),
epsilon);
131 CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.25, v.
Acc(time),
epsilon);
135 CPPUNIT_ASSERT_DOUBLES_EQUAL(9.5, v.
Pos(time),
epsilon);
136 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, v.
Vel(time),
epsilon);
137 CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.25, v.
Acc(time),
epsilon);
141 CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, v.
Pos(time),
epsilon);
142 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
143 CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.25, v.
Acc(time),
epsilon);
157 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
158 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
159 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, v.
Acc(time),
epsilon);
163 CPPUNIT_ASSERT_DOUBLES_EQUAL(4.0, v.
Pos(time),
epsilon);
164 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Vel(time),
epsilon);
165 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
169 CPPUNIT_ASSERT_DOUBLES_EQUAL(6.0, v.
Pos(time),
epsilon);
170 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Vel(time),
epsilon);
171 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
175 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time),
epsilon);
176 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Vel(time),
epsilon);
177 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
181 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
182 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
183 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
185 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time),
epsilon);
186 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
187 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
201 CPPUNIT_ASSERT_DOUBLES_EQUAL(9.0, v.
Pos(time),
epsilon);
202 CPPUNIT_ASSERT_DOUBLES_EQUAL(-2.0, v.
Vel(time),
epsilon);
203 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
207 CPPUNIT_ASSERT_DOUBLES_EQUAL(5.0, v.
Pos(time),
epsilon);
208 CPPUNIT_ASSERT_DOUBLES_EQUAL(-2.0, v.
Vel(time),
epsilon);
209 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, v.
Acc(time),
epsilon);
213 CPPUNIT_ASSERT_DOUBLES_EQUAL(3.5, v.
Pos(time),
epsilon);
214 CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, v.
Vel(time),
epsilon);
215 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, v.
Acc(time),
epsilon);
219 CPPUNIT_ASSERT_DOUBLES_EQUAL(3.0, v.
Pos(time),
epsilon);
220 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
221 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
225 CPPUNIT_ASSERT_DOUBLES_EQUAL(9.0, v.
Pos(time),
epsilon);
226 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
227 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
229 CPPUNIT_ASSERT_DOUBLES_EQUAL(3.0, v.
Pos(time),
epsilon);
230 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
231 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
246 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
247 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
248 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
252 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
253 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
254 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
258 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time), 0.001);
259 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
260 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.333, v.
Acc(time), 0.001);
264 CPPUNIT_ASSERT_DOUBLES_EQUAL(3.5, v.
Pos(time), 0.001);
265 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, v.
Vel(time), 0.001);
266 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.3333, v.
Acc(time), 0.001);
270 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time),
epsilon);
271 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Vel(time),
epsilon);
272 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
276 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
277 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
278 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
280 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time),
epsilon);
281 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
282 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
298 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time),
epsilon);
299 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
300 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
304 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time),
epsilon);
305 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
306 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
310 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time), 0.001);
311 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
312 CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.333, v.
Acc(time), 0.001);
316 CPPUNIT_ASSERT_DOUBLES_EQUAL(6.5, v.
Pos(time), 0.001);
317 CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, v.
Vel(time), 0.001);
318 CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.3333, v.
Acc(time), 0.001);
322 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
323 CPPUNIT_ASSERT_DOUBLES_EQUAL(-2.0, v.
Vel(time),
epsilon);
324 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
328 CPPUNIT_ASSERT_DOUBLES_EQUAL(8.0, v.
Pos(time),
epsilon);
329 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
330 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
332 CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, v.
Pos(time),
epsilon);
333 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Vel(time),
epsilon);
334 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, v.
Acc(time),
epsilon);
348 CPPUNIT_ASSERT_DOUBLES_EQUAL(pos1, v.
Pos(time),
epsilon);
351 CPPUNIT_ASSERT_DOUBLES_EQUAL(pos2, v.
Pos(time),
epsilon);
354 CPPUNIT_ASSERT_DOUBLES_EQUAL(pos1, v.
Pos(time),
epsilon);
362 double duration = 5.0;
367 CPPUNIT_ASSERT_DOUBLES_EQUAL(pos1, v.
Pos(time),
epsilon);
370 CPPUNIT_ASSERT_DOUBLES_EQUAL((pos1 + pos2)/2, v.
Pos(time),
epsilon);
371 CPPUNIT_ASSERT_DOUBLES_EQUAL((pos2-pos1)/duration, v.
Vel(time),
epsilon);
374 CPPUNIT_ASSERT_DOUBLES_EQUAL(pos2, v.
Pos(time),
epsilon);
376 time = duration + 1.0;
377 CPPUNIT_ASSERT_DOUBLES_EQUAL(pos2, v.
Pos(time),
epsilon);
virtual double Vel(double time) const
virtual double Pos(double time) const
void TestTrap_MaxVelocity1()
void TestDirac_SetProfile()
void TestTrap_MaxVelocity3()
virtual double Pos(double time) const
void TestTrap_SetDuration1()
virtual double Acc(double time) const
void SetProfile(double pos1, double pos2)
virtual double Vel(double time) const
virtual double Pos(double time) const
virtual void SetProfileDuration(double pos1, double pos2, double newduration)
void TestTrapHalf_SetDuration_Start()
void TestDirac_SetProfileDuration()
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
virtual double Acc(double time) const
virtual void SetProfileDuration(double pos1, double pos2, double duration)
void TestTrapHalf_SetDuration_End()
void TestTrapHalf_SetProfile_Start()
virtual void SetProfile(double pos1, double pos2)
CPPUNIT_TEST_SUITE_REGISTRATION(VelocityProfileTest)
virtual void SetProfile(double pos1, double pos2)
void TestTrap_MaxVelocity2()
void TestTrapHalf_SetProfile_End()
virtual void SetProfileDuration(double pos1, double pos2, double newduration)
virtual double Vel(double time) const
virtual double Duration() const
virtual double Duration() const