Bench-MR
A Motion Planning Benchmark for Wheeled Mobile Robots
gnode_base.h
Go to the documentation of this file.
1#pragma once
2
3#include <utility>
4
6#include <base/Primitives.h>
7
8// Base class for all the steering functions
9class GNode_base {
10 public:
11 virtual ~GNode_base() = default;
12
14 double steer_cost{0};
15
17 int nEdges{0};
18
20 double *costs{nullptr};
21
23 double *orientations{nullptr};
24
26 int READ_OR{0};
27
29
30 int goal_x{0};
31 int goal_y{0};
32
33 int start_x{0};
34 int start_y{0};
35
37 int x{0}, y{0};
38
39 double x_r{0}, y_r{0};
40
42 bool steer{false};
43
45 double theta{0};
46
47 bool hasParent{false};
48
49 GNode_base *parent{nullptr};
50 GNode_base *child{nullptr};
51
52 inline ompl::base::State *toState() const {
53 double unit = global::settings.environment->unit();
54 return Point(x_r * unit, y_r * unit).toState(theta);
55 }
56
57 // ============================================================================================
61 static bool line(const GNode_base *parent_node, const GNode_base *successor);
62
63 // static bool line(double x0, double y0, double y1, double x1);
64
65 // ============================================================================================
69 static bool isblock(double x, double y, double theta);
70};
ob::SE2StateSpace::StateType State
Definition: Primitives.h:12
Definition: gnode_base.h:9
double x_r
Definition: gnode_base.h:39
double theta
Orientation associated to the best node.
Definition: gnode_base.h:45
bool hasParent
Definition: gnode_base.h:47
int start_y
Definition: gnode_base.h:34
double steer_cost
Cost associated to the best Node selected.
Definition: gnode_base.h:14
int CHECK_SUCCESSOR
Definition: gnode_base.h:28
int goal_x
Definition: gnode_base.h:30
GNode_base * parent
Definition: gnode_base.h:49
int x
X and Y coordinates of the Node.
Definition: gnode_base.h:37
int nEdges
Number of outgoing edges per node.
Definition: gnode_base.h:17
static bool line(const GNode_base *parent_node, const GNode_base *successor)
line(GNode *successor,GNode *parent_node)
Definition: gnode_base.cpp:43
double * orientations
array of possible orientations
Definition: gnode_base.h:23
int goal_y
Definition: gnode_base.h:31
bool steer
Flag to indicate if node hase been generated by a steering function.
Definition: gnode_base.h:42
virtual ~GNode_base()=default
ompl::base::State * toState() const
Definition: gnode_base.h:52
double y_r
Definition: gnode_base.h:39
static bool isblock(double x, double y, double theta)
bool isblock(double x, double y)
Definition: gnode_base.cpp:10
int READ_OR
flag to read orientations from Map
Definition: gnode_base.h:26
int y
Definition: gnode_base.h:37
int start_x
Definition: gnode_base.h:33
double * costs
Cost per each orientation associated to the node.
Definition: gnode_base.h:20
GNode_base * child
Definition: gnode_base.h:50
std::shared_ptr< Environment > environment
Environment used for planning.
Definition: PlannerSettings.h:73
Definition: Primitives.h:42
ompl::base::State * toState(double theta=0) const
Definition: Primitives.cpp:21
static PlannerSettings::GlobalSettings settings
Definition: PlannerSettings.h:699