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 case TRAFFICLIGHT::MODEL_ID:
440 return TRAFFICLIGHT::STATE;
442 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"traffic_light_state");
455 case TRAFFICLIGHT::MODEL_ID:
456 return TRAFFICLIGHT::TYPE;
458 throw std::invalid_argument(kExceptionUnknownStateEntry + std::to_string(model_id) +
", " +
"traffic_light_type");
469 inline bool hasX(
const unsigned char& model_id) {
473 case EGORWS::MODEL_ID:
475 case ISCACTR::MODEL_ID:
477 case HEXAMOTION::MODEL_ID:
479 case TRAFFICLIGHT::MODEL_ID:
493 inline bool hasY(
const unsigned char& model_id) {
497 case EGORWS::MODEL_ID:
499 case ISCACTR::MODEL_ID:
501 case HEXAMOTION::MODEL_ID:
503 case TRAFFICLIGHT::MODEL_ID:
517 inline bool hasZ(
const unsigned char& model_id) {
521 case EGORWS::MODEL_ID:
523 case ISCACTR::MODEL_ID:
525 case HEXAMOTION::MODEL_ID:
527 case TRAFFICLIGHT::MODEL_ID:
545 case EGORWS::MODEL_ID:
547 case ISCACTR::MODEL_ID:
549 case HEXAMOTION::MODEL_ID:
567 case EGORWS::MODEL_ID:
569 case ISCACTR::MODEL_ID:
571 case HEXAMOTION::MODEL_ID:
589 case EGORWS::MODEL_ID:
591 case ISCACTR::MODEL_ID:
593 case HEXAMOTION::MODEL_ID:
611 case EGORWS::MODEL_ID:
613 case ISCACTR::MODEL_ID:
615 case HEXAMOTION::MODEL_ID:
629 inline bool hasRoll(
const unsigned char& model_id) {
633 case EGORWS::MODEL_ID:
635 case ISCACTR::MODEL_ID:
637 case HEXAMOTION::MODEL_ID:
655 case EGORWS::MODEL_ID:
657 case ISCACTR::MODEL_ID:
659 case HEXAMOTION::MODEL_ID:
673 inline bool hasPitch(
const unsigned char& model_id) {
677 case EGORWS::MODEL_ID:
679 case ISCACTR::MODEL_ID:
681 case HEXAMOTION::MODEL_ID:
699 case EGORWS::MODEL_ID:
701 case ISCACTR::MODEL_ID:
703 case HEXAMOTION::MODEL_ID:
717 inline bool hasYaw(
const unsigned char& model_id) {
721 case EGORWS::MODEL_ID:
723 case ISCACTR::MODEL_ID:
725 case HEXAMOTION::MODEL_ID:
743 case EGORWS::MODEL_ID:
745 case ISCACTR::MODEL_ID:
747 case HEXAMOTION::MODEL_ID:
765 case EGORWS::MODEL_ID:
767 case ISCACTR::MODEL_ID:
769 case HEXAMOTION::MODEL_ID:
787 case EGORWS::MODEL_ID:
789 case ISCACTR::MODEL_ID:
791 case HEXAMOTION::MODEL_ID:
807 case EGORWS::MODEL_ID:
823 case EGORWS::MODEL_ID:
837 inline bool hasWidth(
const unsigned char& model_id) {
841 case EGORWS::MODEL_ID:
843 case ISCACTR::MODEL_ID:
845 case HEXAMOTION::MODEL_ID:
863 case EGORWS::MODEL_ID:
865 case ISCACTR::MODEL_ID:
867 case HEXAMOTION::MODEL_ID:
885 case EGORWS::MODEL_ID:
887 case ISCACTR::MODEL_ID:
889 case HEXAMOTION::MODEL_ID:
907 case EGORWS::MODEL_ID:
909 case ISCACTR::MODEL_ID:
911 case HEXAMOTION::MODEL_ID:
928 case TRAFFICLIGHT::MODEL_ID:
945 case TRAFFICLIGHT::MODEL_ID:
bool hasYaw(const unsigned char &model_id)
Indicates if given model contains a yaw.
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 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 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 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 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.
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.