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, VehicleLightStage &vehicle_light_stage)
 
void RemoveActor (const ActorId actor_id, const bool registered_actor)
 
void Reset ()
 
void Update ()
 

Private Types

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

Private Member Functions

DestroyeddActors IdentifyDestroyedActors (const ActorList &actor_list)
 
void IdentifyNewActors (const ActorList &actor_list)
 
bool IsVehicleStuck (const ActorId &actor_id)
 
void UpdateData (const bool hybrid_physics_mode, const Actor &vehicle, const bool hero_actor_present, const float physics_radius_square)
 
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}
 
std::unordered_map< ActorId, bool > has_physics_enabled
 
ActorMap hero_actors
 
IdleTimeMap idle_time
 
const LocalMapPtrlocal_map
 
LocalizationStagelocalization_stage
 
std::vector< ActorId > & marked_for_removal
 
MotionPlanStagemotion_plan_stage
 
const Parametersparameters
 
AtomicActorSetregistered_vehicles
 
SimulationStatesimulation_state
 
TrackTraffictrack_traffic
 
TrafficLightStagetraffic_light_stage
 
ActorMap unregistered_actors
 
VehicleLightStagevehicle_light_stage
 
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 41 of file ALSM.h.

Member Typedef Documentation

◆ 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,
VehicleLightStage vehicle_light_stage 
)

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 137 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()

void carla::traffic_manager::ALSM::IdentifyNewActors ( const ActorList actor_list)
private

Definition at line 115 of file ALSM.cpp.

References carla::traffic_manager::AtomicActorSet::Contains(), hero_actors, 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 354 of file ALSM.cpp.

References 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 387 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 ( )

◆ UpdateData()

void carla::traffic_manager::ALSM::UpdateData ( const bool  hybrid_physics_mode,
const Actor vehicle,
const bool  hero_actor_present,
const float  physics_radius_square 
)
private

◆ UpdateIdleTime()

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

Definition at line 340 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

Definition at line 169 of file ALSM.cpp.

References carla::traffic_manager::Parameters::GetHybridPhysicsRadius(), carla::traffic_manager::AtomicActorSet::GetList(), carla::traffic_manager::Parameters::GetRespawnDormantVehicles(), hero_actors, parameters, registered_vehicles, carla::traffic_manager::TrackTraffic::SetHeroLocation(), SQUARE, track_traffic, UpdateData(), and UpdateIdleTime().

Referenced by Update().

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

◆ UpdateUnregisteredActorsData()

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

Member Data Documentation

◆ buffer_map

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

Definition at line 47 of file ALSM.h.

Referenced by RemoveActor().

◆ collision_stage

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

Definition at line 60 of file ALSM.h.

Referenced by RemoveActor().

◆ current_timestamp

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

Definition at line 66 of file ALSM.h.

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

◆ elapsed_last_actor_destruction

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

Definition at line 65 of file ALSM.h.

Referenced by Reset(), and Update().

◆ has_physics_enabled

std::unordered_map<ActorId, bool> carla::traffic_manager::ALSM::has_physics_enabled
private

Definition at line 67 of file ALSM.h.

Referenced by UpdateData().

◆ hero_actors

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

◆ idle_time

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

Definition at line 49 of file ALSM.h.

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

◆ local_map

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

Definition at line 57 of file ALSM.h.

Referenced by UpdateUnregisteredActorsData().

◆ localization_stage

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

Definition at line 59 of file ALSM.h.

Referenced by RemoveActor().

◆ marked_for_removal

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

Definition at line 54 of file ALSM.h.

Referenced by Update().

◆ motion_plan_stage

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

Definition at line 62 of file ALSM.h.

Referenced by RemoveActor().

◆ parameters

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

Definition at line 55 of file ALSM.h.

Referenced by Update(), and UpdateRegisteredActorsData().

◆ 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 52 of file ALSM.h.

Referenced by RemoveActor(), UpdateRegisteredActorsData(), and UpdateUnregisteredActorsData().

◆ traffic_light_stage

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

Definition at line 61 of file ALSM.h.

Referenced by RemoveActor().

◆ unregistered_actors

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

◆ vehicle_light_stage

VehicleLightStage& carla::traffic_manager::ALSM::vehicle_light_stage
private

Definition at line 63 of file ALSM.h.

Referenced by RemoveActor().

◆ world

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

Definition at line 56 of file ALSM.h.

Referenced by Reset(), and Update().


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