CARLA
MotionPlanStage.h
Go to the documentation of this file.
1 
2 /// This file has functionality for motion planning based on information
3 /// from localization, collision avoidance and traffic light response.
4 
5 #pragma once
6 
13 
14 namespace carla {
15 namespace traffic_manager {
16 
18 private:
19  const std::vector<ActorId> &vehicle_id_list;
24  // PID paramenters for various road conditions.
25  const std::vector<float> urban_longitudinal_parameters;
26  const std::vector<float> highway_longitudinal_parameters;
27  const std::vector<float> urban_lateral_parameters;
28  const std::vector<float> highway_lateral_parameters;
31  const TLFrame &tl_frame;
32  const cc::World &world;
33  // Structure holding the controller state for registered vehicles.
34  std::unordered_map<ActorId, StateEntry> pid_state_map;
35  // Structure to keep track of duration between teleportation
36  // in hybrid physics mode.
37  std::unordered_map<ActorId, cc::Timestamp> teleportation_instance;
40 
41  std::pair<bool, float> CollisionHandling(const CollisionHazardData &collision_hazard,
42  const bool tl_hazard,
43  const cg::Vector3D ego_velocity,
44  const cg::Vector3D ego_heading,
45  const float max_target_velocity);
46 
47 bool SafeAfterJunction(const LocalizationData &localization,
48  const bool tl_hazard,
49  const bool collision_emergency_stop);
50 
51 public:
52  MotionPlanStage(const std::vector<ActorId> &vehicle_id_list,
53  const SimulationState &simulation_state,
54  const Parameters &parameters,
55  const BufferMap &buffer_map,
56  const TrackTraffic &track_traffic,
57  const std::vector<float> &urban_longitudinal_parameters,
58  const std::vector<float> &highway_longitudinal_parameters,
59  const std::vector<float> &urban_lateral_parameters,
60  const std::vector<float> &highway_lateral_parameters,
61  const LocalizationFrame &localization_frame,
62  const CollisionFrame &collision_frame,
63  const TLFrame &tl_frame,
64  const cc::World &world,
65  ControlFrame &output_array);
66 
67  void Update(const unsigned long index);
68 
69  void RemoveActor(const ActorId actor_id);
70 
71  void Reset();
72 };
73 
74 } // namespace traffic_manager
75 } // namespace carla
std::vector< carla::rpc::Command > ControlFrame
const std::vector< float > highway_longitudinal_parameters
void Update(const unsigned long index)
const std::vector< ActorId > & vehicle_id_list
std::vector< bool > TLFrame
This class holds the state of all the vehicles in the simlation.
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:99
void RemoveActor(const ActorId actor_id)
std::unordered_map< ActorId, cc::Timestamp > teleportation_instance
std::unordered_map< carla::ActorId, Buffer > BufferMap
const SimulationState & simulation_state
std::unordered_map< ActorId, StateEntry > pid_state_map
carla::ActorId ActorId
const std::vector< float > highway_lateral_parameters
const LocalizationFrame & localization_frame
const std::vector< float > urban_longitudinal_parameters
bool SafeAfterJunction(const LocalizationData &localization, const bool tl_hazard, const bool collision_emergency_stop)
Stage type interface.
Definition: Stage.h:12
std::vector< LocalizationData > LocalizationFrame
MotionPlanStage(const std::vector< ActorId > &vehicle_id_list, const SimulationState &simulation_state, const Parameters &parameters, const BufferMap &buffer_map, const TrackTraffic &track_traffic, const std::vector< float > &urban_longitudinal_parameters, const std::vector< float > &highway_longitudinal_parameters, const std::vector< float > &urban_lateral_parameters, const std::vector< float > &highway_lateral_parameters, const LocalizationFrame &localization_frame, const CollisionFrame &collision_frame, const TLFrame &tl_frame, const cc::World &world, ControlFrame &output_array)
std::pair< bool, float > CollisionHandling(const CollisionHazardData &collision_hazard, const bool tl_hazard, const cg::Vector3D ego_velocity, const cg::Vector3D ego_heading, const float max_target_velocity)
const std::vector< float > urban_lateral_parameters
std::vector< CollisionHazardData > CollisionFrame