33namespace perception_msgs {
35namespace object_access {
37 const std::string kExceptionUnknownStateEntry =
"Model with the following ID does not support requested entry: ";
45 inline int indexX(
const unsigned char& model_id) {
49 case EGORWS::MODEL_ID:
51 case ISCACTR::MODEL_ID:
53 case HEXAMOTION::MODEL_ID:
55 case TRAFFICLIGHT::MODEL_ID:
56 return TRAFFICLIGHT::X;
58 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"x");
68 inline int indexY(
const unsigned char& model_id) {
72 case EGORWS::MODEL_ID:
74 case ISCACTR::MODEL_ID:
76 case HEXAMOTION::MODEL_ID:
78 case TRAFFICLIGHT::MODEL_ID:
79 return TRAFFICLIGHT::Y;
81 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"y");
91 inline int indexZ(
const unsigned char& model_id) {
95 case EGORWS::MODEL_ID:
97 case ISCACTR::MODEL_ID:
99 case HEXAMOTION::MODEL_ID:
100 return HEXAMOTION::Z;
101 case TRAFFICLIGHT::MODEL_ID:
102 return TRAFFICLIGHT::Z;
104 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"z");
118 case EGORWS::MODEL_ID:
119 return EGORWS::VEL_LON;
120 case ISCACTR::MODEL_ID:
121 return ISCACTR::VEL_LON;
122 case HEXAMOTION::MODEL_ID:
123 return HEXAMOTION::VEL_LON;
125 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"vel_lon");
139 case EGORWS::MODEL_ID:
140 return EGORWS::VEL_LAT;
141 case ISCACTR::MODEL_ID:
142 return ISCACTR::VEL_LAT;
143 case HEXAMOTION::MODEL_ID:
144 return HEXAMOTION::VEL_LAT;
146 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"vel_lat");
160 case EGORWS::MODEL_ID:
161 return EGORWS::ACC_LON;
162 case ISCACTR::MODEL_ID:
163 return ISCACTR::ACC_LON;
164 case HEXAMOTION::MODEL_ID:
165 return HEXAMOTION::ACC_LON;
167 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"acc_lon");
181 case EGORWS::MODEL_ID:
182 return EGORWS::ACC_LAT;
183 case ISCACTR::MODEL_ID:
184 return ISCACTR::ACC_LAT;
185 case HEXAMOTION::MODEL_ID:
186 return HEXAMOTION::ACC_LAT;
188 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"acc_lat");
202 case EGORWS::MODEL_ID:
204 case HEXAMOTION::MODEL_ID:
205 return HEXAMOTION::ROLL;
207 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"roll");
219 case HEXAMOTION::MODEL_ID:
220 return HEXAMOTION::ROLL_RATE;
222 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"roll_rate");
236 case EGORWS::MODEL_ID:
237 return EGORWS::PITCH;
238 case HEXAMOTION::MODEL_ID:
239 return HEXAMOTION::PITCH;
241 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"pitch");
253 case HEXAMOTION::MODEL_ID:
254 return HEXAMOTION::PITCH_RATE;
256 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"pitch_rate");
266 inline int indexYaw(
const unsigned char& model_id) {
270 case EGORWS::MODEL_ID:
272 case ISCACTR::MODEL_ID:
274 case HEXAMOTION::MODEL_ID:
275 return HEXAMOTION::YAW;
277 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"yaw");
290 return EGO::YAW_RATE;
291 case EGORWS::MODEL_ID:
292 return EGORWS::YAW_RATE;
293 case ISCACTR::MODEL_ID:
294 return ISCACTR::YAW_RATE;
295 case HEXAMOTION::MODEL_ID:
296 return HEXAMOTION::YAW_RATE;
298 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"yaw_rate");
311 return EGO::STEERING_ANGLE_ACK;
313 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"steering_angle_ack");
326 return EGO::STEERING_ANGLE_RATE_ACK;
328 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"steering_angle_rate_ack");
340 case EGORWS::MODEL_ID:
341 return EGORWS::STEERING_ANGLE_FRONT;
343 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"steering_angle_front");
355 case EGORWS::MODEL_ID:
356 return EGORWS::STEERING_ANGLE_REAR;
358 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"steering_angle_rear");
370 case ISCACTR::MODEL_ID:
371 return ISCACTR::WIDTH;
372 case HEXAMOTION::MODEL_ID:
373 return HEXAMOTION::WIDTH;
375 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"width");
387 case ISCACTR::MODEL_ID:
388 return ISCACTR::LENGTH;
389 case HEXAMOTION::MODEL_ID:
390 return HEXAMOTION::LENGTH;
392 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"length");
404 case ISCACTR::MODEL_ID:
405 return ISCACTR::HEIGHT;
406 case HEXAMOTION::MODEL_ID:
407 return HEXAMOTION::HEIGHT;
409 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"height");
422 return EGO::STANDSTILL;
423 case EGORWS::MODEL_ID:
424 return EGORWS::STANDSTILL;
426 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"standstill");
439 return EGO::TURN_INDICATOR;
440 case EGORWS::MODEL_ID:
441 return EGORWS::TURN_INDICATOR;
442 case ISCACTR::MODEL_ID:
443 return ISCACTR::TURN_INDICATOR;
444 case HEXAMOTION::MODEL_ID:
445 return HEXAMOTION::TURN_INDICATOR;
447 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"turn_indicator");
460 return EGO::BRAKE_LIGHT;
461 case EGORWS::MODEL_ID:
462 return EGORWS::BRAKE_LIGHT;
463 case ISCACTR::MODEL_ID:
464 return ISCACTR::BRAKE_LIGHT;
465 case HEXAMOTION::MODEL_ID:
466 return HEXAMOTION::BRAKE_LIGHT;
468 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"brake_light");
481 return EGO::REVERSE_LIGHT;
482 case EGORWS::MODEL_ID:
483 return EGORWS::REVERSE_LIGHT;
484 case ISCACTR::MODEL_ID:
485 return ISCACTR::REVERSE_LIGHT;
486 case HEXAMOTION::MODEL_ID:
487 return HEXAMOTION::REVERSE_LIGHT;
489 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"reverse_light");
502 case TRAFFICLIGHT::MODEL_ID:
503 return TRAFFICLIGHT::STATE;
505 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"traffic_light_state");
518 case TRAFFICLIGHT::MODEL_ID:
519 return TRAFFICLIGHT::TYPE;
521 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"traffic_light_type");
532 inline bool hasX(
const unsigned char& model_id) {
536 case EGORWS::MODEL_ID:
538 case ISCACTR::MODEL_ID:
540 case HEXAMOTION::MODEL_ID:
542 case TRAFFICLIGHT::MODEL_ID:
556 inline bool hasY(
const unsigned char& model_id) {
560 case EGORWS::MODEL_ID:
562 case ISCACTR::MODEL_ID:
564 case HEXAMOTION::MODEL_ID:
566 case TRAFFICLIGHT::MODEL_ID:
580 inline bool hasZ(
const unsigned char& model_id) {
584 case EGORWS::MODEL_ID:
586 case ISCACTR::MODEL_ID:
588 case HEXAMOTION::MODEL_ID:
590 case TRAFFICLIGHT::MODEL_ID:
608 case EGORWS::MODEL_ID:
610 case ISCACTR::MODEL_ID:
612 case HEXAMOTION::MODEL_ID:
630 case EGORWS::MODEL_ID:
632 case ISCACTR::MODEL_ID:
634 case HEXAMOTION::MODEL_ID:
652 case EGORWS::MODEL_ID:
654 case ISCACTR::MODEL_ID:
656 case HEXAMOTION::MODEL_ID:
674 case EGORWS::MODEL_ID:
676 case ISCACTR::MODEL_ID:
678 case HEXAMOTION::MODEL_ID:
692 inline bool hasRoll(
const unsigned char& model_id) {
696 case EGORWS::MODEL_ID:
698 case ISCACTR::MODEL_ID:
700 case HEXAMOTION::MODEL_ID:
718 case EGORWS::MODEL_ID:
720 case ISCACTR::MODEL_ID:
722 case HEXAMOTION::MODEL_ID:
736 inline bool hasPitch(
const unsigned char& model_id) {
740 case EGORWS::MODEL_ID:
742 case ISCACTR::MODEL_ID:
744 case HEXAMOTION::MODEL_ID:
762 case EGORWS::MODEL_ID:
764 case ISCACTR::MODEL_ID:
766 case HEXAMOTION::MODEL_ID:
780 inline bool hasYaw(
const unsigned char& model_id) {
784 case EGORWS::MODEL_ID:
786 case ISCACTR::MODEL_ID:
788 case HEXAMOTION::MODEL_ID:
806 case EGORWS::MODEL_ID:
808 case ISCACTR::MODEL_ID:
810 case HEXAMOTION::MODEL_ID:
828 case EGORWS::MODEL_ID:
830 case ISCACTR::MODEL_ID:
832 case HEXAMOTION::MODEL_ID:
850 case EGORWS::MODEL_ID:
852 case ISCACTR::MODEL_ID:
854 case HEXAMOTION::MODEL_ID:
870 case EGORWS::MODEL_ID:
886 case EGORWS::MODEL_ID:
900 inline bool hasWidth(
const unsigned char& model_id) {
904 case EGORWS::MODEL_ID:
906 case ISCACTR::MODEL_ID:
908 case HEXAMOTION::MODEL_ID:
926 case EGORWS::MODEL_ID:
928 case ISCACTR::MODEL_ID:
930 case HEXAMOTION::MODEL_ID:
948 case EGORWS::MODEL_ID:
950 case ISCACTR::MODEL_ID:
952 case HEXAMOTION::MODEL_ID:
970 case EGORWS::MODEL_ID:
972 case ISCACTR::MODEL_ID:
974 case HEXAMOTION::MODEL_ID:
992 case EGORWS::MODEL_ID:
994 case ISCACTR::MODEL_ID:
996 case HEXAMOTION::MODEL_ID:
1014 case EGORWS::MODEL_ID:
1016 case ISCACTR::MODEL_ID:
1018 case HEXAMOTION::MODEL_ID:
1036 case EGORWS::MODEL_ID:
1038 case ISCACTR::MODEL_ID:
1040 case HEXAMOTION::MODEL_ID:
1057 case TRAFFICLIGHT::MODEL_ID:
1074 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.