CARLA
Loading...
Searching...
No Matches
VehicleLightStage.h
Go to the documentation of this file.
1
2#pragma once
3
4#include <limits>
5#include <unordered_set>
6
12
13namespace carla {
14namespace traffic_manager {
15
16/// This class has functionality for turning on/off the vehicle lights
17/// according to the current vehicle state and its surrounding environment.
19private:
20 const std::vector<ActorId> &vehicle_id_list;
25 /// All vehicle light states
27 /// Current weather parameters
29 /// Weather enabled
30 bool is_weather_enabled {false};
31 /// Simulation time of the last refresh of each cached world query.
32 double last_light_states_update {-std::numeric_limits<double>::infinity()};
33 double last_weather_update {-std::numeric_limits<double>::infinity()};
35 /// Vehicles the server left out of the list it last returned.
36 std::unordered_set<ActorId> missing_from_last_refresh;
37
38 void SetCachedLightState(const ActorId actor_id,
39 const rpc::VehicleLightState::flag_type light_state);
40
41public:
42 VehicleLightStage(const std::vector<ActorId> &vehicle_id_list,
43 const BufferMap &buffer_map,
45 const cc::World &world,
47
48 /// Synchronous mode refreshes every step.
49 void UpdateWorldInfo(const double current_time, const bool synchronous_mode);
50
51 void Update(const unsigned long index) override;
52
53 void RemoveActor(const ActorId actor_id) override;
54
55 void Reset() override;
56};
57
58} // namespace traffic_manager
59} // namespace carla
Stage type interface.
Definition Stage.h:12
This class has functionality for turning on/off the vehicle lights according to the current vehicle s...
rpc::VehicleLightStateList all_light_states
All vehicle light states.
void RemoveActor(const ActorId actor_id) override
void SetCachedLightState(const ActorId actor_id, const rpc::VehicleLightState::flag_type light_state)
double last_light_states_update
Simulation time of the last refresh of each cached world query.
rpc::WeatherParameters weather
Current weather parameters.
std::unordered_set< ActorId > missing_from_last_refresh
Vehicles the server left out of the list it last returned.
const std::vector< ActorId > & vehicle_id_list
void UpdateWorldInfo(const double current_time, const bool synchronous_mode)
Synchronous mode refreshes every step.
void Update(const unsigned long index) override
std::vector< std::pair< ActorId, VehicleLightState::flag_type > > VehicleLightStateList
std::unordered_map< carla::ActorId, Buffer > BufferMap
std::vector< carla::rpc::Command > ControlFrame
This file contains definitions of common data structures used in traffic manager.