Skip to content
Snippets Groups Projects
Verified Commit 11f44696 authored by Martin Stump's avatar Martin Stump
Browse files

Harmonize and document enums


Signed-off-by: default avatarMartin Stump <martin.stump@mercedes-benz.com>
parent abef2e12
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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,
......
......@@ -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.
......
......@@ -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
......
......@@ -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
......@@ -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};
};
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment