16 namespace traffic_manager {
23 using Action = std::pair<RoadOption, WaypointPtr>;
25 using Path = std::vector<cg::Location>;
26 using Route = std::vector<uint8_t>;
51 const float vehicle_speed,
52 bool force,
bool direction);
55 const bool is_at_junction_entrance,
61 const float horizon_square);
66 const float horizon_square);
75 std::vector<ActorId>& marked_for_removal,
79 void Update(
const unsigned long index)
override;
83 void Reset()
override;
LocalizationFrame & output_array
Action ComputeNextAction(const ActorId &actor_id)
RandomGenerator & random_device
std::unordered_map< ActorId, SimpleWaypointPair > vehicles_at_junction_entrance
std::vector< ActorId > & marked_for_removal
std::vector< cg::Location > Path
void ExtendAndFindSafeSpace(const ActorId actor_id, const bool is_at_junction_entrance, Buffer &waypoint_buffer)
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
std::shared_ptr< InMemoryMap > LocalMapPtr
This class holds the state of all the vehicles in the simlation.
This file contains definitions of common data structures used in traffic manager. ...
std::unordered_set< ActorId > ActorIdSet
std::unordered_map< ActorId, SimpleWaypointPtr > LaneChangeSWptMap
std::deque< std::shared_ptr< SimpleWaypoint > > Buffer
const std::vector< ActorId > & vehicle_id_list
SimpleWaypointPtr AssignLaneChange(const ActorId actor_id, const cg::Location vehicle_location, const float vehicle_speed, bool force, bool direction)
std::unordered_map< carla::ActorId, Buffer > BufferMap
TrackTraffic & track_traffic
void ImportPath(Path &imported_path, Buffer &waypoint_buffer, const ActorId actor_id, const float horizon_square)
std::pair< RoadOption, WaypointPtr > Action
carla::SharedPtr< cc::Waypoint > WaypointPtr
std::vector< uint8_t > Route
void RemoveActor(const ActorId actor_id) override
const LocalMapPtr & local_map
void Update(const unsigned long index) override
LaneChangeSWptMap last_lane_change_swpt
const SimulationState & simulation_state
std::vector< LocalizationData > LocalizationFrame
std::shared_ptr< SimpleWaypoint > SimpleWaypointPtr
void ImportRoute(Route &imported_actions, Buffer &waypoint_buffer, const ActorId actor_id, const float horizon_square)
std::pair< SimpleWaypointPtr, SimpleWaypointPtr > SimpleWaypointPair
LocalizationStage(const std::vector< ActorId > &vehicle_id_list, BufferMap &buffer_map, const SimulationState &simulation_state, TrackTraffic &track_traffic, const LocalMapPtr &local_map, Parameters ¶meters, std::vector< ActorId > &marked_for_removal, LocalizationFrame &output_array, RandomGenerator &random_device)
This class has functionality to maintain a horizon of waypoints ahead of the vehicle for it to follow...
std::vector< Action > ActionBuffer
ActorIdSet vehicles_at_junction
ActionBuffer ComputeActionBuffer(const ActorId &actor_id)