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 | |
ALSM (AtomicActorSet ®istered_vehicles, BufferMap &buffer_map, TrackTraffic &track_traffic, std::vector< ActorId > &marked_for_removal, const Parameters ¶meters, 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 | |
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 |
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 |
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.
|
private |
|
private |
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 | ||
) |
|
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().
|
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().
|
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().
void carla::traffic_manager::ALSM::RemoveActor | ( | const ActorId | actor_id, |
const bool | registered_actor | ||
) |
Definition at line 367 of file ALSM.cpp.
References buffer_map, collision_stage, carla::traffic_manager::TrackTraffic::DeleteActor(), hero_actors, idle_time, localization_stage, motion_plan_stage, registered_vehicles, carla::traffic_manager::AtomicActorSet::Remove(), carla::traffic_manager::VehicleLightStage::RemoveActor(), carla::traffic_manager::TrafficLightStage::RemoveActor(), carla::traffic_manager::SimulationState::RemoveActor(), carla::traffic_manager::LocalizationStage::RemoveActor(), carla::traffic_manager::MotionPlanStage::RemoveActor(), carla::traffic_manager::CollisionStage::RemoveActor(), simulation_state, track_traffic, traffic_light_stage, unregistered_actors, and vehicle_light_stage.
Referenced by carla::traffic_manager::TrafficManagerLocal::UnregisterVehicles(), and Update().
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.
void carla::traffic_manager::ALSM::Update | ( | ) |
Definition at line 45 of file ALSM.cpp.
References current_timestamp, carla::traffic_manager::constants::VehicleRemoval::DELTA_TIME_BETWEEN_DESTRUCTIONS, carla::traffic_manager::AtomicActorSet::Destroy(), elapsed_last_actor_destruction, carla::client::Timestamp::elapsed_seconds, carla::client::World::GetActors(), carla::traffic_manager::Parameters::GetHybridPhysicsMode(), carla::traffic_manager::Parameters::GetOSMMode(), carla::client::World::GetSnapshot(), carla::client::WorldSnapshot::GetTimestamp(), hero_actors, IdentifyDestroyedActors(), IdentifyNewActors(), IsVehicleStuck(), marked_for_removal, parameters, registered_vehicles, RemoveActor(), UpdateRegisteredActorsData(), UpdateUnregisteredActorsData(), and world.
Referenced by carla::traffic_manager::TrafficManagerLocal::Run().
|
private |
Definition at line 196 of file ALSM.cpp.
References carla::traffic_manager::SimulationState::AddActor(), carla::traffic_manager::SimulationState::ContainsActor(), current_timestamp, carla::geom::Math::DistanceSquared(), carla::client::Timestamp::elapsed_seconds, carla::traffic_manager::SimulationState::GetHybridEndLocation(), carla::traffic_manager::SimulationState::GetLocation(), carla::traffic_manager::SimulationState::GetVelocity(), has_physics_enabled, hero_actors, idle_time, carla::traffic_manager::constants::HybridMode::INV_HYBRID_DT, carla::traffic_manager::SimulationState::IsPhysicsEnabled(), carla::geom::Transform::location, carla::geom::Transform::rotation, simulation_state, carla::traffic_manager::SimulationState::UpdateKinematicState(), carla::traffic_manager::SimulationState::UpdateTrafficLightState(), Vehicle, carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
Referenced by UpdateRegisteredActorsData().
|
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().
|
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().
|
private |
Definition at line 270 of file ALSM.cpp.
References carla::traffic_manager::SimulationState::AddActor(), carla::traffic_manager::Any, carla::traffic_manager::SimulationState::ContainsActor(), carla::client::Vehicle::GetSpeedLimit(), local_map, carla::geom::Transform::location, carla::traffic_manager::Pedestrian, carla::geom::Transform::rotation, simulation_state, track_traffic, unregistered_actors, carla::traffic_manager::SimulationState::UpdateKinematicState(), carla::traffic_manager::SimulationState::UpdateTrafficLightState(), carla::traffic_manager::TrackTraffic::UpdateUnregisteredGridPosition(), Vehicle, carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
Referenced by Update().
|
private |
Definition at line 47 of file ALSM.h.
Referenced by RemoveActor().
|
private |
Definition at line 60 of file ALSM.h.
Referenced by RemoveActor().
|
private |
Definition at line 66 of file ALSM.h.
Referenced by IsVehicleStuck(), Reset(), Update(), UpdateData(), and UpdateIdleTime().
|
private |
|
private |
Definition at line 67 of file ALSM.h.
Referenced by UpdateData().
|
private |
Definition at line 51 of file ALSM.h.
Referenced by IdentifyNewActors(), RemoveActor(), Reset(), Update(), UpdateData(), and UpdateRegisteredActorsData().
|
private |
Definition at line 49 of file ALSM.h.
Referenced by IsVehicleStuck(), RemoveActor(), Reset(), UpdateData(), and UpdateIdleTime().
|
private |
Definition at line 57 of file ALSM.h.
Referenced by UpdateUnregisteredActorsData().
|
private |
Definition at line 59 of file ALSM.h.
Referenced by RemoveActor().
|
private |
|
private |
Definition at line 62 of file ALSM.h.
Referenced by RemoveActor().
|
private |
Definition at line 55 of file ALSM.h.
Referenced by Update(), and UpdateRegisteredActorsData().
|
private |
Definition at line 44 of file ALSM.h.
Referenced by IdentifyDestroyedActors(), IdentifyNewActors(), RemoveActor(), Update(), and UpdateRegisteredActorsData().
|
private |
Definition at line 58 of file ALSM.h.
Referenced by IsVehicleStuck(), RemoveActor(), UpdateData(), UpdateIdleTime(), and UpdateUnregisteredActorsData().
|
private |
Definition at line 52 of file ALSM.h.
Referenced by RemoveActor(), UpdateRegisteredActorsData(), and UpdateUnregisteredActorsData().
|
private |
Definition at line 61 of file ALSM.h.
Referenced by RemoveActor().
|
private |
Definition at line 46 of file ALSM.h.
Referenced by IdentifyDestroyedActors(), IdentifyNewActors(), RemoveActor(), Reset(), and UpdateUnregisteredActorsData().
|
private |
Definition at line 63 of file ALSM.h.
Referenced by RemoveActor().
|
private |