CARLA
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
carla::traffic_manager::ALSM Class Reference

ALSM: Agent Lifecycle and State Managerment This class has functionality to update the local cache of kinematic states and manage memory and cleanup for varying number of vehicles in the simulation. More...

#include <ALSM.h>

+ Collaboration diagram for carla::traffic_manager::ALSM:

Public Member Functions

 ALSM (AtomicActorSet &registered_vehicles, BufferMap &buffer_map, TrackTraffic &track_traffic, std::vector< ActorId > &marked_for_removal, const Parameters &parameters, const cc::World &world, const LocalMapPtr &local_map, SimulationState &simulation_state, LocalizationStage &localization_stage, CollisionStage &collision_stage, TrafficLightStage &traffic_light_stage, MotionPlanStage &motion_plan_stage, RandomGeneratorMap &random_devices)
 
void RemoveActor (const ActorId actor_id, const bool registered_actor)
 
void Reset ()
 
void Update ()
 

Private Types

using ActorVector = std::vector< ActorPtr >
 
using DestroyeddActors = std::pair< ActorIdSet, ActorIdSet >
 
using IdleInfo = std::pair< ActorId, double >
 

Private Member Functions

DestroyeddActors IdentifyDestroyedActors (const ActorList &actor_list)
 
ActorVector IdentifyNewActors (const ActorList &actor_list)
 
bool IsVehicleStuck (const ActorId &actor_id)
 
void UpdateIdleTime (std::pair< ActorId, double > &max_idle_time, const ActorId &actor_id)
 
void UpdateRegisteredActorsData (const bool hybrid_physics_mode, IdleInfo &max_idle_time)
 
void UpdateUnregisteredActorsData ()
 

Private Attributes

BufferMapbuffer_map
 
CollisionStagecollision_stage
 
cc::Timestamp current_timestamp
 
double elapsed_last_actor_destruction {0.0}
 
ActorMap hero_actors
 
IdleTimeMap idle_time
 
const LocalMapPtrlocal_map
 
LocalizationStagelocalization_stage
 
std::vector< ActorId > & marked_for_removal
 
MotionPlanStagemotion_plan_stage
 
const Parametersparameters
 
RandomGeneratorMaprandom_devices
 
AtomicActorSetregistered_vehicles
 
SimulationStatesimulation_state
 
TrackTraffictrack_traffic
 
TrafficLightStagetraffic_light_stage
 
ActorMap unregistered_actors
 
const cc::Worldworld
 

Detailed Description

ALSM: Agent Lifecycle and State Managerment This class has functionality to update the local cache of kinematic states and manage memory and cleanup for varying number of vehicles in the simulation.

Definition at line 40 of file ALSM.h.

Member Typedef Documentation

◆ ActorVector

Definition at line 74 of file ALSM.h.

◆ DestroyeddActors

Definition at line 78 of file ALSM.h.

◆ IdleInfo

using carla::traffic_manager::ALSM::IdleInfo = std::pair<ActorId, double>
private

Definition at line 83 of file ALSM.h.

Constructor & Destructor Documentation

◆ ALSM()

carla::traffic_manager::ALSM::ALSM ( AtomicActorSet registered_vehicles,
BufferMap buffer_map,
TrackTraffic track_traffic,
std::vector< ActorId > &  marked_for_removal,
const Parameters parameters,
const cc::World world,
const LocalMapPtr local_map,
SimulationState simulation_state,
LocalizationStage localization_stage,
CollisionStage collision_stage,
TrafficLightStage traffic_light_stage,
MotionPlanStage motion_plan_stage,
RandomGeneratorMap random_devices 
)

Definition at line 17 of file ALSM.cpp.

Member Function Documentation

◆ IdentifyDestroyedActors()

ALSM::DestroyeddActors carla::traffic_manager::ALSM::IdentifyDestroyedActors ( const ActorList actor_list)
private

Definition at line 139 of file ALSM.cpp.

References carla::traffic_manager::AtomicActorSet::Contains(), carla::traffic_manager::AtomicActorSet::GetIDList(), registered_vehicles, and unregistered_actors.

Referenced by Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IdentifyNewActors()

std::vector< ActorPtr > carla::traffic_manager::ALSM::IdentifyNewActors ( const ActorList actor_list)
private

Definition at line 126 of file ALSM.cpp.

References carla::traffic_manager::AtomicActorSet::Contains(), registered_vehicles, and unregistered_actors.

Referenced by Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsVehicleStuck()

bool carla::traffic_manager::ALSM::IsVehicleStuck ( const ActorId actor_id)
private

Definition at line 327 of file ALSM.cpp.

References carla::traffic_manager::TrafficLightState::at_traffic_light, carla::traffic_manager::constants::VehicleRemoval::BLOCKED_TIME_THRESHOLD, current_timestamp, carla::client::Timestamp::elapsed_seconds, carla::traffic_manager::SimulationState::GetTLS(), idle_time, carla::rpc::Red, carla::traffic_manager::constants::VehicleRemoval::RED_TL_BLOCKED_TIME_THRESHOLD, simulation_state, and carla::traffic_manager::TrafficLightState::tl_state.

Referenced by Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveActor()

void carla::traffic_manager::ALSM::RemoveActor ( const ActorId  actor_id,
const bool  registered_actor 
)

◆ Reset()

void carla::traffic_manager::ALSM::Reset ( void  )

Definition at line 359 of file ALSM.cpp.

References current_timestamp, elapsed_last_actor_destruction, carla::client::World::GetSnapshot(), carla::client::WorldSnapshot::GetTimestamp(), hero_actors, idle_time, unregistered_actors, and world.

+ Here is the call graph for this function:

◆ Update()

void carla::traffic_manager::ALSM::Update ( )

◆ UpdateIdleTime()

void carla::traffic_manager::ALSM::UpdateIdleTime ( std::pair< ActorId, double > &  max_idle_time,
const ActorId actor_id 
)
private

Definition at line 313 of file ALSM.cpp.

References current_timestamp, carla::client::Timestamp::elapsed_seconds, carla::traffic_manager::SimulationState::GetVelocity(), idle_time, simulation_state, SQUARE, carla::geom::Vector3D::SquaredLength(), and carla::traffic_manager::constants::VehicleRemoval::STOPPED_VELOCITY_THRESHOLD.

Referenced by UpdateRegisteredActorsData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateRegisteredActorsData()

void carla::traffic_manager::ALSM::UpdateRegisteredActorsData ( const bool  hybrid_physics_mode,
ALSM::IdleInfo max_idle_time 
)
private

◆ UpdateUnregisteredActorsData()

void carla::traffic_manager::ALSM::UpdateUnregisteredActorsData ( )
private

Member Data Documentation

◆ buffer_map

BufferMap& carla::traffic_manager::ALSM::buffer_map
private

Definition at line 46 of file ALSM.h.

Referenced by RemoveActor().

◆ collision_stage

CollisionStage& carla::traffic_manager::ALSM::collision_stage
private

Definition at line 59 of file ALSM.h.

Referenced by RemoveActor().

◆ current_timestamp

cc::Timestamp carla::traffic_manager::ALSM::current_timestamp
private

Definition at line 64 of file ALSM.h.

Referenced by IsVehicleStuck(), Reset(), Update(), UpdateIdleTime(), and UpdateRegisteredActorsData().

◆ elapsed_last_actor_destruction

double carla::traffic_manager::ALSM::elapsed_last_actor_destruction {0.0}
private

Definition at line 63 of file ALSM.h.

Referenced by Reset(), and Update().

◆ hero_actors

ActorMap carla::traffic_manager::ALSM::hero_actors
private

Definition at line 50 of file ALSM.h.

Referenced by RemoveActor(), Reset(), Update(), and UpdateRegisteredActorsData().

◆ idle_time

IdleTimeMap carla::traffic_manager::ALSM::idle_time
private

Definition at line 48 of file ALSM.h.

Referenced by IsVehicleStuck(), RemoveActor(), Reset(), UpdateIdleTime(), and UpdateRegisteredActorsData().

◆ local_map

const LocalMapPtr& carla::traffic_manager::ALSM::local_map
private

Definition at line 56 of file ALSM.h.

Referenced by UpdateUnregisteredActorsData().

◆ localization_stage

LocalizationStage& carla::traffic_manager::ALSM::localization_stage
private

Definition at line 58 of file ALSM.h.

Referenced by RemoveActor().

◆ marked_for_removal

std::vector<ActorId>& carla::traffic_manager::ALSM::marked_for_removal
private

Definition at line 53 of file ALSM.h.

Referenced by Update().

◆ motion_plan_stage

MotionPlanStage& carla::traffic_manager::ALSM::motion_plan_stage
private

Definition at line 61 of file ALSM.h.

Referenced by RemoveActor().

◆ parameters

const Parameters& carla::traffic_manager::ALSM::parameters
private

Definition at line 54 of file ALSM.h.

Referenced by Update(), and UpdateRegisteredActorsData().

◆ random_devices

RandomGeneratorMap& carla::traffic_manager::ALSM::random_devices
private

Definition at line 66 of file ALSM.h.

Referenced by RemoveActor().

◆ registered_vehicles

AtomicActorSet& carla::traffic_manager::ALSM::registered_vehicles
private

◆ simulation_state

SimulationState& carla::traffic_manager::ALSM::simulation_state
private

◆ track_traffic

TrackTraffic& carla::traffic_manager::ALSM::track_traffic
private

Definition at line 51 of file ALSM.h.

Referenced by RemoveActor(), and UpdateUnregisteredActorsData().

◆ traffic_light_stage

TrafficLightStage& carla::traffic_manager::ALSM::traffic_light_stage
private

Definition at line 60 of file ALSM.h.

Referenced by RemoveActor().

◆ unregistered_actors

ActorMap carla::traffic_manager::ALSM::unregistered_actors
private

◆ world

const cc::World& carla::traffic_manager::ALSM::world
private

Definition at line 55 of file ALSM.h.

Referenced by Reset(), and Update().


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