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

#include <TrackTraffic.h>

+ Collaboration diagram for carla::traffic_manager::TrackTraffic:

Public Member Functions

void Clear ()
 
void DeleteActor (ActorId actor_id)
 Method to delete actor data from tracking. More...
 
ActorIdSet GetOverlappingVehicles (ActorId actor_id) const
 
ActorIdSet GetPassingVehicles (uint64_t waypoint_id) const
 
void RemovePassingVehicle (uint64_t waypoint_id, ActorId actor_id)
 
 TrackTraffic ()
 
void UpdateGridPosition (const ActorId actor_id, const Buffer &buffer)
 
void UpdatePassingVehicle (uint64_t waypoint_id, ActorId actor_id)
 Methods to update, remove and retrieve vehicles passing through a waypoint. More...
 
void UpdateUnregisteredGridPosition (const ActorId actor_id, const std::vector< SimpleWaypointPtr > waypoints)
 

Private Types

using WaypointIdSet = std::unordered_set< uint64_t >
 Structure to keep track of waypoints occupied by vehicles;. More...
 
using WaypointOccupancyMap = std::unordered_map< ActorId, WaypointIdSet >
 
using WaypointOverlap = std::unordered_map< uint64_t, ActorIdSet >
 Structure to keep track of overlapping waypoints between vehicles. More...
 

Private Attributes

std::unordered_map< ActorId, std::unordered_set< GeoGridId > > actor_to_grids
 Geodesic grids occupied by actors's paths. More...
 
std::unordered_map< GeoGridId, ActorIdSetgrid_to_actors
 Actors currently passing through grids. More...
 
WaypointOccupancyMap waypoint_occupied
 
WaypointOverlap waypoint_overlap_tracker
 

Detailed Description

Definition at line 19 of file TrackTraffic.h.

Member Typedef Documentation

◆ WaypointIdSet

using carla::traffic_manager::TrackTraffic::WaypointIdSet = std::unordered_set<uint64_t>
private

Structure to keep track of waypoints occupied by vehicles;.

Definition at line 27 of file TrackTraffic.h.

◆ WaypointOccupancyMap

Definition at line 28 of file TrackTraffic.h.

◆ WaypointOverlap

using carla::traffic_manager::TrackTraffic::WaypointOverlap = std::unordered_map<uint64_t, ActorIdSet>
private

Structure to keep track of overlapping waypoints between vehicles.

Definition at line 23 of file TrackTraffic.h.

Constructor & Destructor Documentation

◆ TrackTraffic()

carla::traffic_manager::TrackTraffic::TrackTraffic ( )

Definition at line 12 of file TrackTraffic.cpp.

Member Function Documentation

◆ Clear()

void carla::traffic_manager::TrackTraffic::Clear ( void  )

Definition at line 164 of file TrackTraffic.cpp.

References actor_to_grids, grid_to_actors, waypoint_occupied, and waypoint_overlap_tracker.

Referenced by carla::traffic_manager::TrafficManagerLocal::Stop().

+ Here is the caller graph for this function:

◆ DeleteActor()

void carla::traffic_manager::TrackTraffic::DeleteActor ( ActorId  actor_id)

Method to delete actor data from tracking.

Definition at line 95 of file TrackTraffic.cpp.

References actor_to_grids, grid_to_actors, RemovePassingVehicle(), and waypoint_occupied.

Referenced by carla::traffic_manager::ALSM::RemoveActor(), and UpdateUnregisteredGridPosition().

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

◆ GetOverlappingVehicles()

ActorIdSet carla::traffic_manager::TrackTraffic::GetOverlappingVehicles ( ActorId  actor_id) const

Definition at line 79 of file TrackTraffic.cpp.

References actor_to_grids, and grid_to_actors.

Referenced by carla::traffic_manager::LocalizationStage::AssignLaneChange(), and carla::traffic_manager::CollisionStage::Update().

+ Here is the caller graph for this function:

◆ GetPassingVehicles()

ActorIdSet carla::traffic_manager::TrackTraffic::GetPassingVehicles ( uint64_t  waypoint_id) const

Definition at line 155 of file TrackTraffic.cpp.

References waypoint_overlap_tracker.

Referenced by carla::traffic_manager::LocalizationStage::AssignLaneChange(), and carla::traffic_manager::MotionPlanStage::SafeAfterJunction().

+ Here is the caller graph for this function:

◆ RemovePassingVehicle()

void carla::traffic_manager::TrackTraffic::RemovePassingVehicle ( uint64_t  waypoint_id,
ActorId  actor_id 
)

Definition at line 135 of file TrackTraffic.cpp.

References waypoint_occupied, and waypoint_overlap_tracker.

Referenced by DeleteActor(), and carla::traffic_manager::PopWaypoint().

+ Here is the caller graph for this function:

◆ UpdateGridPosition()

void carla::traffic_manager::TrackTraffic::UpdateGridPosition ( const ActorId  actor_id,
const Buffer buffer 
)

Definition at line 40 of file TrackTraffic.cpp.

References actor_to_grids, carla::traffic_manager::constants::TrackTraffic::BUFFER_STEP_THROUGH, grid_to_actors, and carla::traffic_manager::constants::TrackTraffic::INV_BUFFER_STEP_THROUGH.

Referenced by carla::traffic_manager::LocalizationStage::Update().

+ Here is the caller graph for this function:

◆ UpdatePassingVehicle()

void carla::traffic_manager::TrackTraffic::UpdatePassingVehicle ( uint64_t  waypoint_id,
ActorId  actor_id 
)

Methods to update, remove and retrieve vehicles passing through a waypoint.

Definition at line 115 of file TrackTraffic.cpp.

References waypoint_occupied, and waypoint_overlap_tracker.

Referenced by carla::traffic_manager::PushWaypoint(), and UpdateUnregisteredGridPosition().

+ Here is the caller graph for this function:

◆ UpdateUnregisteredGridPosition()

void carla::traffic_manager::TrackTraffic::UpdateUnregisteredGridPosition ( const ActorId  actor_id,
const std::vector< SimpleWaypointPtr waypoints 
)

Definition at line 14 of file TrackTraffic.cpp.

References actor_to_grids, DeleteActor(), grid_to_actors, and UpdatePassingVehicle().

Referenced by carla::traffic_manager::ALSM::UpdateUnregisteredActorsData().

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

Member Data Documentation

◆ actor_to_grids

std::unordered_map<ActorId, std::unordered_set<GeoGridId> > carla::traffic_manager::TrackTraffic::actor_to_grids
private

Geodesic grids occupied by actors's paths.

Definition at line 32 of file TrackTraffic.h.

Referenced by Clear(), DeleteActor(), GetOverlappingVehicles(), UpdateGridPosition(), and UpdateUnregisteredGridPosition().

◆ grid_to_actors

std::unordered_map<GeoGridId, ActorIdSet> carla::traffic_manager::TrackTraffic::grid_to_actors
private

Actors currently passing through grids.

Definition at line 34 of file TrackTraffic.h.

Referenced by Clear(), DeleteActor(), GetOverlappingVehicles(), UpdateGridPosition(), and UpdateUnregisteredGridPosition().

◆ waypoint_occupied

WaypointOccupancyMap carla::traffic_manager::TrackTraffic::waypoint_occupied
private

Definition at line 29 of file TrackTraffic.h.

Referenced by Clear(), DeleteActor(), RemovePassingVehicle(), and UpdatePassingVehicle().

◆ waypoint_overlap_tracker

WaypointOverlap carla::traffic_manager::TrackTraffic::waypoint_overlap_tracker
private

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