diff --git a/MantleAPI/include/MantleAPI/Traffic/entity_properties.h b/MantleAPI/include/MantleAPI/Traffic/entity_properties.h index 8d9002abd515ee84eb25e023d9bf5f4d2235d092..3e02d0b65fe8ae2d5ce78945716d72ce3a0d4998 100644 --- a/MantleAPI/include/MantleAPI/Traffic/entity_properties.h +++ b/MantleAPI/include/MantleAPI/Traffic/entity_properties.h @@ -20,6 +20,7 @@ #include <MantleAPI/Common/vector.h> #include <string> +#include <map> namespace mantle_api { @@ -43,6 +44,7 @@ struct EntityProperties BoundingBox bounding_box{Vec3d{}, Dimension3d{}}; EntityType type{EntityType::kOther}; std::string model{}; + std::map<std::string, std::string> properties; }; inline bool operator==(const EntityProperties& lhs, const EntityProperties& rhs) noexcept @@ -114,13 +116,52 @@ enum class ExternalControlState kLongitudinalOnly = 3 }; +struct Performance +{ + // in m/s + double max_speed; + // in m/s² + double max_acceleration; + // in m/s² + double max_deceleration; +}; + +inline bool operator==(const Performance& lhs, const Performance& rhs) noexcept +{ + return IsEqual(lhs.max_speed, rhs.max_speed) && + IsEqual(lhs.max_acceleration, rhs.max_acceleration) && + IsEqual(lhs.max_deceleration, rhs.max_deceleration); +} + +struct Axle +{ + // in radian + double max_steering; + // in m + double wheel_diameter; + // in m + double track_width; + // in m + Vec3d bb_center_to_axle_center; +}; + +inline bool operator==(const Axle& lhs, const Axle& rhs) noexcept +{ + return IsEqual(lhs.max_steering, rhs.max_steering) && + IsEqual(lhs.wheel_diameter, rhs.wheel_diameter) && + IsEqual(lhs.track_width, rhs.track_width) && + lhs.bb_center_to_axle_center == rhs.bb_center_to_axle_center; +} + struct VehicleProperties : public EntityProperties { VehicleClass classification{VehicleClass::kOther}; - Vec3d bb_center_to_front{}; - Vec3d bb_center_to_rear{}; - double front_wheel_diameter{0.0}; - double rear_wheel_diameter{0.0}; + + Performance performance; + + Axle front_axle; + Axle rear_axle; + bool is_host{false}; // TODO: remove, once external control for traffic is implemented through controllers bool is_controlled_externally{false}; @@ -129,10 +170,9 @@ struct VehicleProperties : public EntityProperties inline bool operator==(const VehicleProperties& lhs, const VehicleProperties& rhs) noexcept { return lhs.bounding_box == rhs.bounding_box && lhs.type == rhs.type && lhs.model == rhs.model && - lhs.classification == rhs.classification && lhs.bb_center_to_front == rhs.bb_center_to_front && - lhs.bb_center_to_rear == rhs.bb_center_to_rear && - IsEqual(lhs.front_wheel_diameter, rhs.front_wheel_diameter) && - IsEqual(lhs.rear_wheel_diameter, rhs.rear_wheel_diameter) && lhs.is_host == rhs.is_host; + lhs.classification == rhs.classification && lhs.performance == rhs.performance && + lhs.front_axle == rhs.front_axle && lhs.rear_axle == rhs.rear_axle && + lhs.is_host == rhs.is_host; } struct PedestrianProperties : public EntityProperties