8namespace traffic_manager {
10using namespace constants::VehicleLight;
13 const std::vector<ActorId> &vehicle_id_list,
18 : vehicle_id_list(vehicle_id_list),
19 buffer_map(buffer_map),
20 parameters(parameters),
22 control_frame(control_frame) {}
37 bool brake_lights =
false;
38 bool left_turn_indicator =
false;
39 bool right_turn_indicator =
false;
40 bool position =
false;
41 bool low_beam =
false;
42 bool high_beam =
false;
43 bool fog_lights =
false;
47 if (vls.first == actor_id) {
48 light_states = vls.second;
56 cg::Location front_location = waypoint_buffer.front()->GetLocation();
59 if (waypoint->CheckJunction()) {
60 RoadOption target_ro = waypoint->GetRoadOption();
72 if (
auto* maybe_ctrl = boost::variant2::get_if<carla::rpc::Command::ApplyVehicleControl>(&
control_frame[
cc].command)) {
74 if (ctrl.
actor == actor_id) {
114 if (left_turn_indicator)
119 if (right_turn_indicator)
145 if (new_light_states != light_states)
rpc::WeatherParameters GetWeather() const
Retrieve the weather parameters currently active in the world.
rpc::VehicleLightStateList GetVehiclesLightStates() const
Returns a list of pairs where the firts element is the vehicle ID and the second one is the light sta...
bool GetUpdateVehicleLights(const ActorId &actor_id) const
Method to get if the vehicle lights should be updates automatically
rpc::VehicleLightStateList all_light_states
All vehicle light states
void RemoveActor(const ActorId actor_id) override
rpc::WeatherParameters weather
Current weather parameters
ControlFrame & control_frame
const Parameters & parameters
const BufferMap & buffer_map
VehicleLightStage(const std::vector< ActorId > &vehicle_id_list, const BufferMap &buffer_map, const Parameters ¶meters, const cc::World &world, ControlFrame &control_frame)
const std::vector< ActorId > & vehicle_id_list
void Update(const unsigned long index) override
static const float SUN_ALTITUDE_DEGREES_BEFORE_DAWN
static const float MAX_DISTANCE_LIGHT_CHECK
static const float SUN_ALTITUDE_DEGREES_JUST_BEFORE_SUNSET
static const float FOG_DENSITY_THRESHOLD
static const float SUN_ALTITUDE_DEGREES_JUST_AFTER_DAWN
static const float HEAVY_PRECIPITATION_THRESHOLD
static const float SUN_ALTITUDE_DEGREES_AFTER_SUNSET
std::vector< carla::rpc::Command > ControlFrame
std::deque< std::shared_ptr< SimpleWaypoint > > Buffer
std::shared_ptr< SimpleWaypoint > SimpleWaypointPtr
std::unordered_map< carla::ActorId, Buffer > BufferMap
This file contains definitions of common data structures used in traffic manager.