]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/blob - api/rrtext.h
Add ext2 collide method skeletons
[hubacji1/rrts.git] / api / rrtext.h
1 #ifndef RRTEXT_H
2 #define RRTEXT_H
3
4 #include "rrts.h"
5 #include "SOLID/solid.h"
6
7 /*! \brief Collision with SOLID.
8
9 Use SOLID library for collision detection.
10
11 \see http://solid.sourceforge.net/
12
13 \param sr_bc Shape reference of bicycle car.
14 \param bc Bicycle car used for collision computations.
15 \param sr_obstacles Obstacles shape references.
16 */
17 class RRTExt2 : public RRTS {
18         private:
19                 BicycleCar bc_;
20                 DtShapeRef sr_bc_;
21                 Obstacle static_obstacle_;
22                 DtShapeRef sr_static_obstacles_;
23
24                 // Collide RRT procedures
25                 std::tuple<bool, unsigned int, unsigned int>
26                 collide_steered_from(RRTNode &f);
27
28                 std::tuple<bool, unsigned int, unsigned int>
29                 collide_two_nodes(RRTNode &f, RRTNode &t);
30         public:
31                 /*! \brief Initialize SOLID based extension.
32                 */
33                 void init_solid();
34                 /*! \brief Deinitialize SOLID based extension.
35                 */
36                 void deinit_solid();
37
38                 // getters, setters
39                 BicycleCar &bc() { return this->bc_; }
40                 DtShapeRef &sr_bc() { return this->sr_bc_; }
41                 Obstacle &static_obstacle() { return this->static_obstacle_; }
42                 DtShapeRef &sr_static_obstacles()
43                 {
44                         return this->sr_static_obstacles_;
45                 }
46 };
47
48 /*! \brief Different costs extension.
49
50 Use different cost for bulding tree data structure and searching in the
51 structure.
52 */
53 class RRTExt1 : public RRTS {
54         public:
55                 /*! \brief Reeds and Shepp path length.
56                 */
57                 double cost_build(RRTNode &f, RRTNode &t);
58                 /*! \brief Matej's heuristics.
59                 */
60                 double cost_search(RRTNode &f, RRTNode &t);
61 };
62
63 #endif /* RRTEXT_H */