Skip to content
Snippets Groups Projects
Commit ffede64f authored by Christoph Kochendoerfer's avatar Christoph Kochendoerfer
Browse files

Extended VehicleProperties

parent d7e30c2e
No related branches found
No related tags found
2 merge requests!14Trajectories,!13Extended vehicle and entity properties
......@@ -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
......
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