Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
types.hpp
Go to the documentation of this file.
1#ifndef PACSIMTYPES_HPP
2#define PACSIMTYPES_HPP
3
4#include "quaternion.hpp"
5#include <Eigen/Core>
6#include <vector>
7
9{
10 BLUE = 0,
11 YELLOW = 1,
12 ORANGE = 2,
16 // convention: unknown is last element, that way we know the number of classes
17 UNKNOWN = 6
18};
19
20LandmarkType stringToLandmarkType(const std::string& in);
21
22// data structure to store everything for each Landmark (without color probabilities)
24{
25 int id;
26 Eigen::Vector3d position;
27 Eigen::Matrix3d cov;
28 bool beenHit = false;
30 double typeWeights[LandmarkType::UNKNOWN + 1] = { 0.0 };
32};
33
34struct Map
35{
36 std::vector<Landmark> landmarks;
37};
38
39struct Track
40{
42 std::vector<Landmark> left_lane;
43 std::vector<Landmark> right_lane;
44 std::vector<Landmark> unknown;
45 std::vector<std::pair<Landmark, Landmark>> time_keeping_gates;
46 Eigen::Vector3d gnssOrigin;
47 Eigen::Vector3d enuToTrackRotation;
48};
50{
51 std::vector<Landmark> list;
52 std::vector<Eigen::Vector2d> fov_polygon;
53 std::string source_type;
54
55 std::string frame_id;
56 double timestamp;
57};
58
59// TODO get rid of that
61
63
64// data structure to store everything for the Pose
65struct Pose
66{
67 Eigen::Vector3d mean;
68 Eigen::Matrix3d cov;
69 double timestamp;
70
71 std::string frame_id;
72};
73struct Wheels
74{
75 double FL; // Front Left
76 double FR; // Front Right
77 double RL; // Rear Left
78 double RR; // Rear Right
79
80 double timestamp;
81};
82
83struct ImuData
84{
85 Eigen::Vector3d acc;
86 Eigen::Vector3d rot;
87
88 Eigen::Matrix3d acc_cov;
89 Eigen::Matrix3d rot_cov;
90
91 double timestamp;
92 std::string frame;
93};
94
96{
97 double latitude;
98 double longitude;
99 double altitude;
100 Eigen::Matrix3d position_covariance;
101
102 double vel_east;
103 double vel_north;
104 double vel_up;
105 Eigen::Matrix3d velocity_covariance;
106
108 Eigen::Matrix3d orientation_covariance;
109
111 {
112 NO_FIX = -1,
113 FIX = 0
114 };
115
117
118 double timestamp;
119 std::string frame;
120};
121
123{
124 double data;
125
126 double timestamp;
127};
128
129struct Report
130{
131 std::string creation_time = "";
132 std::string track_name = "";
133 std::string perception_config_file = "";
134 std::string sensors_config_file = "";
135 std::string vehicle_config_file = "";
136 int seed = 0;
137
138 std::string discipline = "";
140 std::string dnf_reason = "";
141 double final_time = 0.0;
142 double final_time_raw = 0.0;
143 double total_sim_time = 0.0;
144
145 bool off_course_detect = true;
146 bool cone_hit_detect = true;
147 bool uss_detect = true;
148 bool dnf_detect = true;
149 bool finish_validate = true;
150 double timeout_total = 300;
151 double timeout_first_lap = 100;
152 struct LapTime
153 {
154 double time;
155 std::vector<double> sector_times;
156 };
157 std::vector<LapTime> lap_times;
158 // std::vector<std::vector<double>> sector_times;
159
160 struct Penalty
161 {
162 int lap;
165 std::string reason;
166 Eigen::Vector3d position;
167 };
168 std::vector<Penalty> penalties;
169};
170
178
196
197Discipline stringToDiscipline(const std::string& disciplineStr);
198
199#endif /* PACSIMTYPES_HPP */
double vel_up
Definition types.hpp:104
Eigen::Matrix3d velocity_covariance
Definition types.hpp:105
quaternion orientation
Definition types.hpp:107
double longitude
Definition types.hpp:98
double timestamp
Definition types.hpp:118
double vel_north
Definition types.hpp:103
double latitude
Definition types.hpp:97
Eigen::Matrix3d position_covariance
Definition types.hpp:100
double altitude
Definition types.hpp:99
FixStatus fix_status
Definition types.hpp:116
std::string frame
Definition types.hpp:119
Eigen::Matrix3d orientation_covariance
Definition types.hpp:108
double vel_east
Definition types.hpp:102
Eigen::Matrix3d acc_cov
Definition types.hpp:88
Eigen::Vector3d rot
Definition types.hpp:86
double timestamp
Definition types.hpp:91
Eigen::Vector3d acc
Definition types.hpp:85
std::string frame
Definition types.hpp:92
Eigen::Matrix3d rot_cov
Definition types.hpp:89
Eigen::Matrix3d cov
Definition types.hpp:27
double typeWeights[LandmarkType::UNKNOWN+1]
Definition types.hpp:30
double detection_probability
Definition types.hpp:31
int id
Definition types.hpp:25
Eigen::Vector3d position
Definition types.hpp:26
bool beenHit
Definition types.hpp:28
LandmarkType type
Definition types.hpp:29
double timestamp
Definition types.hpp:56
std::vector< Eigen::Vector2d > fov_polygon
Definition types.hpp:52
std::string source_type
Definition types.hpp:53
std::string frame_id
Definition types.hpp:55
std::vector< Landmark > list
Definition types.hpp:51
double timeout_skidpad
Definition types.hpp:184
double timeout_acceleration
Definition types.hpp:182
double timeout_autocross
Definition types.hpp:183
double timeout_start
Definition types.hpp:181
Discipline discipline
Definition types.hpp:191
bool oc_detect
Definition types.hpp:187
bool broadcast_sensors_tf2
Definition types.hpp:193
bool finish_validate
Definition types.hpp:190
double timeout_trackdrive_first
Definition types.hpp:185
bool doo_detect
Definition types.hpp:188
bool pre_transform_track
Definition types.hpp:194
double timeout_trackdrive_total
Definition types.hpp:186
bool uss_detect
Definition types.hpp:189
std::string cog_frame_id_pipeline
Definition types.hpp:192
Definition types.hpp:35
std::vector< Landmark > landmarks
Definition types.hpp:36
Definition types.hpp:66
Eigen::Vector3d mean
Definition types.hpp:67
double timestamp
Definition types.hpp:69
std::string frame_id
Definition types.hpp:71
Eigen::Matrix3d cov
Definition types.hpp:68
std::vector< double > sector_times
Definition types.hpp:155
double penalty_time
Definition types.hpp:163
double occurence_time
Definition types.hpp:164
std::string reason
Definition types.hpp:165
Eigen::Vector3d position
Definition types.hpp:166
bool uss_detect
Definition types.hpp:147
std::string track_name
Definition types.hpp:132
std::string perception_config_file
Definition types.hpp:133
double final_time_raw
Definition types.hpp:142
double timeout_total
Definition types.hpp:150
std::string sensors_config_file
Definition types.hpp:134
std::vector< Penalty > penalties
Definition types.hpp:168
bool success
Definition types.hpp:139
std::string discipline
Definition types.hpp:138
int seed
Definition types.hpp:136
double final_time
Definition types.hpp:141
bool off_course_detect
Definition types.hpp:145
double timeout_first_lap
Definition types.hpp:151
std::string dnf_reason
Definition types.hpp:140
bool finish_validate
Definition types.hpp:149
std::string creation_time
Definition types.hpp:131
bool cone_hit_detect
Definition types.hpp:146
bool dnf_detect
Definition types.hpp:148
std::string vehicle_config_file
Definition types.hpp:135
std::vector< LapTime > lap_times
Definition types.hpp:157
double total_sim_time
Definition types.hpp:143
double timestamp
Definition types.hpp:126
double data
Definition types.hpp:124
std::vector< std::pair< Landmark, Landmark > > time_keeping_gates
Definition types.hpp:45
Eigen::Vector3d enuToTrackRotation
Definition types.hpp:47
std::vector< Landmark > left_lane
Definition types.hpp:42
bool lanesFirstWithLastConnected
Definition types.hpp:41
std::vector< Landmark > unknown
Definition types.hpp:44
std::vector< Landmark > right_lane
Definition types.hpp:43
Eigen::Vector3d gnssOrigin
Definition types.hpp:46
double RL
Definition types.hpp:77
double FL
Definition types.hpp:75
double FR
Definition types.hpp:76
double RR
Definition types.hpp:78
double timestamp
Definition types.hpp:80
Discipline stringToDiscipline(const std::string &disciplineStr)
Definition types.cpp:63
Track lmListToTrack(LandmarkList &in)
Definition types.cpp:53
LandmarkList trackToLMList(Track &in)
Definition types.cpp:33
Discipline
Definition types.hpp:172
@ SKIDPAD
Definition types.hpp:176
@ AUTOCROSS
Definition types.hpp:173
@ ACCELERATION
Definition types.hpp:175
@ TRACKDRIVE
Definition types.hpp:174
LandmarkType
Definition types.hpp:9
@ BLUE
Definition types.hpp:10
@ INVISIBLE
Definition types.hpp:15
@ BIG_ORANGE
Definition types.hpp:13
@ TIMEKEEPING
Definition types.hpp:14
@ UNKNOWN
Definition types.hpp:17
@ ORANGE
Definition types.hpp:12
@ YELLOW
Definition types.hpp:11
LandmarkType stringToLandmarkType(const std::string &in)
Definition types.cpp:3