CARLA
Loading...
Searching...
No Matches
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>

Public Member Functions

void AddActor (const Actor actor)
 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, std::unordered_map< ActorId, std::pair< float, bool > > &large_vehicles, 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

BufferMap & buffer_map
CollisionStage & collision_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
std::unordered_map< ActorId, std::pair< float, bool > > & large_vehicles
const LocalMapPtr & local_map
LocalizationStage & localization_stage
std::vector< ActorId > & marked_for_removal
MotionPlanStage & motion_plan_stage
const Parameters & parameters
AtomicActorSet & registered_vehicles
SimulationState & simulation_state
TrackTraffic & track_traffic
TrafficLightStage & traffic_light_stage
ActorMap unregistered_actors
VehicleLightStage & vehicle_light_stage
const cc::World & world

Static Private Attributes

static constexpr std::array< std::string_view, 2 > large_vehicle_types {"bus", "truck"}

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

Member Typedef Documentation

◆ DestroyeddActors

Definition at line 83 of file ALSM.h.

◆ IdleInfo

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

Definition at line 88 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,
std::unordered_map< ActorId, std::pair< float, bool > > & large_vehicles,
LocalizationStage & localization_stage,
CollisionStage & collision_stage,
TrafficLightStage & traffic_light_stage,
MotionPlanStage & motion_plan_stage,
VehicleLightStage & vehicle_light_stage )

Member Function Documentation

◆ AddActor()

void carla::traffic_manager::ALSM::AddActor ( const Actor actor)

◆ IdentifyDestroyedActors()

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

◆ IdentifyNewActors()

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

◆ IsVehicleStuck()

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

◆ RemoveActor()

◆ Reset()

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

◆ Update()

◆ UpdateData()

◆ UpdateIdleTime()

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

◆ UpdateRegisteredActorsData()

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

◆ UpdateUnregisteredActorsData()

Member Data Documentation

◆ buffer_map

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

Definition at line 49 of file ALSM.h.

Referenced by ALSM(), and RemoveActor().

◆ collision_stage

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

Definition at line 62 of file ALSM.h.

Referenced by ALSM(), and RemoveActor().

◆ current_timestamp

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

Definition at line 68 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 67 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 69 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 51 of file ALSM.h.

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

◆ large_vehicle_types

std::array<std::string_view, 2> carla::traffic_manager::ALSM::large_vehicle_types {"bus", "truck"}
staticconstexprprivate

Definition at line 72 of file ALSM.h.

Referenced by AddActor().

◆ large_vehicles

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

Definition at line 70 of file ALSM.h.

Referenced by AddActor(), ALSM(), and RemoveActor().

◆ local_map

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

Definition at line 59 of file ALSM.h.

Referenced by ALSM(), and UpdateUnregisteredActorsData().

◆ localization_stage

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

Definition at line 61 of file ALSM.h.

Referenced by ALSM(), and RemoveActor().

◆ marked_for_removal

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

Definition at line 56 of file ALSM.h.

Referenced by ALSM(), and Update().

◆ motion_plan_stage

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

Definition at line 64 of file ALSM.h.

Referenced by ALSM(), and RemoveActor().

◆ parameters

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

Definition at line 57 of file ALSM.h.

Referenced by ALSM(), 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 54 of file ALSM.h.

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

◆ traffic_light_stage

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

Definition at line 63 of file ALSM.h.

Referenced by ALSM(), and 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 65 of file ALSM.h.

Referenced by ALSM(), and RemoveActor().

◆ world

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

Definition at line 58 of file ALSM.h.

Referenced by ALSM(), Reset(), and Update().


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