2023-07-13 15:40:20 +02:00
|
|
|
#include <cmath>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#include "AdConstants.h"
|
|
|
|
#include "AdFunctions.h"
|
2023-07-13 18:59:42 +02:00
|
|
|
|
|
|
|
namespace Ad
|
|
|
|
{
|
|
|
|
namespace Utils
|
|
|
|
{
|
|
|
|
|
|
|
|
constexpr float kph_to_mps(const float kph)
|
|
|
|
{
|
|
|
|
return 0.2778 * kph;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Ad::Utils
|
|
|
|
|
|
|
|
namespace Data
|
|
|
|
{
|
|
|
|
|
|
|
|
Types::Vehicle init_ego_vehicle()
|
|
|
|
{
|
2023-07-14 12:51:19 +02:00
|
|
|
return Types::Vehicle{
|
|
|
|
.id = Constants::EGO_VEHICLE_ID,
|
|
|
|
.lane = Types::Lane::Center,
|
|
|
|
.speed_mps = Utils::kph_to_mps(135),
|
|
|
|
.rel_distance_m = 0,
|
2023-07-13 18:59:42 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Ad::Data
|
|
|
|
|
|
|
|
namespace Visualize
|
|
|
|
{
|
2023-07-14 12:51:19 +02:00
|
|
|
|
2023-07-13 18:59:42 +02:00
|
|
|
void print_vehicle(const Types::Vehicle vehicle)
|
|
|
|
{
|
|
|
|
std::cout << "Vehicle " << vehicle.id << '\n';
|
|
|
|
std::cout << "speed : " << vehicle.speed_mps << " m/s\n";
|
|
|
|
std::cout << "distance : " << vehicle.rel_distance_m << " m\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Ad::Visualize
|
|
|
|
|
|
|
|
} // namespace Ad
|