]> rtime.felk.cvut.cz Git - hubacji1/psp.git/blob - ut/psp.t.cc
Add collide skeleton, ut
[hubacji1/psp.git] / ut / psp.t.cc
1 #include <cmath>
2 #include "wvtest.h"
3
4 #include "psp.h"
5
6 WVTEST_MAIN("parking slot planner basic test")
7 {
8         PSPlanner psp;
9         psp.ps().border(3, 3, 5, 3, 5, 8, 3, 8);
10         psp.gc().x(4);
11         psp.gc().y(4);
12         psp.gc().h(M_PI / 2);
13         psp.gc().mtr(10);
14         psp.gc().wb(2);
15         psp.gc().w(1);
16         psp.gc().l(3);
17         psp.gc().he(1.5);
18         psp.gc().df(2 + 0.5);
19         psp.gc().dr(0.5);
20
21         // init orientation
22         WVPASS(!psp.collide());
23         WVPASSEQ_DOUBLE(psp.ps().heading(), psp.gc().h(), 0.00001);
24
25         // collide
26         PSPlanner tpsp;
27         tpsp.ps().border(2, 3, 4, 3, 4, 8, 2, 8);
28         tpsp.gc() = BicycleCar(psp.gc());
29         tpsp.cc() = BicycleCar(tpsp.gc());
30         WVPASS(tpsp.collide());
31 }