CARLA
Loading...
Searching...
No Matches
carla::traffic_manager::TrafficManagerLocal Class Reference

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 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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ TrafficManagerLocal()

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 )

◆ ~TrafficManagerLocal()

carla::traffic_manager::TrafficManagerLocal::~TrafficManagerLocal ( )
virtual

Member Function Documentation

◆ CheckAllFrozen()

bool carla::traffic_manager::TrafficManagerLocal::CheckAllFrozen ( TLGroup tl_to_freeze)
private

Method to check if all traffic lights are frozen in a group.

Definition at line 514 of file TrafficManagerLocal.cpp.

◆ GetActionBuffer()

ActionBuffer carla::traffic_manager::TrafficManagerLocal::GetActionBuffer ( const ActorId & actor_id)
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.

◆ GetEpisodeProxy()

carla::client::detail::EpisodeProxy & carla::traffic_manager::TrafficManagerLocal::GetEpisodeProxy ( )
virtual

Get CARLA episode information.

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 557 of file TrafficManagerLocal.cpp.

References episode_proxy.

◆ GetNextAction()

Action carla::traffic_manager::TrafficManagerLocal::GetNextAction ( const ActorId & actor_id)
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.

◆ GetRegisteredVehiclesIDs()

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.

◆ RegisterVehicles()

void carla::traffic_manager::TrafficManagerLocal::RegisterVehicles ( const std::vector< ActorPtr > & actor_list)
virtual

◆ Release()

void carla::traffic_manager::TrafficManagerLocal::Release ( )
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().

◆ RemoveImportedRoute()

void carla::traffic_manager::TrafficManagerLocal::RemoveImportedRoute ( const ActorId & actor_id,
const bool remove_path )
virtual

◆ RemoveUploadPath()

void carla::traffic_manager::TrafficManagerLocal::RemoveUploadPath ( const ActorId & actor_id,
const bool remove_path )
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().

◆ Reset()

void carla::traffic_manager::TrafficManagerLocal::Reset ( uint64_t episode_id)
virtual

◆ Run()

void carla::traffic_manager::TrafficManagerLocal::Run ( )

◆ SetAutoLaneChange()

void carla::traffic_manager::TrafficManagerLocal::SetAutoLaneChange ( const ActorPtr & actor,
const bool enable )
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().

◆ SetCollisionDetection()

void carla::traffic_manager::TrafficManagerLocal::SetCollisionDetection ( const ActorPtr & reference_actor,
const ActorPtr & other_actor,
const bool detect_collision )
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().

◆ SetCustomPath()

void carla::traffic_manager::TrafficManagerLocal::SetCustomPath ( const ActorPtr & actor,
const Path path,
const bool empty_buffer )
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().

◆ SetDesiredSpeed()

void carla::traffic_manager::TrafficManagerLocal::SetDesiredSpeed ( const ActorPtr & actor,
const float value )
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().

◆ SetDistanceToLeadingVehicle()

void carla::traffic_manager::TrafficManagerLocal::SetDistanceToLeadingVehicle ( const ActorPtr & actor,
const float distance )
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().

◆ SetForceLaneChange()

void carla::traffic_manager::TrafficManagerLocal::SetForceLaneChange ( const ActorPtr & actor,
const bool direction )
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().

◆ SetGlobalDistanceToLeadingVehicle()

void carla::traffic_manager::TrafficManagerLocal::SetGlobalDistanceToLeadingVehicle ( const float distance)
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().

◆ SetGlobalLaneOffset()

void carla::traffic_manager::TrafficManagerLocal::SetGlobalLaneOffset ( float const offset)
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().

◆ SetGlobalLargeVehicleWideTurn()

void carla::traffic_manager::TrafficManagerLocal::SetGlobalLargeVehicleWideTurn ( const bool enable)
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().

◆ SetGlobalPercentageSpeedDifference()

void carla::traffic_manager::TrafficManagerLocal::SetGlobalPercentageSpeedDifference ( float const percentage)
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().

◆ SetHybridPhysicsMode()

void carla::traffic_manager::TrafficManagerLocal::SetHybridPhysicsMode ( const bool mode_switch)
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().

◆ SetHybridPhysicsRadius()

void carla::traffic_manager::TrafficManagerLocal::SetHybridPhysicsRadius ( const float radius)
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().

◆ SetImportedRoute()

void carla::traffic_manager::TrafficManagerLocal::SetImportedRoute ( const ActorPtr & actor,
const Route route,
const bool empty_buffer )
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().

◆ SetKeepSlowLanePercentage()

void carla::traffic_manager::TrafficManagerLocal::SetKeepSlowLanePercentage ( const ActorPtr & actor,
const float percentage )
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().

◆ SetLaneOffset()

void carla::traffic_manager::TrafficManagerLocal::SetLaneOffset ( const ActorPtr & actor,
const float offset )
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().

◆ SetLargeVehicleWideTurn()

void carla::traffic_manager::TrafficManagerLocal::SetLargeVehicleWideTurn ( const ActorPtr & actor,
const bool enable )
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().

◆ SetOSMMode()

void carla::traffic_manager::TrafficManagerLocal::SetOSMMode ( const bool mode_switch)
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().

◆ SetPercentageIgnoreVehicles()

void carla::traffic_manager::TrafficManagerLocal::SetPercentageIgnoreVehicles ( const ActorPtr & actor,
const float perc )
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().

◆ SetPercentageIgnoreWalkers()

void carla::traffic_manager::TrafficManagerLocal::SetPercentageIgnoreWalkers ( const ActorPtr & actor,
const float perc )
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().

◆ SetPercentageRunningLight()

void carla::traffic_manager::TrafficManagerLocal::SetPercentageRunningLight ( const ActorPtr & actor,
const float perc )
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().

◆ SetPercentageRunningSign()

void carla::traffic_manager::TrafficManagerLocal::SetPercentageRunningSign ( const ActorPtr & actor,
const float perc )
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().

◆ SetPercentageSpeedDifference()

void carla::traffic_manager::TrafficManagerLocal::SetPercentageSpeedDifference ( const ActorPtr & actor,
const float percentage )
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().

◆ SetRandomDeviceSeed()

void carla::traffic_manager::TrafficManagerLocal::SetRandomDeviceSeed ( const uint64_t _seed)
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.

◆ SetRandomLeftLaneChangePercentage()

void carla::traffic_manager::TrafficManagerLocal::SetRandomLeftLaneChangePercentage ( const ActorPtr & actor,
const float percentage )
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().

◆ SetRandomRightLaneChangePercentage()

void carla::traffic_manager::TrafficManagerLocal::SetRandomRightLaneChangePercentage ( const ActorPtr & actor,
const float percentage )
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().

◆ SetSynchronousMode()

void carla::traffic_manager::TrafficManagerLocal::SetSynchronousMode ( bool mode)
virtual

◆ SetSynchronousModeTimeOutInMiliSecond()

void carla::traffic_manager::TrafficManagerLocal::SetSynchronousModeTimeOutInMiliSecond ( double time)
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().

◆ SetUpdateVehicleLights()

void carla::traffic_manager::TrafficManagerLocal::SetUpdateVehicleLights ( const ActorPtr & actor,
const bool do_update )
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().

◆ SetupLocalMap()

void carla::traffic_manager::TrafficManagerLocal::SetupLocalMap ( )

◆ ShutDown()

void carla::traffic_manager::TrafficManagerLocal::ShutDown ( )
inlinevirtual

Implements carla::traffic_manager::TrafficManagerBase.

Definition at line 285 of file TrafficManagerLocal.h.

◆ Start()

◆ Step()

void carla::traffic_manager::TrafficManagerLocal::Step ( )

◆ Stop()

◆ SynchronousTick()

bool carla::traffic_manager::TrafficManagerLocal::SynchronousTick ( )
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().

◆ TakeReleasedActors()

std::vector< ActorPtr > carla::traffic_manager::TrafficManagerLocal::TakeReleasedActors ( )
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().

◆ UnregisterVehicles()

void carla::traffic_manager::TrafficManagerLocal::UnregisterVehicles ( const std::vector< ActorPtr > & actor_list)
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().

◆ UpdateImportedRoute()

void carla::traffic_manager::TrafficManagerLocal::UpdateImportedRoute ( const ActorId & actor_id,
const Route route )
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().

◆ UpdateUploadPath()

void carla::traffic_manager::TrafficManagerLocal::UpdateUploadPath ( const ActorId & actor_id,
const Path path )
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().

Member Data Documentation

◆ alsm

ALSM carla::traffic_manager::TrafficManagerLocal::alsm
private

◆ buffer_map

BufferMap carla::traffic_manager::TrafficManagerLocal::buffer_map
private

Structures to hold waypoint buffers for all vehicles.

Definition at line 75 of file TrafficManagerLocal.h.

Referenced by Stop(), and TrafficManagerLocal().

◆ collision_frame

CollisionFrame carla::traffic_manager::TrafficManagerLocal::collision_frame
private

Array to hold output data of collision avoidance.

Definition at line 87 of file TrafficManagerLocal.h.

Referenced by Start(), Step(), Stop(), and TrafficManagerLocal().

◆ collision_stage

CollisionStage carla::traffic_manager::TrafficManagerLocal::collision_stage
private

Definition at line 96 of file TrafficManagerLocal.h.

Referenced by Step(), Stop(), and TrafficManagerLocal().

◆ control_frame

ControlFrame carla::traffic_manager::TrafficManagerLocal::control_frame
private

Array to hold output data of motion planning.

Definition at line 91 of file TrafficManagerLocal.h.

Referenced by Start(), Step(), Stop(), and TrafficManagerLocal().

◆ current_reserved_capacity

uint64_t carla::traffic_manager::TrafficManagerLocal::current_reserved_capacity {0u}
private

Variable to keep track of currently reserved array space for frames.

Definition at line 93 of file TrafficManagerLocal.h.

Referenced by Start(), Step(), and Stop().

◆ episode_proxy

carla::client::detail::EpisodeProxy carla::traffic_manager::TrafficManagerLocal::episode_proxy
private

CARLA client connection object.

Definition at line 60 of file TrafficManagerLocal.h.

Referenced by GetEpisodeProxy(), Reset(), SetupLocalMap(), Step(), TrafficManagerLocal(), and ~TrafficManagerLocal().

◆ large_vehicles

std::unordered_map<ActorId, std::pair<float, bool> > carla::traffic_manager::TrafficManagerLocal::large_vehicles
private

Definition at line 66 of file TrafficManagerLocal.h.

Referenced by TrafficManagerLocal().

◆ last_frame

size_t carla::traffic_manager::TrafficManagerLocal::last_frame {0}
private

Last processed frame.

Definition at line 108 of file TrafficManagerLocal.h.

Referenced by Step(), and Stop().

◆ lateral_highway_PID_parameters

std::vector<float> carla::traffic_manager::TrafficManagerLocal::lateral_highway_PID_parameters
private

Definition at line 58 of file TrafficManagerLocal.h.

Referenced by TrafficManagerLocal().

◆ lateral_PID_parameters

std::vector<float> carla::traffic_manager::TrafficManagerLocal::lateral_PID_parameters
private

Definition at line 57 of file TrafficManagerLocal.h.

Referenced by TrafficManagerLocal().

◆ local_map

LocalMapPtr carla::traffic_manager::TrafficManagerLocal::local_map
private

Pointer to local map cache.

Definition at line 73 of file TrafficManagerLocal.h.

Referenced by Release(), SetupLocalMap(), and TrafficManagerLocal().

◆ localization_frame

LocalizationFrame carla::traffic_manager::TrafficManagerLocal::localization_frame
private

Array to hold output data of localization stage.

Definition at line 85 of file TrafficManagerLocal.h.

Referenced by Start(), Step(), Stop(), and TrafficManagerLocal().

◆ localization_stage

LocalizationStage carla::traffic_manager::TrafficManagerLocal::localization_stage
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().

◆ longitudinal_highway_PID_parameters

std::vector<float> carla::traffic_manager::TrafficManagerLocal::longitudinal_highway_PID_parameters
private

Definition at line 56 of file TrafficManagerLocal.h.

Referenced by TrafficManagerLocal().

◆ longitudinal_PID_parameters

std::vector<float> carla::traffic_manager::TrafficManagerLocal::longitudinal_PID_parameters
private

PID controller parameters.

Definition at line 55 of file TrafficManagerLocal.h.

Referenced by TrafficManagerLocal().

◆ marked_for_removal

std::vector<ActorId> carla::traffic_manager::TrafficManagerLocal::marked_for_removal
private

Definition at line 116 of file TrafficManagerLocal.h.

Referenced by TrafficManagerLocal().

◆ motion_plan_stage

MotionPlanStage carla::traffic_manager::TrafficManagerLocal::motion_plan_stage
private

Definition at line 98 of file TrafficManagerLocal.h.

Referenced by Step(), Stop(), and TrafficManagerLocal().

◆ parameters

◆ previous_update_instance

TimePoint carla::traffic_manager::TrafficManagerLocal::previous_update_instance
private

Time instance used to calculate dt in asynchronous mode.

Definition at line 81 of file TrafficManagerLocal.h.

Referenced by Step(), and Stop().

◆ random_device

RandomGenerator carla::traffic_manager::TrafficManagerLocal::random_device = RandomGenerator(seed)
private

Structure holding random devices per vehicle.

Definition at line 115 of file TrafficManagerLocal.h.

Referenced by SetRandomDeviceSeed(), and TrafficManagerLocal().

◆ registered_vehicles

AtomicActorSet carla::traffic_manager::TrafficManagerLocal::registered_vehicles
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().

◆ registered_vehicles_state

int carla::traffic_manager::TrafficManagerLocal::registered_vehicles_state
private

State counter to track changes in registered actors.

Definition at line 68 of file TrafficManagerLocal.h.

Referenced by Step(), Stop(), and TrafficManagerLocal().

◆ registration_mutex

std::mutex carla::traffic_manager::TrafficManagerLocal::registration_mutex
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().

◆ run_traffic_manger

std::atomic<bool> carla::traffic_manager::TrafficManagerLocal::run_traffic_manger {true}
private

Switch to turn on / turn off traffic manager.

Definition at line 104 of file TrafficManagerLocal.h.

Referenced by Run(), Start(), and Stop().

◆ seed

uint64_t carla::traffic_manager::TrafficManagerLocal::seed {static_cast<uint64_t>(time(NULL))}
private

Randomization seed.

Definition at line 113 of file TrafficManagerLocal.h.

Referenced by SetRandomDeviceSeed().

◆ server

TrafficManagerServer carla::traffic_manager::TrafficManagerLocal::server
private

Traffic manager server instance.

Definition at line 102 of file TrafficManagerLocal.h.

Referenced by TrafficManagerLocal(), and ~TrafficManagerLocal().

◆ simulation_state

SimulationState carla::traffic_manager::TrafficManagerLocal::simulation_state
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().

◆ tl_frame

TLFrame carla::traffic_manager::TrafficManagerLocal::tl_frame
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().

◆ track_traffic

TrackTraffic carla::traffic_manager::TrafficManagerLocal::track_traffic
private

Object for tracking paths of the traffic vehicles.

Definition at line 77 of file TrafficManagerLocal.h.

Referenced by Stop(), and TrafficManagerLocal().

◆ traffic_light_stage

TrafficLightStage carla::traffic_manager::TrafficManagerLocal::traffic_light_stage
private

Definition at line 97 of file TrafficManagerLocal.h.

Referenced by Step(), Stop(), and TrafficManagerLocal().

◆ unwaited_control_batches

uint64_t carla::traffic_manager::TrafficManagerLocal::unwaited_control_batches
private
Initial value:
{
constants::WorldInfoRefresh::MAX_UNWAITED_CONTROL_BATCHES}

Starts at the limit so the first batch of an episode is waited for.

Definition at line 110 of file TrafficManagerLocal.h.

Referenced by Step(), and Stop().

◆ vehicle_id_list

std::vector<ActorId> carla::traffic_manager::TrafficManagerLocal::vehicle_id_list
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().

◆ vehicle_light_stage

VehicleLightStage carla::traffic_manager::TrafficManagerLocal::vehicle_light_stage
private

Definition at line 99 of file TrafficManagerLocal.h.

Referenced by Step(), Stop(), and TrafficManagerLocal().

◆ worker_thread

std::unique_ptr<std::thread> carla::traffic_manager::TrafficManagerLocal::worker_thread
private

Single worker thread for sequential execution of sub-components.

Definition at line 106 of file TrafficManagerLocal.h.

Referenced by SetSynchronousMode(), Start(), and Stop().

◆ world

cc::World carla::traffic_manager::TrafficManagerLocal::world
private

CARLA client and object.

Definition at line 62 of file TrafficManagerLocal.h.

Referenced by Reset(), SetRandomDeviceSeed(), SetupLocalMap(), Step(), and TrafficManagerLocal().


The documentation for this class was generated from the following files: