9 #include <boost/functional/hash.hpp> 61 void print(std::string str =
"")
const {
62 if (!str.empty()) std::cout << str << std::endl;
63 if (
use_pos) std::cout <<
"pos: " <<
pos.transpose() << std::endl;
64 if (
use_vel) std::cout <<
"vel: " <<
vel.transpose() << std::endl;
65 if (
use_acc) std::cout <<
"acc: " <<
acc.transpose() << std::endl;
66 if (
use_jrk) std::cout <<
"jrk: " <<
jrk.transpose() << std::endl;
67 if (
use_yaw) std::cout <<
"yaw: " <<
yaw << std::endl;
68 if (
enable_t) std::cout <<
" t: " <<
t << std::endl;
71 std::cout <<
"use vel!" << std::endl;
72 else if (
control == Control::ACC)
73 std::cout <<
"use acc!" << std::endl;
74 else if (
control == Control::JRK)
75 std::cout <<
"use jrk!" << std::endl;
76 else if (
control == Control::SNP)
77 std::cout <<
"use snp!" << std::endl;
78 else if (
control == Control::VELxYAW)
79 std::cout <<
"use vel & yaw!" << std::endl;
80 else if (
control == Control::ACCxYAW)
81 std::cout <<
"use acc & yaw!" << std::endl;
82 else if (
control == Control::JRKxYAW)
83 std::cout <<
"use jrk & yaw!" << std::endl;
84 else if (
control == Control::SNPxYAW)
85 std::cout <<
"use snp & yaw!" << std::endl;
87 std::cout <<
"use null!" << std::endl;
95 for (
int i = 0; i < Dim; i++) {
97 int id = std::round(key.
pos(i) / 0.01);
98 boost::hash_combine(val,
id);
101 int id = std::round(key.
vel(i) / 0.1);
102 boost::hash_combine(val,
id);
105 int id = std::round(key.
acc(i) / 0.1);
106 boost::hash_combine(val,
id);
109 int id = std::round(key.
jrk(i) / 0.1);
110 boost::hash_combine(val,
id);
115 int id = std::round(key.
yaw / 0.1);
116 boost::hash_combine(val,
id);
120 int id = std::round(key.
t / 0.1);
121 boost::hash_combine(val,
id);
bool operator!=(const Waypoint< Dim > &l, const Waypoint< Dim > &r)
Check if two waypoints are not equivalent.
Definition: waypoint.h:139
Vecf< Dim > jrk
jerk in
Definition: waypoint.h:35
decimal_t yaw
yaw
Definition: waypoint.h:36
Waypoint base class.
Definition: waypoint.h:23
bool operator==(const Waypoint< Dim > &l, const Waypoint< Dim > &r)
Check if two waypoints are equivalent.
Definition: waypoint.h:133
bool use_acc
If true, acc will be used in primitive generation.
Definition: waypoint.h:50
bool use_vel
If true, vel will be used in primitive generation.
Definition: waypoint.h:49
Waypoint()
Empty constructor.
Definition: waypoint.h:25
Control
Enum for control input.
Definition: control.h:10
Vecf< Dim > acc
acceleration in
Definition: waypoint.h:34
std::size_t hash_value(const Waypoint< Dim > &key)
Generate hash value for Waypoint class.
Definition: waypoint.h:93
Control::Control control
Control value.
Definition: waypoint.h:54
Vecf< Dim > vel
velocity in
Definition: waypoint.h:33
decimal_t t
time when reaching this waypoint in graph search
Definition: waypoint.h:37
double decimal_t
Rename the float type used in lib.
Definition: data_type.h:49
bool use_jrk
If true, jrk will be used in primitive generation.
Definition: waypoint.h:51
Defines all data types used in this lib.
bool use_yaw
If true, yaw will be used in primitive generation.
Definition: waypoint.h:52
Eigen::Matrix< decimal_t, N, 1 > Vecf
Eigen 1D float vector of size N.
Definition: data_type.h:56
Waypoint< 3 > Waypoint3D
Waypoint for 3D.
Definition: waypoint.h:147
Waypoint(Control::Control c)
Simple constructor.
Definition: waypoint.h:30
Vecf< Dim > pos
position in
Definition: waypoint.h:32
bool use_pos
If true, pos will be used in primitive generation.
Definition: waypoint.h:48
Waypoint< 2 > Waypoint2D
Waypoint for 2D.
Definition: waypoint.h:144
bool enable_t
Definition: waypoint.h:57
void print(std::string str="") const
Print all attributes.
Definition: waypoint.h:61