12namespace perception_msgs {
14namespace object_access {
16 const std::string kExceptionUnknownStateEntry =
"Model with the following ID does not support requested entry: ";
24 inline int indexX(
const unsigned char& model_id) {
28 case EGORWS::MODEL_ID:
30 case ISCACTR::MODEL_ID:
32 case HEXAMOTION::MODEL_ID:
34 case TRAFFICLIGHT::MODEL_ID:
35 return TRAFFICLIGHT::X;
37 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"x");
47 inline int indexY(
const unsigned char& model_id) {
51 case EGORWS::MODEL_ID:
53 case ISCACTR::MODEL_ID:
55 case HEXAMOTION::MODEL_ID:
57 case TRAFFICLIGHT::MODEL_ID:
58 return TRAFFICLIGHT::Y;
60 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"y");
70 inline int indexZ(
const unsigned char& model_id) {
74 case EGORWS::MODEL_ID:
76 case ISCACTR::MODEL_ID:
78 case HEXAMOTION::MODEL_ID:
80 case TRAFFICLIGHT::MODEL_ID:
81 return TRAFFICLIGHT::Z;
83 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"z");
97 case EGORWS::MODEL_ID:
98 return EGORWS::VEL_LON;
99 case ISCACTR::MODEL_ID:
100 return ISCACTR::VEL_LON;
101 case HEXAMOTION::MODEL_ID:
102 return HEXAMOTION::VEL_LON;
104 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"vel_lon");
118 case EGORWS::MODEL_ID:
119 return EGORWS::VEL_LAT;
120 case ISCACTR::MODEL_ID:
121 return ISCACTR::VEL_LAT;
122 case HEXAMOTION::MODEL_ID:
123 return HEXAMOTION::VEL_LAT;
125 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"vel_lat");
139 case EGORWS::MODEL_ID:
140 return EGORWS::ACC_LON;
141 case ISCACTR::MODEL_ID:
142 return ISCACTR::ACC_LON;
143 case HEXAMOTION::MODEL_ID:
144 return HEXAMOTION::ACC_LON;
146 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"acc_lon");
160 case EGORWS::MODEL_ID:
161 return EGORWS::ACC_LAT;
162 case ISCACTR::MODEL_ID:
163 return ISCACTR::ACC_LAT;
164 case HEXAMOTION::MODEL_ID:
165 return HEXAMOTION::ACC_LAT;
167 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"acc_lat");
181 case EGORWS::MODEL_ID:
183 case HEXAMOTION::MODEL_ID:
184 return HEXAMOTION::ROLL;
186 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"roll");
198 case HEXAMOTION::MODEL_ID:
199 return HEXAMOTION::ROLL_RATE;
201 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"roll_rate");
215 case EGORWS::MODEL_ID:
216 return EGORWS::PITCH;
217 case HEXAMOTION::MODEL_ID:
218 return HEXAMOTION::PITCH;
220 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"pitch");
232 case HEXAMOTION::MODEL_ID:
233 return HEXAMOTION::PITCH_RATE;
235 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"pitch_rate");
245 inline int indexYaw(
const unsigned char& model_id) {
249 case EGORWS::MODEL_ID:
251 case ISCACTR::MODEL_ID:
253 case HEXAMOTION::MODEL_ID:
254 return HEXAMOTION::YAW;
256 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"yaw");
269 return EGO::YAW_RATE;
270 case EGORWS::MODEL_ID:
271 return EGORWS::YAW_RATE;
272 case ISCACTR::MODEL_ID:
273 return ISCACTR::YAW_RATE;
274 case HEXAMOTION::MODEL_ID:
275 return HEXAMOTION::YAW_RATE;
277 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"yaw_rate");
290 return EGO::STEERING_ANGLE_ACK;
292 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"steering_angle_ack");
305 return EGO::STEERING_ANGLE_RATE_ACK;
307 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"steering_angle_rate_ack");
319 case EGORWS::MODEL_ID:
320 return EGORWS::STEERING_ANGLE_FRONT;
322 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"steering_angle_front");
334 case EGORWS::MODEL_ID:
335 return EGORWS::STEERING_ANGLE_REAR;
337 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"steering_angle_rear");
349 case ISCACTR::MODEL_ID:
350 return ISCACTR::WIDTH;
351 case HEXAMOTION::MODEL_ID:
352 return HEXAMOTION::WIDTH;
354 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"width");
366 case ISCACTR::MODEL_ID:
367 return ISCACTR::LENGTH;
368 case HEXAMOTION::MODEL_ID:
369 return HEXAMOTION::LENGTH;
371 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"length");
383 case ISCACTR::MODEL_ID:
384 return ISCACTR::HEIGHT;
385 case HEXAMOTION::MODEL_ID:
386 return HEXAMOTION::HEIGHT;
388 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"height");
401 return EGO::STANDSTILL;
402 case EGORWS::MODEL_ID:
403 return EGORWS::STANDSTILL;
405 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"standstill");
418 return EGO::TURN_INDICATOR;
419 case EGORWS::MODEL_ID:
420 return EGORWS::TURN_INDICATOR;
421 case ISCACTR::MODEL_ID:
422 return ISCACTR::TURN_INDICATOR;
423 case HEXAMOTION::MODEL_ID:
424 return HEXAMOTION::TURN_INDICATOR;
426 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"turn_indicator");
439 return EGO::BRAKE_LIGHT;
440 case EGORWS::MODEL_ID:
441 return EGORWS::BRAKE_LIGHT;
442 case ISCACTR::MODEL_ID:
443 return ISCACTR::BRAKE_LIGHT;
444 case HEXAMOTION::MODEL_ID:
445 return HEXAMOTION::BRAKE_LIGHT;
447 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"brake_light");
460 return EGO::REVERSE_LIGHT;
461 case EGORWS::MODEL_ID:
462 return EGORWS::REVERSE_LIGHT;
463 case ISCACTR::MODEL_ID:
464 return ISCACTR::REVERSE_LIGHT;
465 case HEXAMOTION::MODEL_ID:
466 return HEXAMOTION::REVERSE_LIGHT;
468 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"reverse_light");
481 case TRAFFICLIGHT::MODEL_ID:
482 return TRAFFICLIGHT::STATE;
484 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"traffic_light_state");
497 case TRAFFICLIGHT::MODEL_ID:
498 return TRAFFICLIGHT::TYPE;
500 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"traffic_light_type");
511 inline bool hasX(
const unsigned char& model_id) {
515 case EGORWS::MODEL_ID:
517 case ISCACTR::MODEL_ID:
519 case HEXAMOTION::MODEL_ID:
521 case TRAFFICLIGHT::MODEL_ID:
535 inline bool hasY(
const unsigned char& model_id) {
539 case EGORWS::MODEL_ID:
541 case ISCACTR::MODEL_ID:
543 case HEXAMOTION::MODEL_ID:
545 case TRAFFICLIGHT::MODEL_ID:
559 inline bool hasZ(
const unsigned char& model_id) {
563 case EGORWS::MODEL_ID:
565 case ISCACTR::MODEL_ID:
567 case HEXAMOTION::MODEL_ID:
569 case TRAFFICLIGHT::MODEL_ID:
587 case EGORWS::MODEL_ID:
589 case ISCACTR::MODEL_ID:
591 case HEXAMOTION::MODEL_ID:
609 case EGORWS::MODEL_ID:
611 case ISCACTR::MODEL_ID:
613 case HEXAMOTION::MODEL_ID:
631 case EGORWS::MODEL_ID:
633 case ISCACTR::MODEL_ID:
635 case HEXAMOTION::MODEL_ID:
653 case EGORWS::MODEL_ID:
655 case ISCACTR::MODEL_ID:
657 case HEXAMOTION::MODEL_ID:
671 inline bool hasRoll(
const unsigned char& model_id) {
675 case EGORWS::MODEL_ID:
677 case ISCACTR::MODEL_ID:
679 case HEXAMOTION::MODEL_ID:
697 case EGORWS::MODEL_ID:
699 case ISCACTR::MODEL_ID:
701 case HEXAMOTION::MODEL_ID:
715 inline bool hasPitch(
const unsigned char& model_id) {
719 case EGORWS::MODEL_ID:
721 case ISCACTR::MODEL_ID:
723 case HEXAMOTION::MODEL_ID:
741 case EGORWS::MODEL_ID:
743 case ISCACTR::MODEL_ID:
745 case HEXAMOTION::MODEL_ID:
759 inline bool hasYaw(
const unsigned char& model_id) {
763 case EGORWS::MODEL_ID:
765 case ISCACTR::MODEL_ID:
767 case HEXAMOTION::MODEL_ID:
785 case EGORWS::MODEL_ID:
787 case ISCACTR::MODEL_ID:
789 case HEXAMOTION::MODEL_ID:
807 case EGORWS::MODEL_ID:
809 case ISCACTR::MODEL_ID:
811 case HEXAMOTION::MODEL_ID:
829 case EGORWS::MODEL_ID:
831 case ISCACTR::MODEL_ID:
833 case HEXAMOTION::MODEL_ID:
849 case EGORWS::MODEL_ID:
865 case EGORWS::MODEL_ID:
879 inline bool hasWidth(
const unsigned char& model_id) {
883 case EGORWS::MODEL_ID:
885 case ISCACTR::MODEL_ID:
887 case HEXAMOTION::MODEL_ID:
905 case EGORWS::MODEL_ID:
907 case ISCACTR::MODEL_ID:
909 case HEXAMOTION::MODEL_ID:
927 case EGORWS::MODEL_ID:
929 case ISCACTR::MODEL_ID:
931 case HEXAMOTION::MODEL_ID:
949 case EGORWS::MODEL_ID:
951 case ISCACTR::MODEL_ID:
953 case HEXAMOTION::MODEL_ID:
971 case EGORWS::MODEL_ID:
973 case ISCACTR::MODEL_ID:
975 case HEXAMOTION::MODEL_ID:
993 case EGORWS::MODEL_ID:
995 case ISCACTR::MODEL_ID:
997 case HEXAMOTION::MODEL_ID:
1015 case EGORWS::MODEL_ID:
1017 case ISCACTR::MODEL_ID:
1019 case HEXAMOTION::MODEL_ID:
1036 case TRAFFICLIGHT::MODEL_ID:
1053 case TRAFFICLIGHT::MODEL_ID:
bool hasYaw(const unsigned char &model_id)
Indicates if given model contains a yaw.
int indexBrakeLight(const unsigned char &model_id)
Get the vector-index that stores the brake light state for a given model-id.
int indexRollRate(const unsigned char &model_id)
Get the vector-index that stores the roll rate for a given model-id.
bool hasSteeringAngleFront(const unsigned char &model_id)
Indicates if given model contains a front wheel angle.
int indexVelLon(const unsigned char &model_id)
Get the vector-index that stores the longitudinal velocity for a given model-id.
int indexWidth(const unsigned char &model_id)
Get the vector-index that stores the width for a given model-id.
int indexRoll(const unsigned char &model_id)
Get the vector-index that stores the roll for a given model-id.
bool hasTrafficLightType(const unsigned char &model_id)
Indicates if given model contains a traffic light type.
bool hasYawRate(const unsigned char &model_id)
Indicates if given model contains a yaw-rate.
int indexLength(const unsigned char &model_id)
Get the vector-index that stores the length for a given model-id.
int indexPitchRate(const unsigned char &model_id)
Get the vector-index that stores the pitch rate for a given model-id.
bool hasHeight(const unsigned char &model_id)
Indicates if given model contains a height.
bool hasZ(const unsigned char &model_id)
Indicates if given model contains a z-position.
int indexYawRate(const unsigned char &model_id)
Get the vector-index that stores the yaw-rate for a given model-id.
bool hasRollRate(const unsigned char &model_id)
Indicates if given model contains a roll-rate.
bool hasReverseLight(const unsigned char &model_id)
Indicates if given model contains a reverse light state.
bool hasSteeringAngleAck(const unsigned char &model_id)
Indicates if given model contains an ackermann steering angle.
bool hasAccLat(const unsigned char &model_id)
Indicates if given model contains a lateral acceleration.
bool hasVelLat(const unsigned char &model_id)
Indicates if given model contains a lateral velocity.
int indexHeight(const unsigned char &model_id)
Get the vector-index that stores the height for a given model-id.
int indexVelLat(const unsigned char &model_id)
Get the vector-index that stores the lateral velocity for a given model-id.
bool hasSteeringAngleRateAck(const unsigned char &model_id)
Indicates if given model contains an ackermann steering angle rate.
bool hasY(const unsigned char &model_id)
Indicates if given model contains a y-position.
bool hasBrakeLight(const unsigned char &model_id)
Indicates if given model contains a brake light state.
bool hasLength(const unsigned char &model_id)
Indicates if given model contains a length.
bool hasTrafficLightState(const unsigned char &model_id)
Indicates if given model contains a traffic light state.
bool hasSteeringAngleRear(const unsigned char &model_id)
Indicates if given model contains a rear wheel angle.
bool hasRoll(const unsigned char &model_id)
Indicates if given model contains a roll.
int indexTurnIndicator(const unsigned char &model_id)
Get the vector-index that stores the turn indicator state for a given model-id.
int indexY(const unsigned char &model_id)
Get the vector-index that stores the y-position for a given model-id.
int indexSteeringAngleFront(const unsigned char &model_id)
Get the vector-index that stores the front wheel angle for a given model-id.
bool hasX(const unsigned char &model_id)
Indicates if given model contains an x-position.
int indexSteeringAngleRear(const unsigned char &model_id)
Get the vector-index that stores the rear wheel angle for a given model-id.
bool hasVelLon(const unsigned char &model_id)
Indicates if given model contains a longitudinal velocity.
int indexReverseLight(const unsigned char &model_id)
Get the vector-index that stores the reverse light state for a given model-id.
int indexZ(const unsigned char &model_id)
Get the vector-index that stores the z-position for a given model-id.
bool hasStandstill(const unsigned char &model_id)
Indicates if given model contains a standstill indication.
int indexAccLon(const unsigned char &model_id)
Get the vector-index that stores the longitudinal acceleration for a given model-id.
int indexStandstill(const unsigned char &model_id)
Get the vector-index that stores the standstill indication for a given model-id.
bool hasPitchRate(const unsigned char &model_id)
Indicates if given model contains a pitch-rate.
int indexTrafficLightType(const unsigned char &model_id)
Get the vector-index that stores the traffic light type for a given model-id.
int indexSteeringAngleRateAck(const unsigned char &model_id)
Get the vector-index that stores the steering angle rate for a given model-id.
bool hasPitch(const unsigned char &model_id)
Indicates if given model contains a pitch.
int indexPitch(const unsigned char &model_id)
Get the vector-index that stores the pitch for a given model-id.
bool hasTurnIndicator(const unsigned char &model_id)
Indicates if given model contains a turn indicator state.
int indexAccLat(const unsigned char &model_id)
Get the vector-index that stores the lateral acceleration for a given model-id.
int indexSteeringAngleAck(const unsigned char &model_id)
Get the vector-index that stores the ackermann steering angle for a given model-id.
int indexX(const unsigned char &model_id)
Get the vector-index that stores the x-position for a given model-id.
bool hasAccLon(const unsigned char &model_id)
Indicates if given model contains a longitudinal acceleration.
int indexTrafficLightState(const unsigned char &model_id)
Get the vector-index that stores the traffic light state for a given model-id.
int indexYaw(const unsigned char &model_id)
Get the vector-index that stores the yaw for a given model-id.
bool hasWidth(const unsigned char &model_id)
Indicates if given model contains a width.