diff --git a/include/MantleAPI/Common/route_definition.h b/include/MantleAPI/Common/route_definition.h index ff5e5761e42ac7fdcde5c0c7fecffb81a1d590f7..b6ac24a01bf5034636245ba2c07cd9607eb66bc5 100644 --- a/include/MantleAPI/Common/route_definition.h +++ b/include/MantleAPI/Common/route_definition.h @@ -17,12 +17,13 @@ #include <MantleAPI/Common/vector.h> #include <units.h> + #include <vector> namespace mantle_api { /// Defines how a route should be calculated -enum class RouteStrategy +enum class RouteStrategy : int { kUndefined = 0, kFastest, diff --git a/include/MantleAPI/EnvironmentalConditions/weather.h b/include/MantleAPI/EnvironmentalConditions/weather.h index 6a8703f24a836bad4464faf8f907c38943ee0f1f..bfa13e3c62d7ea97d9ee8ed21d040d5bbe38df91 100644 --- a/include/MantleAPI/EnvironmentalConditions/weather.h +++ b/include/MantleAPI/EnvironmentalConditions/weather.h @@ -19,36 +19,39 @@ namespace mantle_api { -enum class Precipitation + +/// Specify the amount of the precipitation. +enum class Precipitation : int { - kUnknown, - kOther, - kNone, - kVeryLight, - kLight, - kModerate, - kHeavy, - kVeryHeavy, - kExtreme + kUnknown = 0, ///< The amount of precipitation is unknown. + kOther, ///< The amount of precipitation is known but unspecified. + kNone, ///< There is no precipitation. + kVeryLight, ///< There is very light precipitation. + kLight, ///< There is light precipitation. + kModerate, ///< There is moderate precipitation. + kHeavy, ///< There is heavy precipitation. + kVeryHeavy, ///< There is very heavy precipitation. + kExtreme ///< There is extreme precipitation. }; -enum class Fog +/// Specify the amount of the fog. +enum class Fog : int { - kUnknown, - kOther, - kExcellentVisibility, - kGoodVisibility, - kModerateVisibility, - kPoorVisibility, - kMist, - kLight, - kThick, - kDense + kUnknown = 0, ///< The amount of fog is unknown. + kOther, ///< The amount of fog is known but unspecified. + kExcellentVisibility, ///< Visibility is excellent. There is no fog. + kGoodVisibility, ///< Visibility is good. There is light fog. + kModerateVisibility, ///< Visibility is moderate. There is thick fog. + kPoorVisibility, ///< Visibility is poor. There is dense fog. + kMist, ///< Visibility is moderate. It is misty. + kLight, ///< Visibility is good. There is light fog. + kThick, ///< Visibility is moderate. There is thick fog. + kDense ///< Visibility is poor. There is dense fog. }; -enum class Illumination +enum class Illumination : int { - kUnknown, + kUnknown = 0, kOther, kLevel1, kLevel2, diff --git a/include/MantleAPI/Map/i_lane_location_query_service.h b/include/MantleAPI/Map/i_lane_location_query_service.h index 9bbf4816e1974cd72a8ce1407d0a826f53a6dbf8..ceac3ab51efa40d3adc7171bd535b010fb059f50 100644 --- a/include/MantleAPI/Map/i_lane_location_query_service.h +++ b/include/MantleAPI/Map/i_lane_location_query_service.h @@ -27,17 +27,17 @@ namespace mantle_api { -enum class Direction +enum class Direction : int { kForward = 0, - kBackwards = 1 + kBackwards }; -enum class LateralDisplacementDirection +enum class LateralDisplacementDirection : int { kAny = 0, - kLeft = 1, - kRight = 2 + kLeft, + kRight }; /// Abstraction layer for all map related functions. diff --git a/include/MantleAPI/Traffic/control_strategy.h b/include/MantleAPI/Traffic/control_strategy.h index 89e3e25d9c6d5ab98dc56f5f631e84782fe41556..e9b63ce92a43d378a5a1d009db19a1b08b29cf3b 100644 --- a/include/MantleAPI/Traffic/control_strategy.h +++ b/include/MantleAPI/Traffic/control_strategy.h @@ -26,7 +26,7 @@ namespace mantle_api { -enum class MovementDomain +enum class MovementDomain : int { kUndefined = 0, kLateral, @@ -35,7 +35,7 @@ enum class MovementDomain kNone }; -enum class ControlStrategyType +enum class ControlStrategyType : int { kUndefined = 0, kKeepVelocity, @@ -136,7 +136,7 @@ struct FollowLateralOffsetSplineControlStrategy : public ControlStrategy std::vector<mantle_api::SplineSection<units::length::meter>> lateral_offset_splines; }; -enum class Dimension +enum class Dimension : int { kUndefined = 0, kDistance, @@ -144,7 +144,7 @@ enum class Dimension kTime }; -enum class Shape +enum class Shape : int { kUndefined = 0, kStep, @@ -186,7 +186,7 @@ struct TrafficLightStateControlStrategy : public ControlStrategy bool repeat_states{false}; }; -enum class ReferenceContext +enum class ReferenceContext : int { kAbsolute = 0, kRelative diff --git a/include/MantleAPI/Traffic/default_routing_behavior.h b/include/MantleAPI/Traffic/default_routing_behavior.h index fac92b72539d4c71cedb30d9ad43a9ef2a3ad857..37d6645147290828222262a65791dd23c1ad51f5 100644 --- a/include/MantleAPI/Traffic/default_routing_behavior.h +++ b/include/MantleAPI/Traffic/default_routing_behavior.h @@ -11,15 +11,16 @@ #ifndef MANTLEAPI_TRAFFIC_DEFAULT_ROUTING_BEHAVIOR_H #define MANTLEAPI_TRAFFIC_DEFAULT_ROUTING_BEHAVIOR_H -namespace mantle_api { +namespace mantle_api +{ -/// @brief Specifies behavior to end of route -enum class DefaultRoutingBehavior +/// Specify behavior to end of route +enum class DefaultRoutingBehavior : int { - kStop, ///< Do nothing - kRandomRoute ///< Randomly select where to go next + kStop = 0, ///< Do nothing. + kRandomRoute ///< Randomly select where to go next. }; } // namespace mantle_api -#endif // MANTLEAPI_TRAFFIC_DEFAULT_ROUTING_BEHAVIOR_H \ No newline at end of file +#endif // MANTLEAPI_TRAFFIC_DEFAULT_ROUTING_BEHAVIOR_H diff --git a/include/MantleAPI/Traffic/entity_properties.h b/include/MantleAPI/Traffic/entity_properties.h index e40094d6a1aa9f5b56742ca1786ff96dce31c018..70044431eee77f417cef7fa84f53bbd9e4150407 100644 --- a/include/MantleAPI/Traffic/entity_properties.h +++ b/include/MantleAPI/Traffic/entity_properties.h @@ -24,18 +24,16 @@ namespace mantle_api { -enum class EntityType + +/// Specify the type of an entity. +enum class EntityType : int { - // Other (unspecified but known) - kOther = 1, - // Object is a vehicle. - kVehicle = 2, - // Object is a pedestrian. - kPedestrian = 3, - // Object is an animal. - kAnimal = 4, - // Object is static and does not move - kStatic = 5 + kUnknown = 0, ///< The type of entity is unknown. + kOther, ///< The type of entity is known, but unspecified. + kVehicle, ///< Object is a vehicle. + kPedestrian, ///< Object is a pedestrian. + kAnimal, ///< Object is an animal. + kStatic ///< Object is static and does not move. }; /// Basic properties that describe scenario entities. @@ -55,68 +53,45 @@ inline bool operator==(const EntityProperties& lhs, const EntityProperties& rhs) return lhs.bounding_box == rhs.bounding_box && lhs.type == rhs.type && lhs.model == rhs.model; } -enum class VehicleClass +/// Specify the class of a vehicle. +enum class VehicleClass : int { - kOther = 1, // Other (unspecified but known) type of vehicle. - // Vehicle is a small car. - // Definition: Hatchback car with maximum length 4 m. - kSmall_car = 2, - // Vehicle is a compact car. - // Definition: Hatchback car with length between 4 and 4.5 m. - kCompact_car = 3, - // Vehicle is a medium car. - // Definition: Hatchback or sedan with length between 4.5 and 5 m. - kMedium_car = 4, - // Vehicle is a luxury car. - // Definition: Sedan or coupe that is longer then 5 m. - kLuxury_car = 5, - // Vehicle is a delivery van. - // Definition: A delivery van. - kDelivery_van = 6, - // Vehicle is a heavy truck. - kHeavy_truck = 7, - // Vehicle is a truck with semitrailer. - kSemitrailer = 8, - // Vehicle is a trailer (possibly attached to another vehicle). - kTrailer = 9, - // Vehicle is a motorbike or moped. - kMotorbike = 10, - // Vehicle is a bicycle (without motor and specific lights). - kBicycle = 11, - // Vehicle is a bus. - kBus = 12, - // Vehicle is a tram. - kTram = 13, - // Vehicle is a train. - kTrain = 14, - // Vehicle is a wheelchair. - kWheelchair = 15, - // Vehicle type not specified properly. - kInvalid = -1 + kUnknown = 0, ///< The type of vehicle is unknown. + kOther = 1, ///< The type of vehicle is known, but unspecified. + kSmallCar = 2, ///< Vehicle is a small car. Definition: Hatchback car with maximum length 4 m. + kCompactCar = 3, ///< Vehicle is a compact car. Definition: Hatchback car with length between 4 and 4.5 m. + kMediumCar = 4, ///< Vehicle is a medium car. Definition: Hatchback or sedan with length between 4.5 and 5 m. + kLuxuryCar = 5, ///< Vehicle is a luxury car. Definition: Sedan or coupe that is longer then 5 m. + kDeliveryVan = 6, ///< Vehicle is a delivery van. + kHeavyTruck = 7, ///< Vehicle is a heavy truck. + kSemiTrailer = 8, ///< Vehicle is a truck with semi-trailer. + kTrailer = 9, ///< Vehicle is a trailer (possibly attached to another vehicle). + kMotorcycle = 10, ///< Vehicle is a motorcycle or moped. + kBicycle = 11, ///< Vehicle is a bicycle (without motor and specific lights). + kBus = 12, ///< Vehicle is a bus. + kTram = 13, ///< Vehicle is a tram. + kTrain = 14, ///< Vehicle is a train. + kWheelchair = 15, ///< Vehicle is a wheelchair. + kInvalid = -1 ///< Vehicle type is not specified properly. }; -enum class IndicatorState +/// Specify the state of the indicators of a vehicle. +enum class IndicatorState : int { - // Indicator state is unknown (must not be used in ground truth). - kUnknown = 0, - // Other (unspecified but known) state of indicator. - kOther = 1, - // Indicators are off. - kOff = 2, - // Left indicator is on. - kLeft = 3, - // Right indicator is on. - kRight = 4, - // Hazard/warning light, i.e. both indicators, are on. - kWarning = 5 + kUnknown = 0, ///< The state of the indicators is unknown (must not be used in ground truth). + kOther, ///< The state of the indicators is known, but unspecified. + kOff, ///< Indicators are off. + kLeft, ///< Left indicator is on. + kRight, ///< Right indicator is on. + kWarning ///< Hazard/warning light, i.e. both indicators, are on. }; -enum class ExternalControlState +enum class ExternalControlState : int { kOff = 0, - kFull = 1, - kLateralOnly = 2, - kLongitudinalOnly = 3 + kFull, + kLateralOnly, + kLongitudinalOnly }; struct Performance @@ -177,9 +152,9 @@ struct PedestrianProperties : public EntityProperties struct StaticObjectProperties : public EntityProperties { - //Amount to shift position along lane normal. - //It allows static objects like traffic signs to be placed at certain amount above the road. - //It is considered when the position of the entity is set. + // Amount to shift position along lane normal. + // It allows static objects like traffic signs to be placed at certain amount above the road. + // It is considered when the position of the entity is set. units::length::meter_t vertical_offset{0.0}; }; diff --git a/include/MantleAPI/Traffic/traffic_light_properties.h b/include/MantleAPI/Traffic/traffic_light_properties.h index a6c13f7a0c945fdd0bbe12e2470b7968e1d134db..51b4e92347da7ec10f347a23ff61060edb1a7749 100644 --- a/include/MantleAPI/Traffic/traffic_light_properties.h +++ b/include/MantleAPI/Traffic/traffic_light_properties.h @@ -16,42 +16,46 @@ #define MANTLEAPI_TRAFFIC_TRAFFIC_LIGHT_PROPERTIES_H #include <MantleAPI/Common/time_utils.h> + #include <vector> namespace mantle_api { -enum class TrafficLightBulbColor + +/// Specify the color of a traffic light bulb. +enum class TrafficLightBulbColor : int { - kUnknown = 0, - kOther = 1, - kRed = 2, - kYellow = 3, - kGreen = 4, - kBlue = 5, - kWhite = 6 + kUnknown = 0, ///< The color of the traffic light bulb is unknown. + kOther, ///< The color of the traffic light bulb is known, but unspecified. + kRed, ///< The color of the traffic light bulb is red. + kYellow, ///< The color of the traffic light bulb is yellow. + kGreen, ///< The color of the traffic light bulb is green. + kBlue, ///< The color of the traffic light bulb is blue. + kWhite ///< The color of the traffic light bulb is white. }; -enum class TrafficLightBulbMode +/// Specify the mode of a traffic light bulb. +enum class TrafficLightBulbMode : int { - kUnknown = 0, - kOther = 1, - kOff = 2, - kConstant = 3, - kFlashing = 4, - kCounting = 5 + kUnknown = 0, ///< The mode of the traffic light bulb is unknown. + kOther, ///< The mode of the traffic light bulb is known, but unspecified. + kOff, ///< The traffic light bulb is off. + kConstant, ///< The traffic light bulb is constantly glowing. + kFlashing, ///< The traffic light bulb is flashing. + kCounting ///< The traffic light bulb is counting, cf. pedestrian traffic lights in the US. }; struct TrafficLightBulbState { - TrafficLightBulbColor color; - TrafficLightBulbMode mode; + TrafficLightBulbColor color; + TrafficLightBulbMode mode; }; struct TrafficLightPhase { - std::vector<TrafficLightBulbState> bulb_states; - mantle_api::Time start_time{0}; - mantle_api::Time end_time{0}; + std::vector<TrafficLightBulbState> bulb_states; + mantle_api::Time start_time{0}; + mantle_api::Time end_time{0}; }; } // namespace mantle_api