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 AddTakenGrid (const GeoGridId geogrid_id, const ActorId actor_id)
 
void Clear ()
 
void DeleteActor (ActorId actor_id)
 Method to delete actor data from tracking. More...
 
cg::Location GetHeroLocation () const
 
ActorIdSet GetOverlappingVehicles (ActorId actor_id) const
 
ActorIdSet GetPassingVehicles (uint64_t waypoint_id) const
 
bool IsGeoGridFree (const GeoGridId geogrid_id) const
 
void RemovePassingVehicle (uint64_t waypoint_id, ActorId actor_id)
 
void SetHeroLocation (const cg::Location location)
 
 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...
 
cg::Location hero_location = cg::Location(0,0,0)
 Current hero location. 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

◆ AddTakenGrid()

void carla::traffic_manager::TrackTraffic::AddTakenGrid ( const GeoGridId  geogrid_id,
const ActorId  actor_id 
)

Definition at line 86 of file TrackTraffic.cpp.

References grid_to_actors.

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

+ Here is the caller graph for this function:

◆ Clear()

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

Definition at line 186 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 117 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:

◆ GetHeroLocation()

cg::Location carla::traffic_manager::TrackTraffic::GetHeroLocation ( ) const

Definition at line 97 of file TrackTraffic.cpp.

References hero_location.

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

+ Here is the caller graph for this function:

◆ GetOverlappingVehicles()

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

Definition at line 101 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 177 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:

◆ IsGeoGridFree()

bool carla::traffic_manager::TrackTraffic::IsGeoGridFree ( const GeoGridId  geogrid_id) const

Definition at line 79 of file TrackTraffic.cpp.

References grid_to_actors.

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

+ 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 157 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:

◆ SetHeroLocation()

void carla::traffic_manager::TrackTraffic::SetHeroLocation ( const cg::Location  location)

Definition at line 93 of file TrackTraffic.cpp.

References hero_location.

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

+ 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, and grid_to_actors.

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 137 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 AddTakenGrid(), Clear(), DeleteActor(), GetOverlappingVehicles(), IsGeoGridFree(), UpdateGridPosition(), and UpdateUnregisteredGridPosition().

◆ hero_location

cg::Location carla::traffic_manager::TrackTraffic::hero_location = cg::Location(0,0,0)
private

Current hero location.

Definition at line 36 of file TrackTraffic.h.

Referenced by GetHeroLocation(), and SetHeroLocation().

◆ 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: