|
CARLA
|
The function of this class is to integrate all the various stages of the traffic manager appropriately using messengers. More...
#include <TrafficManagerLocal.h>
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 | 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 | 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 | 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. | |
| std::vector< ActorPtr > | TakeReleasedActors () |
| Vehicles released since the last call; the caller drops them with no TM lock held. | |
| 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. | |
| std::unordered_map< ActorId, std::pair< float, bool > > | large_vehicles |
| size_t | last_frame {0} |
| Last processed frame. | |
| 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 51 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 alsm, buffer_map, collision_frame, collision_stage, control_frame, episode_proxy, large_vehicles, lateral_highway_PID_parameters, lateral_PID_parameters, local_map, localization_frame, localization_stage, longitudinal_highway_PID_parameters, longitudinal_PID_parameters, marked_for_removal, motion_plan_stage, parameters, random_device, registered_vehicles, registered_vehicles_state, server, carla::traffic_manager::Parameters::SetGlobalPercentageSpeedDifference(), SetupLocalMap(), simulation_state, Start(), tl_frame, track_traffic, traffic_light_stage, carla::traffic_manager::TrafficManagerBase::TrafficManagerBase(), vehicle_id_list, vehicle_light_stage, and world.
Referenced by carla::traffic_manager::TrafficManager::CreateTrafficManagerServer().
|
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 514 of file TrafficManagerLocal.cpp.
|
virtual |
Method to get the vehicle's action buffer.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 510 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 557 of file TrafficManagerLocal.cpp.
References episode_proxy.
|
virtual |
Method to get the vehicle's next action.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 506 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 561 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 372 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 347 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 498 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 486 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 354 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 293 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::Parameters::GetSynchronousMode(), parameters, registered_vehicles, run_traffic_manger, Step(), and carla::traffic_manager::AtomicActorSet::TakeReleased().
Referenced by SetSynchronousMode(), and Start().
|
virtual |
Enable/disable automatic lane change on a vehicle.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 429 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetAutoLaneChange().
|
virtual |
Method to set collision detection rules between vehicles.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 421 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 482 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 412 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 433 of file TrafficManagerLocal.cpp.
References 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 425 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 437 of file TrafficManagerLocal.cpp.
References 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 400 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 408 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 392 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 470 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 474 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 494 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 457 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 396 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 404 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetLargeVehicleWideTurn().
|
virtual |
Method to set Open Street Map mode.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 478 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 445 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 441 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 449 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 453 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 388 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 565 of file TrafficManagerLocal.cpp.
References random_device, carla::traffic_manager::RandomGenerator::RandomGenerator(), seed, and world.
|
virtual |
Method to set % to randomly do a left lane change.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 462 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 466 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::SetRandomRightLaneChangePercentage().
|
virtual |
Method to switch traffic manager into synchronous execution.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 523 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::Parameters::GetSynchronousMode(), 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 553 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 417 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, local_map, carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), and world.
Referenced by Reset(), and TrafficManagerLocal().
|
inlinevirtual |
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 285 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(), 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 alsm, carla::traffic_manager::CollisionStage::ClearCycleCache(), collision_frame, collision_stage, control_frame, current_reserved_capacity, carla::client::Timestamp::elapsed_seconds, episode_proxy, carla::client::Timestamp::frame, carla::traffic_manager::Parameters::GetHybridPhysicsMode(), carla::traffic_manager::AtomicActorSet::GetIDList(), carla::traffic_manager::AtomicActorSet::GetState(), carla::traffic_manager::Parameters::GetSynchronousMode(), carla::traffic_manager::constants::WorldInfoRefresh::IsBatchSyncDue(), last_frame, localization_frame, localization_stage, carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), motion_plan_stage, parameters, previous_update_instance, registered_vehicles, registered_vehicles_state, registration_mutex, carla::traffic_manager::MotionPlanStage::SetCycleTimestamp(), carla::traffic_manager::AtomicActorSet::Size(), tl_frame, traffic_light_stage, unwaited_control_batches, carla::traffic_manager::ALSM::Update(), carla::traffic_manager::CollisionStage::Update(), carla::traffic_manager::LocalizationStage::Update(), carla::traffic_manager::MotionPlanStage::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 308 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, last_frame, localization_frame, localization_stage, motion_plan_stage, previous_update_instance, registered_vehicles, registered_vehicles_state, registration_mutex, carla::traffic_manager::CollisionStage::Reset(), carla::traffic_manager::LocalizationStage::Reset(), carla::traffic_manager::MotionPlanStage::Reset(), carla::traffic_manager::SimulationState::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 301 of file TrafficManagerLocal.cpp.
References carla::traffic_manager::Parameters::GetSynchronousMode(), parameters, and Step().
|
inlinevirtual |
Vehicles released since the last call; the caller drops them with no TM lock held.
Reimplemented from carla::traffic_manager::TrafficManagerBase.
Definition at line 157 of file TrafficManagerLocal.h.
References registered_vehicles, and carla::traffic_manager::AtomicActorSet::TakeReleased().
|
virtual |
This method unregisters a vehicle from traffic manager.
Implements carla::traffic_manager::TrafficManagerBase.
Definition at line 380 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 502 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 490 of file TrafficManagerLocal.cpp.
References parameters, and carla::traffic_manager::Parameters::UpdateUploadPath().
|
private |
Definition at line 100 of file TrafficManagerLocal.h.
Referenced by RegisterVehicles(), Step(), TrafficManagerLocal(), and UnregisterVehicles().
|
private |
Structures to hold waypoint buffers for all vehicles.
Definition at line 75 of file TrafficManagerLocal.h.
Referenced by Stop(), and TrafficManagerLocal().
|
private |
Array to hold output data of collision avoidance.
Definition at line 87 of file TrafficManagerLocal.h.
Referenced by Start(), Step(), Stop(), and TrafficManagerLocal().
|
private |
Definition at line 96 of file TrafficManagerLocal.h.
Referenced by Step(), Stop(), and TrafficManagerLocal().
|
private |
Array to hold output data of motion planning.
Definition at line 91 of file TrafficManagerLocal.h.
Referenced by Start(), Step(), Stop(), and TrafficManagerLocal().
|
private |
Variable to keep track of currently reserved array space for frames.
Definition at line 93 of file TrafficManagerLocal.h.
|
private |
CARLA client connection object.
Definition at line 60 of file TrafficManagerLocal.h.
Referenced by GetEpisodeProxy(), Reset(), SetupLocalMap(), Step(), TrafficManagerLocal(), and ~TrafficManagerLocal().
|
private |
Definition at line 66 of file TrafficManagerLocal.h.
Referenced by TrafficManagerLocal().
|
private |
Last processed frame.
Definition at line 108 of file TrafficManagerLocal.h.
|
private |
Definition at line 58 of file TrafficManagerLocal.h.
Referenced by TrafficManagerLocal().
|
private |
Definition at line 57 of file TrafficManagerLocal.h.
Referenced by TrafficManagerLocal().
|
private |
Pointer to local map cache.
Definition at line 73 of file TrafficManagerLocal.h.
Referenced by Release(), SetupLocalMap(), and TrafficManagerLocal().
|
private |
Array to hold output data of localization stage.
Definition at line 85 of file TrafficManagerLocal.h.
Referenced by Start(), Step(), Stop(), and TrafficManagerLocal().
|
private |
Various stages representing core operations of traffic manager.
Definition at line 95 of file TrafficManagerLocal.h.
Referenced by GetActionBuffer(), GetNextAction(), Step(), Stop(), and TrafficManagerLocal().
|
private |
Definition at line 56 of file TrafficManagerLocal.h.
Referenced by TrafficManagerLocal().
|
private |
PID controller parameters.
Definition at line 55 of file TrafficManagerLocal.h.
Referenced by TrafficManagerLocal().
|
private |
Definition at line 116 of file TrafficManagerLocal.h.
Referenced by TrafficManagerLocal().
|
private |
Definition at line 98 of file TrafficManagerLocal.h.
Referenced by Step(), Stop(), and TrafficManagerLocal().
|
private |
Parameterization object.
Definition at line 83 of file TrafficManagerLocal.h.
Referenced by RemoveImportedRoute(), RemoveUploadPath(), Run(), SetAutoLaneChange(), SetCollisionDetection(), SetCustomPath(), SetDesiredSpeed(), SetDistanceToLeadingVehicle(), SetForceLaneChange(), SetGlobalDistanceToLeadingVehicle(), SetGlobalLaneOffset(), SetGlobalLargeVehicleWideTurn(), SetGlobalPercentageSpeedDifference(), SetHybridPhysicsMode(), SetHybridPhysicsRadius(), SetImportedRoute(), SetKeepSlowLanePercentage(), SetLaneOffset(), SetLargeVehicleWideTurn(), SetOSMMode(), SetPercentageIgnoreVehicles(), SetPercentageIgnoreWalkers(), SetPercentageRunningLight(), SetPercentageRunningSign(), SetPercentageSpeedDifference(), SetRandomLeftLaneChangePercentage(), SetRandomRightLaneChangePercentage(), SetSynchronousMode(), SetSynchronousModeTimeOutInMiliSecond(), SetUpdateVehicleLights(), Start(), Step(), SynchronousTick(), TrafficManagerLocal(), UpdateImportedRoute(), and UpdateUploadPath().
|
private |
Time instance used to calculate dt in asynchronous mode.
Definition at line 81 of file TrafficManagerLocal.h.
|
private |
Structure holding random devices per vehicle.
Definition at line 115 of file TrafficManagerLocal.h.
Referenced by SetRandomDeviceSeed(), and TrafficManagerLocal().
|
private |
Set of all actors registered with traffic manager.
Definition at line 64 of file TrafficManagerLocal.h.
Referenced by GetRegisteredVehiclesIDs(), RegisterVehicles(), Run(), Step(), Stop(), TakeReleasedActors(), and TrafficManagerLocal().
|
private |
State counter to track changes in registered actors.
Definition at line 68 of file TrafficManagerLocal.h.
Referenced by Step(), Stop(), and TrafficManagerLocal().
|
private |
Mutex to prevent vehicle registration during frame array re-allocation.
Definition at line 118 of file TrafficManagerLocal.h.
Referenced by RegisterVehicles(), Step(), Stop(), and UnregisterVehicles().
|
private |
Switch to turn on / turn off traffic manager.
Definition at line 104 of file TrafficManagerLocal.h.
|
private |
Randomization seed.
Definition at line 113 of file TrafficManagerLocal.h.
Referenced by SetRandomDeviceSeed().
|
private |
Traffic manager server instance.
Definition at line 102 of file TrafficManagerLocal.h.
Referenced by TrafficManagerLocal(), and ~TrafficManagerLocal().
|
private |
Type containing the current state of all actors involved in the simulation.
Definition at line 79 of file TrafficManagerLocal.h.
Referenced by Stop(), and TrafficManagerLocal().
|
private |
Array to hold output data of traffic light response.
Definition at line 89 of file TrafficManagerLocal.h.
Referenced by Start(), Step(), Stop(), and TrafficManagerLocal().
|
private |
Object for tracking paths of the traffic vehicles.
Definition at line 77 of file TrafficManagerLocal.h.
Referenced by Stop(), and TrafficManagerLocal().
|
private |
Definition at line 97 of file TrafficManagerLocal.h.
Referenced by Step(), Stop(), and TrafficManagerLocal().
|
private |
Starts at the limit so the first batch of an episode is waited for.
Definition at line 110 of file TrafficManagerLocal.h.
|
private |
List of vehicles registered with the traffic manager in current update cycle.
Definition at line 71 of file TrafficManagerLocal.h.
Referenced by Step(), Stop(), and TrafficManagerLocal().
|
private |
Definition at line 99 of file TrafficManagerLocal.h.
Referenced by Step(), Stop(), and TrafficManagerLocal().
|
private |
Single worker thread for sequential execution of sub-components.
Definition at line 106 of file TrafficManagerLocal.h.
Referenced by SetSynchronousMode(), Start(), and Stop().
|
private |
CARLA client and object.
Definition at line 62 of file TrafficManagerLocal.h.
Referenced by Reset(), SetRandomDeviceSeed(), SetupLocalMap(), Step(), and TrafficManagerLocal().