#include <TrackTraffic.h>
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, ActorIdSet > | grid_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 |
Definition at line 19 of file TrackTraffic.h.
|
private |
Structure to keep track of waypoints occupied by vehicles;.
Definition at line 27 of file TrackTraffic.h.
|
private |
Definition at line 28 of file TrackTraffic.h.
|
private |
Structure to keep track of overlapping waypoints between vehicles.
Definition at line 23 of file TrackTraffic.h.
carla::traffic_manager::TrackTraffic::TrackTraffic | ( | ) |
Definition at line 12 of file TrackTraffic.cpp.
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
|
private |
Geodesic grids occupied by actors's paths.
Definition at line 32 of file TrackTraffic.h.
Referenced by Clear(), DeleteActor(), GetOverlappingVehicles(), UpdateGridPosition(), and UpdateUnregisteredGridPosition().
|
private |
Actors currently passing through grids.
Definition at line 34 of file TrackTraffic.h.
Referenced by AddTakenGrid(), Clear(), DeleteActor(), GetOverlappingVehicles(), IsGeoGridFree(), UpdateGridPosition(), and UpdateUnregisteredGridPosition().
|
private |
Current hero location.
Definition at line 36 of file TrackTraffic.h.
Referenced by GetHeroLocation(), and SetHeroLocation().
|
private |
Definition at line 29 of file TrackTraffic.h.
Referenced by Clear(), DeleteActor(), RemovePassingVehicle(), and UpdatePassingVehicle().
|
private |
Definition at line 24 of file TrackTraffic.h.
Referenced by Clear(), GetPassingVehicles(), RemovePassingVehicle(), and UpdatePassingVehicle().