|
CARLA
|
The function of this class is to integrate all the various stages of the traffic manager appropriately using messengers. More...
#include <TrafficManagerLocal.h>
Inheritance diagram for carla::traffic_manager::TrafficManagerLocal:Public Member Functions | |
| ActionBuffer | GetActionBuffer (const ActorId &actor_id) |
| Method to get the vehicle's action buffer. | |
| carla::client::detail::EpisodeProxy & | GetEpisodeProxy () |
| Get CARLA episode information. | |
| Action | GetNextAction (const ActorId &actor_id) |
| Method to get the vehicle's next action. | |
| std::vector< ActorId > | GetRegisteredVehiclesIDs () |
| Get list of all registered vehicles. | |
| void | RegisterVehicles (const std::vector< ActorPtr > &actor_list) |
| This method registers a vehicle with the traffic manager. | |
| void | Release () |
| To release the traffic manager. | |
| void | RemoveImportedRoute (const ActorId &actor_id, const bool remove_path) |
| Method to remove a route. | |
| void | RemoveUploadPath (const ActorId &actor_id, const bool remove_path) |
| Method to remove a list of points. | |
| void | Reset (uint64_t episode_id) |
| To reset the traffic manager for the episode episode_id. | |
| void | Run () |
| Initiates thread to run the TrafficManager sequentially. | |
| void | SetAutoLaneChange (const ActorPtr &actor, const bool enable) |
| Enable/disable automatic lane change on a vehicle. | |
| void | SetBoundariesRespawnDormantVehicles (const float lower_bound, const float upper_bound) |
| Method to set boundaries to respawn of dormant vehicles. | |
| void | SetCollisionDetection (const ActorPtr &reference_actor, const ActorPtr &other_actor, const bool detect_collision) |
| Method to set collision detection rules between vehicles. | |
| void | SetCustomPath (const ActorPtr &actor, const Path path, const bool empty_buffer) |
| Method to set our own imported path. | |
| void | SetDesiredSpeed (const ActorPtr &actor, const float value) |
| Set a vehicle's exact desired velocity. | |
| void | SetDistanceToLeadingVehicle (const ActorPtr &actor, const float distance) |
| Method to specify how much distance a vehicle should maintain to the leading vehicle. | |
| void | SetForceLaneChange (const ActorPtr &actor, const bool direction) |
| Method to force lane change on a vehicle. | |
| void | SetGlobalDistanceToLeadingVehicle (const float distance) |
| Method to specify how much distance a vehicle should maintain to the Global leading vehicle. | |
| void | SetGlobalLaneOffset (float const offset) |
| Method to set a global lane offset displacement from the center line. | |
| void | SetGlobalLargeVehicleWideTurn (const bool enable) |
| Method to enable/disable the wide-turn manoeuvre globally for large vehicles. | |
| void | SetGlobalPercentageSpeedDifference (float const percentage) |
| Method to set a global % decrease in velocity with respect to the speed limit. | |
| void | SetHybridPhysicsMode (const bool mode_switch) |
| Method to set hybrid physics mode. | |
| void | SetHybridPhysicsRadius (const float radius) |
| Method to set hybrid physics radius. | |
| void | SetImportedRoute (const ActorPtr &actor, const Route route, const bool empty_buffer) |
| Method to set our own imported route. | |
| void | SetKeepSlowLanePercentage (const ActorPtr &actor, const float percentage) |
| Method to set % to keep on the slow lane. | |
| void | SetLaneOffset (const ActorPtr &actor, const float offset) |
| Method to set a lane offset displacement from the center line. | |
| void | SetLargeVehicleWideTurn (const ActorPtr &actor, const bool enable) |
| Method to enable/disable the wide-turn manoeuvre for a single large vehicle. | |
| void | SetMaxBoundaries (const float lower, const float upper) |
| Method to set limits for boundaries when respawning dormant vehicles. | |
| void | SetOSMMode (const bool mode_switch) |
| Method to set Open Street Map mode. | |
| void | SetPercentageIgnoreVehicles (const ActorPtr &actor, const float perc) |
| Method to specify the % chance of ignoring collisions with any vehicle. | |
| void | SetPercentageIgnoreWalkers (const ActorPtr &actor, const float perc) |
| Method to specify the % chance of ignoring collisions with any walker. | |
| void | SetPercentageRunningLight (const ActorPtr &actor, const float perc) |
| Method to specify the % chance of running any traffic light. | |
| void | SetPercentageRunningSign (const ActorPtr &actor, const float perc) |
| Method to specify the % chance of running any traffic sign. | |
| void | SetPercentageSpeedDifference (const ActorPtr &actor, const float percentage) |
| Method to set a vehicle's % decrease in velocity with respect to the speed limit. | |
| void | SetRandomDeviceSeed (const uint64_t _seed) |
| Method to set randomization seed. | |
| void | SetRandomLeftLaneChangePercentage (const ActorPtr &actor, const float percentage) |
| Method to set % to randomly do a left lane change. | |
| void | SetRandomRightLaneChangePercentage (const ActorPtr &actor, const float percentage) |
| Method to set % to randomly do a right lane change. | |
| void | SetRespawnDormantVehicles (const bool mode_switch) |
| Method to set automatic respawn of dormant vehicles. | |
| void | SetSynchronousMode (bool mode) |
| Method to switch traffic manager into synchronous execution. | |
| void | SetSynchronousModeTimeOutInMiliSecond (double time) |
| Method to set Tick timeout for synchronous execution. | |
| void | SetUpdateVehicleLights (const ActorPtr &actor, const bool do_update) |
| Method to set the automatic management of the vehicle lights. | |
| void | SetupLocalMap () |
| Method to setup InMemoryMap. | |
| void | ShutDown () |
| void | Start () |
| To start the TrafficManager. | |
| void | Step () |
| To do one step of the TrafficManager. | |
| void | Stop () |
| To stop the TrafficManager. | |
| bool | SynchronousTick () |
| Method to provide synchronous tick. | |
| TrafficManagerLocal (std::vector< float > longitudinal_PID_parameters, std::vector< float > longitudinal_highway_PID_parameters, std::vector< float > lateral_PID_parameters, std::vector< float > lateral_highway_PID_parameters, float perc_decrease_from_limit, cc::detail::EpisodeProxy &episode_proxy, uint16_t &RPCportTM) | |
| Private constructor for singleton lifecycle management. | |
| void | UnregisterVehicles (const std::vector< ActorPtr > &actor_list) |
| This method unregisters a vehicle from traffic manager. | |
| void | UpdateImportedRoute (const ActorId &actor_id, const Route route) |
| Method to update an already set route. | |
| void | UpdateUploadPath (const ActorId &actor_id, const Path path) |
| Method to update an already set list of points. | |
| virtual | ~TrafficManagerLocal () |
| Destructor. | |
Public Member Functions inherited from carla::traffic_manager::TrafficManagerBase | |
| TrafficManagerBase () | |
| Protected constructor for singleton lifecycle management. | |
| virtual | ~TrafficManagerBase () |
| Destructor. | |
Private Member Functions | |
| bool | CheckAllFrozen (TLGroup tl_to_freeze) |
| Method to check if all traffic lights are frozen in a group. | |
Private Attributes | |
| ALSM | alsm |
| BufferMap | buffer_map |
| Structures to hold waypoint buffers for all vehicles. | |
| CollisionFrame | collision_frame |
| Array to hold output data of collision avoidance. | |
| CollisionStage | collision_stage |
| ControlFrame | control_frame |
| Array to hold output data of motion planning. | |
| uint64_t | current_reserved_capacity {0u} |
| Variable to keep track of currently reserved array space for frames. | |
| carla::client::detail::EpisodeProxy | episode_proxy |
| CARLA client connection object. | |
| rpc::EpisodeSettings | episode_settings |
| Cached episode settings; they only change through world.apply_settings. | |
| std::unordered_map< ActorId, std::pair< float, bool > > | large_vehicles |
| size_t | last_frame {0} |
| Last processed frame. | |
| double | last_settings_update {-std::numeric_limits<double>::infinity()} |
| Simulation time of the last episode settings refresh. | |
| std::vector< float > | lateral_highway_PID_parameters |
| std::vector< float > | lateral_PID_parameters |
| LocalMapPtr | local_map |
| Pointer to local map cache. | |
| LocalizationFrame | localization_frame |
| Array to hold output data of localization stage. | |
| LocalizationStage | localization_stage |
| Various stages representing core operations of traffic manager. | |
| std::vector< float > | longitudinal_highway_PID_parameters |
| std::vector< float > | longitudinal_PID_parameters |
| PID controller parameters. | |
| std::vector< ActorId > | marked_for_removal |
| MotionPlanStage | motion_plan_stage |
| Parameters | parameters |
| Parameterization object. | |
| TimePoint | previous_update_instance |
| Time instance used to calculate dt in asynchronous mode. | |
| RandomGenerator | random_device = RandomGenerator(seed) |
| Structure holding random devices per vehicle. | |
| AtomicActorSet | registered_vehicles |
| Set of all actors registered with traffic manager. | |
| int | registered_vehicles_state |
| State counter to track changes in registered actors. | |
| std::mutex | registration_mutex |
| Mutex to prevent vehicle registration during frame array re-allocation. | |
| std::atomic< bool > | run_traffic_manger {true} |
| Switch to turn on / turn off traffic manager. | |
| uint64_t | seed {static_cast<uint64_t>(time(NULL))} |
| Randomization seed. | |
| TrafficManagerServer | server |
| Traffic manager server instance. | |
| SimulationState | simulation_state |
| Type containing the current state of all actors involved in the simulation. | |
| TLFrame | tl_frame |
| Array to hold output data of traffic light response. | |
| TrackTraffic | track_traffic |
| Object for tracking paths of the traffic vehicles. | |
| TrafficLightStage | traffic_light_stage |
| uint64_t | unwaited_control_batches |
| Starts at the limit so the first batch of an episode is waited for. | |
| std::vector< ActorId > | vehicle_id_list |
| List of vehicles registered with the traffic manager in current update cycle. | |
| VehicleLightStage | vehicle_light_stage |
| std::unique_ptr< std::thread > | worker_thread |
| Single worker thread for sequential execution of sub-components. | |
| cc::World | world |
| CARLA client and object. | |
The function of this class is to integrate all the various stages of the traffic manager appropriately using messengers.
Definition at line 52 of file TrafficManagerLocal.h.
| carla::traffic_manager::TrafficManagerLocal::TrafficManagerLocal | ( | std::vector< float > | longitudinal_PID_parameters, |
| std::vector< float > | longitudinal_highway_PID_parameters, | ||
| std::vector< float > | lateral_PID_parameters, | ||
| std::vector< float > | lateral_highway_PID_parameters, | ||
| float | perc_decrease_from_limit, | ||
| cc::detail::EpisodeProxy & | episode_proxy, | ||
| uint16_t & | RPCportTM | ||
| ) |
Private constructor for singleton lifecycle management.
Definition at line 21 of file TrafficManagerLocal.cpp.
References parameters, registered_vehicles_state, carla::traffic_manager::Parameters::SetGlobalPercentageSpeedDifference(), SetupLocalMap(), and Start().
|
virtual |
Destructor.
Definition at line 114 of file TrafficManagerLocal.cpp.
References episode_proxy, carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), carla::traffic_manager::TrafficManagerServer::port(), Release(), and server.
|
private |
Method to check if all traffic lights are frozen in a group.
Definition at line 533 of file TrafficManagerLocal.cpp.
|
virtual |
Method to get the vehicle's action buffer.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 529 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::LocalizationStage::ComputeActionBuffer(), and localization_stage.
|
virtual |
Get CARLA episode information.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 576 of file TrafficManagerLocal.cpp.
References episode_proxy.
|
virtual |
Method to get the vehicle's next action.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 525 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::LocalizationStage::ComputeNextAction(), and localization_stage.
| std::vector< ActorId > carla::traffic_manager::TrafficManagerLocal::GetRegisteredVehiclesIDs | ( | ) |
Get list of all registered vehicles.
Definition at line 580 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::AtomicActorSet::GetIDList(), and registered_vehicles.
|
virtual |
This method registers a vehicle with the traffic manager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 379 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::ALSM::AddActor(), alsm, carla::traffic_manager::AtomicActorSet::Insert(), registered_vehicles, and registration_mutex.
|
virtual |
To release the traffic manager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 354 of file TrafficManagerLocal.cpp.
References local_map, and Stop().
Referenced by Reset(), and ~TrafficManagerLocal().
|
virtual |
Method to remove a route.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 505 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::RemoveImportedRoute().
|
virtual |
Method to remove a list of points.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 493 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::RemoveUploadPath().
|
virtual |
To reset the traffic manager for the episode episode_id.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 361 of file TrafficManagerLocal.cpp.
References episode_proxy, carla::client::detail::EpisodeProxyImpl< PointerT >::GetId(), carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), Release(), SetupLocalMap(), Start(), and world.
| void carla::traffic_manager::TrafficManagerLocal::Run | ( | ) |
Initiates thread to run the TrafficManager sequentially.
Definition at line 300 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::Parameters::GetSynchronousMode(), parameters, run_traffic_manger, and Step().
Referenced by SetSynchronousMode(), and Start().
|
virtual |
Enable/disable automatic lane change on a vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 436 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetAutoLaneChange().
|
virtual |
Method to set boundaries to respawn of dormant vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 517 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetBoundariesRespawnDormantVehicles().
|
virtual |
Method to set collision detection rules between vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 428 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetCollisionDetection().
|
virtual |
Method to set our own imported path.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 489 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetCustomPath().
|
virtual |
Set a vehicle's exact desired velocity.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 419 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetDesiredSpeed().
|
virtual |
Method to specify how much distance a vehicle should maintain to the leading vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 440 of file TrafficManagerLocal.cpp.
References distance, parameters, and carla::traffic_manager::Parameters::SetDistanceToLeadingVehicle().
|
virtual |
Method to force lane change on a vehicle.
Direction flag can be set to true for left and false for right.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 432 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetForceLaneChange().
|
virtual |
Method to specify how much distance a vehicle should maintain to the Global leading vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 444 of file TrafficManagerLocal.cpp.
References distance, parameters, and carla::traffic_manager::Parameters::SetGlobalDistanceToLeadingVehicle().
|
virtual |
Method to set a global lane offset displacement from the center line.
Positive values imply a right offset while negative ones mean a left one.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 407 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetGlobalLaneOffset().
|
virtual |
Method to enable/disable the wide-turn manoeuvre globally for large vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 415 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetGlobalLargeVehicleWideTurn().
|
virtual |
Method to set a global % decrease in velocity with respect to the speed limit.
If less than 0, it's a % increase.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 399 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetGlobalPercentageSpeedDifference().
|
virtual |
Method to set hybrid physics mode.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 477 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetHybridPhysicsMode().
|
virtual |
Method to set hybrid physics radius.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 481 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetHybridPhysicsRadius().
|
virtual |
Method to set our own imported route.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 501 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetImportedRoute().
|
virtual |
Method to set % to keep on the slow lane.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 464 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetKeepSlowLanePercentage().
|
virtual |
Method to set a lane offset displacement from the center line.
Positive values imply a right offset while negative ones mean a left one.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 403 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetLaneOffset().
|
virtual |
Method to enable/disable the wide-turn manoeuvre for a single large vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 411 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetLargeVehicleWideTurn().
|
virtual |
Method to set limits for boundaries when respawning dormant vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 521 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetMaxBoundaries().
|
virtual |
Method to set Open Street Map mode.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 485 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetOSMMode().
|
virtual |
Method to specify the % chance of ignoring collisions with any vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 452 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetPercentageIgnoreVehicles().
|
virtual |
Method to specify the % chance of ignoring collisions with any walker.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 448 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetPercentageIgnoreWalkers().
|
virtual |
Method to specify the % chance of running any traffic light.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 456 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetPercentageRunningLight().
|
virtual |
Method to specify the % chance of running any traffic sign.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 460 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetPercentageRunningSign().
|
virtual |
Method to set a vehicle's % decrease in velocity with respect to the speed limit.
If less than 0, it's a % increase.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 395 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetPercentageSpeedDifference().
|
virtual |
Method to set randomization seed.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 584 of file TrafficManagerLocal.cpp.
References random_device, carla::client::World::ResetAllTrafficLights(), seed, and world.
|
virtual |
Method to set % to randomly do a left lane change.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 469 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetRandomLeftLaneChangePercentage().
|
virtual |
Method to set % to randomly do a right lane change.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 473 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetRandomRightLaneChangePercentage().
|
virtual |
Method to set automatic respawn of dormant vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 513 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetRespawnDormantVehicles().
|
virtual |
Method to switch traffic manager into synchronous execution.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 542 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::Parameters::GetSynchronousMode(), carla::log_error(), parameters, Run(), carla::traffic_manager::Parameters::SetSynchronousMode(), and worker_thread.
|
virtual |
Method to set Tick timeout for synchronous execution.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 572 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetSynchronousModeTimeOutInMiliSecond().
|
virtual |
Method to set the automatic management of the vehicle lights.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 424 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetUpdateVehicleLights().
| void carla::traffic_manager::TrafficManagerLocal::SetupLocalMap | ( | ) |
Method to setup InMemoryMap.
Definition at line 119 of file TrafficManagerLocal.cpp.
References episode_proxy, carla::client::World::GetMap(), local_map, carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), carla::log_warning(), and world.
Referenced by Reset(), and TrafficManagerLocal().
|
inlinevirtual |
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 295 of file TrafficManagerLocal.h.
|
virtual |
To start the TrafficManager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 151 of file TrafficManagerLocal.cpp.
References collision_frame, control_frame, current_reserved_capacity, carla::traffic_manager::Parameters::GetSynchronousMode(), carla::traffic_manager::constants::FrameMemory::INITIAL_SIZE, localization_frame, parameters, Run(), run_traffic_manger, tl_frame, and worker_thread.
Referenced by Reset(), and TrafficManagerLocal().
| void carla::traffic_manager::TrafficManagerLocal::Step | ( | ) |
To do one step of the TrafficManager.
Definition at line 166 of file TrafficManagerLocal.cpp.
References carla::rpc::EpisodeSettings::actor_active_distance, alsm, carla::traffic_manager::CollisionStage::ClearCycleCache(), collision_frame, collision_stage, control_frame, current_reserved_capacity, carla::client::Timestamp::elapsed_seconds, episode_proxy, episode_settings, carla::traffic_manager::constants::WorldInfoRefresh::EPISODE_SETTINGS_REFRESH_PERIOD, carla::client::Timestamp::frame, carla::traffic_manager::Parameters::GetHybridPhysicsMode(), carla::traffic_manager::AtomicActorSet::GetIDList(), carla::client::World::GetSnapshot(), carla::traffic_manager::AtomicActorSet::GetState(), carla::traffic_manager::Parameters::GetSynchronousMode(), carla::client::WorldSnapshot::GetTimestamp(), carla::traffic_manager::constants::FrameMemory::GROWTH_STEP_SIZE, carla::traffic_manager::constants::FrameMemory::INITIAL_SIZE, carla::traffic_manager::constants::FrameMemory::INV_GROWTH_STEP_SIZE, carla::traffic_manager::constants::WorldInfoRefresh::IsBatchSyncDue(), carla::traffic_manager::constants::WorldInfoRefresh::IsRefreshDue(), last_frame, last_settings_update, localization_frame, localization_stage, carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), carla::traffic_manager::constants::WorldInfoRefresh::MAX_UNWAITED_CONTROL_BATCHES, motion_plan_stage, parameters, previous_update_instance, registered_vehicles, registered_vehicles_state, registration_mutex, carla::traffic_manager::MotionPlanStage::SetCycleTimestamp(), carla::traffic_manager::Parameters::SetMaxBoundaries(), carla::traffic_manager::AtomicActorSet::Size(), carla::traffic_manager::constants::WorldInfoRefresh::SNAPSHOT_POLL_PERIOD, tl_frame, traffic_light_stage, unwaited_control_batches, carla::traffic_manager::ALSM::Update(), carla::traffic_manager::MotionPlanStage::Update(), carla::traffic_manager::CollisionStage::Update(), carla::traffic_manager::LocalizationStage::Update(), carla::traffic_manager::TrafficLightStage::Update(), carla::traffic_manager::VehicleLightStage::Update(), carla::traffic_manager::VehicleLightStage::UpdateWorldInfo(), vehicle_id_list, vehicle_light_stage, and world.
Referenced by Run(), and SynchronousTick().
|
virtual |
To stop the TrafficManager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 313 of file TrafficManagerLocal.cpp.
References buffer_map, carla::traffic_manager::AtomicActorSet::Clear(), carla::traffic_manager::TrackTraffic::Clear(), collision_frame, collision_stage, control_frame, current_reserved_capacity, episode_settings, last_frame, last_settings_update, localization_frame, localization_stage, carla::traffic_manager::constants::WorldInfoRefresh::MAX_UNWAITED_CONTROL_BATCHES, motion_plan_stage, previous_update_instance, registered_vehicles, registered_vehicles_state, registration_mutex, carla::traffic_manager::MotionPlanStage::Reset(), carla::traffic_manager::SimulationState::Reset(), carla::traffic_manager::CollisionStage::Reset(), carla::traffic_manager::LocalizationStage::Reset(), carla::traffic_manager::TrafficLightStage::Reset(), carla::traffic_manager::VehicleLightStage::Reset(), run_traffic_manger, simulation_state, tl_frame, track_traffic, traffic_light_stage, unwaited_control_batches, vehicle_id_list, vehicle_light_stage, and worker_thread.
Referenced by Release().
|
virtual |
Method to provide synchronous tick.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 306 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::Parameters::GetSynchronousMode(), parameters, and Step().
|
virtual |
This method unregisters a vehicle from traffic manager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 387 of file TrafficManagerLocal.cpp.
References alsm, registration_mutex, and carla::traffic_manager::ALSM::RemoveActor().
|
virtual |
Method to update an already set route.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 509 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::UpdateImportedRoute().
|
virtual |
Method to update an already set list of points.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 497 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::UpdateUploadPath().
|
private |
Definition at line 101 of file TrafficManagerLocal.h.
Referenced by RegisterVehicles(), Step(), and UnregisterVehicles().
|
private |
Structures to hold waypoint buffers for all vehicles.
Definition at line 76 of file TrafficManagerLocal.h.
Referenced by Stop().
|
private |
Array to hold output data of collision avoidance.
Definition at line 88 of file TrafficManagerLocal.h.
|
private |
Definition at line 97 of file TrafficManagerLocal.h.
|
private |
Array to hold output data of motion planning.
Definition at line 92 of file TrafficManagerLocal.h.
|
private |
Variable to keep track of currently reserved array space for frames.
Definition at line 94 of file TrafficManagerLocal.h.
|
private |
CARLA client connection object.
Definition at line 61 of file TrafficManagerLocal.h.
Referenced by GetEpisodeProxy(), Reset(), SetupLocalMap(), Step(), and ~TrafficManagerLocal().
|
private |
Cached episode settings; they only change through world.apply_settings.
Definition at line 111 of file TrafficManagerLocal.h.
|
private |
Definition at line 67 of file TrafficManagerLocal.h.
|
private |
Last processed frame.
Definition at line 109 of file TrafficManagerLocal.h.
|
private |
Simulation time of the last episode settings refresh.
Definition at line 113 of file TrafficManagerLocal.h.
|
private |
Definition at line 59 of file TrafficManagerLocal.h.
|
private |
Definition at line 58 of file TrafficManagerLocal.h.
|
private |
Pointer to local map cache.
Definition at line 74 of file TrafficManagerLocal.h.
Referenced by Release(), and SetupLocalMap().
|
private |
Array to hold output data of localization stage.
Definition at line 86 of file TrafficManagerLocal.h.
|
private |
Various stages representing core operations of traffic manager.
Definition at line 96 of file TrafficManagerLocal.h.
Referenced by GetActionBuffer(), GetNextAction(), Step(), and Stop().
|
private |
Definition at line 57 of file TrafficManagerLocal.h.
|
private |
PID controller parameters.
Definition at line 56 of file TrafficManagerLocal.h.
|
private |
Definition at line 121 of file TrafficManagerLocal.h.
|
private |
Definition at line 99 of file TrafficManagerLocal.h.
|
private |
Parameterization object.
Definition at line 84 of file TrafficManagerLocal.h.
Referenced by RemoveImportedRoute(), RemoveUploadPath(), Run(), SetAutoLaneChange(), SetBoundariesRespawnDormantVehicles(), SetCollisionDetection(), SetCustomPath(), SetDesiredSpeed(), SetDistanceToLeadingVehicle(), SetForceLaneChange(), SetGlobalDistanceToLeadingVehicle(), SetGlobalLaneOffset(), SetGlobalLargeVehicleWideTurn(), SetGlobalPercentageSpeedDifference(), SetHybridPhysicsMode(), SetHybridPhysicsRadius(), SetImportedRoute(), SetKeepSlowLanePercentage(), SetLaneOffset(), SetLargeVehicleWideTurn(), SetMaxBoundaries(), SetOSMMode(), SetPercentageIgnoreVehicles(), SetPercentageIgnoreWalkers(), SetPercentageRunningLight(), SetPercentageRunningSign(), SetPercentageSpeedDifference(), SetRandomLeftLaneChangePercentage(), SetRandomRightLaneChangePercentage(), SetRespawnDormantVehicles(), SetSynchronousMode(), SetSynchronousModeTimeOutInMiliSecond(), SetUpdateVehicleLights(), Start(), Step(), SynchronousTick(), TrafficManagerLocal(), UpdateImportedRoute(), and UpdateUploadPath().
|
private |
Time instance used to calculate dt in asynchronous mode.
Definition at line 82 of file TrafficManagerLocal.h.
|
private |
Structure holding random devices per vehicle.
Definition at line 120 of file TrafficManagerLocal.h.
Referenced by SetRandomDeviceSeed().
|
private |
Set of all actors registered with traffic manager.
Definition at line 65 of file TrafficManagerLocal.h.
Referenced by GetRegisteredVehiclesIDs(), RegisterVehicles(), Step(), and Stop().
|
private |
State counter to track changes in registered actors.
Definition at line 69 of file TrafficManagerLocal.h.
Referenced by Step(), Stop(), and TrafficManagerLocal().
|
private |
Mutex to prevent vehicle registration during frame array re-allocation.
Definition at line 123 of file TrafficManagerLocal.h.
Referenced by RegisterVehicles(), Step(), Stop(), and UnregisterVehicles().
|
private |
Switch to turn on / turn off traffic manager.
Definition at line 105 of file TrafficManagerLocal.h.
|
private |
Randomization seed.
Definition at line 118 of file TrafficManagerLocal.h.
Referenced by SetRandomDeviceSeed().
|
private |
Traffic manager server instance.
Definition at line 103 of file TrafficManagerLocal.h.
Referenced by ~TrafficManagerLocal().
|
private |
Type containing the current state of all actors involved in the simulation.
Definition at line 80 of file TrafficManagerLocal.h.
Referenced by Stop().
|
private |
Array to hold output data of traffic light response.
Definition at line 90 of file TrafficManagerLocal.h.
|
private |
Object for tracking paths of the traffic vehicles.
Definition at line 78 of file TrafficManagerLocal.h.
Referenced by Stop().
|
private |
Definition at line 98 of file TrafficManagerLocal.h.
|
private |
Starts at the limit so the first batch of an episode is waited for.
Definition at line 115 of file TrafficManagerLocal.h.
|
private |
List of vehicles registered with the traffic manager in current update cycle.
Definition at line 72 of file TrafficManagerLocal.h.
|
private |
Definition at line 100 of file TrafficManagerLocal.h.
|
private |
Single worker thread for sequential execution of sub-components.
Definition at line 107 of file TrafficManagerLocal.h.
Referenced by SetSynchronousMode(), Start(), and Stop().
|
private |
CARLA client and object.
Definition at line 63 of file TrafficManagerLocal.h.
Referenced by Reset(), SetRandomDeviceSeed(), SetupLocalMap(), and Step().