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

#include <MotionPlanStage.h>

+ Inheritance diagram for carla::traffic_manager::MotionPlanStage:
+ Collaboration diagram for carla::traffic_manager::MotionPlanStage:

Public Member Functions

 MotionPlanStage (const std::vector< ActorId > &vehicle_id_list, SimulationState &simulation_state, const Parameters &parameters, const BufferMap &buffer_map, 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, RandomGenerator &random_device, const LocalMapPtr &local_map)
 
void RemoveActor (const ActorId actor_id)
 
void Reset ()
 
void Update (const unsigned long index)
 

Private Member Functions

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)
 
float GetLandmarkTargetVelocity (const SimpleWaypoint &waypoint, const cg::Location vehicle_location, const ActorId actor_id, float max_target_velocity)
 
float GetThreePointCircleRadius (cg::Location first_location, cg::Location middle_location, cg::Location last_location)
 
float GetTurnTargetVelocity (const Buffer &waypoint_buffer, float max_target_velocity)
 
bool SafeAfterJunction (const LocalizationData &localization, const bool tl_hazard, const bool collision_emergency_stop)
 
- Private Member Functions inherited from carla::traffic_manager::Stage
 Stage ()
 
 Stage (const Stage &)
 
virtual ~Stage ()
 

Private Attributes

const BufferMapbuffer_map
 
const CollisionFramecollision_frame
 
cc::Timestamp current_timestamp
 
const std::vector< float > highway_lateral_parameters
 
const std::vector< float > highway_longitudinal_parameters
 
const LocalMapPtrlocal_map
 
const LocalizationFramelocalization_frame
 
ControlFrameoutput_array
 
const Parametersparameters
 
std::unordered_map< ActorId, StateEntrypid_state_map
 
RandomGeneratorrandom_device
 
SimulationStatesimulation_state
 
std::unordered_map< ActorId, cc::Timestampteleportation_instance
 
const TLFrametl_frame
 
TrackTraffictrack_traffic
 
const std::vector< float > urban_lateral_parameters
 
const std::vector< float > urban_longitudinal_parameters
 
const std::vector< ActorId > & vehicle_id_list
 
const cc::Worldworld
 

Detailed Description

Definition at line 22 of file MotionPlanStage.h.

Constructor & Destructor Documentation

◆ MotionPlanStage()

carla::traffic_manager::MotionPlanStage::MotionPlanStage ( const std::vector< ActorId > &  vehicle_id_list,
SimulationState simulation_state,
const Parameters parameters,
const BufferMap buffer_map,
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,
RandomGenerator random_device,
const LocalMapPtr local_map 
)

Definition at line 29 of file MotionPlanStage.cpp.

Member Function Documentation

◆ CollisionHandling()

std::pair< bool, float > carla::traffic_manager::MotionPlanStage::CollisionHandling ( const CollisionHazardData collision_hazard,
const bool  tl_hazard,
const cg::Vector3D  ego_velocity,
const cg::Vector3D  ego_heading,
const float  max_target_velocity 
)
private

◆ GetLandmarkTargetVelocity()

float carla::traffic_manager::MotionPlanStage::GetLandmarkTargetVelocity ( const SimpleWaypoint waypoint,
const cg::Location  vehicle_location,
const ActorId  actor_id,
float  max_target_velocity 
)
private

Definition at line 361 of file MotionPlanStage.cpp.

References carla::traffic_manager::Parameters::GetVehicleTargetVelocity(), carla::traffic_manager::SimpleWaypoint::GetWaypoint(), carla::traffic_manager::constants::MotionPlan::LANDMARK_DETECTION_TIME, min(), parameters, carla::traffic_manager::constants::MotionPlan::STOP_TARGET_VELOCITY, carla::traffic_manager::constants::MotionPlan::TL_TARGET_VELOCITY, and carla::traffic_manager::constants::MotionPlan::YIELD_TARGET_VELOCITY.

Referenced by Update().

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

◆ GetThreePointCircleRadius()

float carla::traffic_manager::MotionPlanStage::GetThreePointCircleRadius ( cg::Location  first_location,
cg::Location  middle_location,
cg::Location  last_location 
)
private

Definition at line 424 of file MotionPlanStage.cpp.

References carla::geom::Vector3D::x, and carla::geom::Vector3D::y.

Referenced by GetTurnTargetVelocity().

+ Here is the caller graph for this function:

◆ GetTurnTargetVelocity()

float carla::traffic_manager::MotionPlanStage::GetTurnTargetVelocity ( const Buffer waypoint_buffer,
float  max_target_velocity 
)
private

Definition at line 404 of file MotionPlanStage.cpp.

References carla::traffic_manager::constants::MotionPlan::FRICTION, GetThreePointCircleRadius(), and carla::traffic_manager::constants::MotionPlan::GRAVITY.

Referenced by Update().

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

◆ RemoveActor()

void carla::traffic_manager::MotionPlanStage::RemoveActor ( const ActorId  actor_id)
virtual

Implements carla::traffic_manager::Stage.

Definition at line 468 of file MotionPlanStage.cpp.

References pid_state_map, and teleportation_instance.

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

+ Here is the caller graph for this function:

◆ Reset()

void carla::traffic_manager::MotionPlanStage::Reset ( void  )
virtual

Implements carla::traffic_manager::Stage.

Definition at line 473 of file MotionPlanStage.cpp.

References pid_state_map, and teleportation_instance.

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

+ Here is the caller graph for this function:

◆ SafeAfterJunction()

bool carla::traffic_manager::MotionPlanStage::SafeAfterJunction ( const LocalizationData localization,
const bool  tl_hazard,
const bool  collision_emergency_stop 
)
private

◆ Update()

void carla::traffic_manager::MotionPlanStage::Update ( const unsigned long  index)
virtual

Implements carla::traffic_manager::Stage.

Definition at line 63 of file MotionPlanStage.cpp.

References carla::traffic_manager::TrackTraffic::AddTakenGrid(), carla::traffic_manager::constants::MotionPlan::ATTEMPTS_TO_TELEPORT, carla::rpc::VehicleControl::brake, buffer_map, collision_frame, CollisionHandling(), current_timestamp, carla::traffic_manager::DeviationCrossProduct(), carla::traffic_manager::DeviationDotProduct(), carla::geom::Location::Distance(), carla::client::Timestamp::elapsed_seconds, carla::road::EPSILON, carla::geom::Transform::GetForwardVector(), carla::traffic_manager::SimulationState::GetHeading(), carla::traffic_manager::TrackTraffic::GetHeroLocation(), GetLandmarkTargetVelocity(), carla::traffic_manager::Parameters::GetLaneOffset(), carla::traffic_manager::SimulationState::GetLocation(), carla::traffic_manager::Parameters::GetLowerBoundaryRespawnDormantVehicles(), carla::traffic_manager::Parameters::GetRespawnDormantVehicles(), carla::traffic_manager::SimulationState::GetRotation(), carla::client::World::GetSnapshot(), carla::traffic_manager::SimulationState::GetSpeedLimit(), carla::traffic_manager::Parameters::GetSynchronousMode(), carla::traffic_manager::GetTargetWaypoint(), carla::client::WorldSnapshot::GetTimestamp(), GetTurnTargetVelocity(), carla::traffic_manager::Parameters::GetUpperBoundaryRespawnDormantVehicles(), carla::traffic_manager::Parameters::GetVehicleTargetVelocity(), carla::traffic_manager::SimulationState::GetVelocity(), highway_lateral_parameters, highway_longitudinal_parameters, carla::traffic_manager::constants::SpeedThreshold::HIGHWAY_SPEED, carla::traffic_manager::constants::HybridMode::HYBRID_MODE_DT, carla::traffic_manager::constants::HybridMode::HYBRID_MODE_DT_FL, carla::traffic_manager::SimulationState::IsDormant(), carla::traffic_manager::TrackTraffic::IsGeoGridFree(), carla::traffic_manager::SimulationState::IsPhysicsEnabled(), carla::geom::Vector3D::Length(), local_map, localization_frame, carla::geom::Transform::location, carla::geom::Vector3D::MakeSafeUnitVector(), min(), carla::traffic_manager::constants::WaypointSelection::MIN_TARGET_WAYPOINT_DISTANCE, carla::traffic_manager::RandomGenerator::next(), output_array, parameters, carla::traffic_manager::constants::MotionPlan::PI, pid_state_map, random_device, carla::geom::Transform::rotation, carla::traffic_manager::PID::RunStep(), SafeAfterJunction(), simulation_state, carla::rpc::VehicleControl::steer, carla::traffic_manager::StateEntry::steer, carla::traffic_manager::constants::WaypointSelection::TARGET_WAYPOINT_TIME_HORIZON, teleportation_instance, carla::rpc::VehicleControl::throttle, tl_frame, track_traffic, carla::traffic_manager::SimulationState::UpdateKinematicHybridEndLocation(), carla::traffic_manager::SimulationState::UpdateKinematicState(), urban_lateral_parameters, urban_longitudinal_parameters, vehicle_id_list, world, and carla::geom::Vector3D::z.

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

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

Member Data Documentation

◆ buffer_map

const BufferMap& carla::traffic_manager::MotionPlanStage::buffer_map
private

Definition at line 27 of file MotionPlanStage.h.

Referenced by Update().

◆ collision_frame

const CollisionFrame& carla::traffic_manager::MotionPlanStage::collision_frame
private

Definition at line 35 of file MotionPlanStage.h.

Referenced by Update().

◆ current_timestamp

cc::Timestamp carla::traffic_manager::MotionPlanStage::current_timestamp
private

Definition at line 44 of file MotionPlanStage.h.

Referenced by Update().

◆ highway_lateral_parameters

const std::vector<float> carla::traffic_manager::MotionPlanStage::highway_lateral_parameters
private

Definition at line 33 of file MotionPlanStage.h.

Referenced by Update().

◆ highway_longitudinal_parameters

const std::vector<float> carla::traffic_manager::MotionPlanStage::highway_longitudinal_parameters
private

Definition at line 31 of file MotionPlanStage.h.

Referenced by Update().

◆ local_map

const LocalMapPtr& carla::traffic_manager::MotionPlanStage::local_map
private

Definition at line 46 of file MotionPlanStage.h.

Referenced by Update().

◆ localization_frame

const LocalizationFrame& carla::traffic_manager::MotionPlanStage::localization_frame
private

Definition at line 34 of file MotionPlanStage.h.

Referenced by Update().

◆ output_array

ControlFrame& carla::traffic_manager::MotionPlanStage::output_array
private

Definition at line 43 of file MotionPlanStage.h.

Referenced by Update().

◆ parameters

const Parameters& carla::traffic_manager::MotionPlanStage::parameters
private

Definition at line 26 of file MotionPlanStage.h.

Referenced by GetLandmarkTargetVelocity(), and Update().

◆ pid_state_map

std::unordered_map<ActorId, StateEntry> carla::traffic_manager::MotionPlanStage::pid_state_map
private

Definition at line 39 of file MotionPlanStage.h.

Referenced by RemoveActor(), Reset(), and Update().

◆ random_device

RandomGenerator& carla::traffic_manager::MotionPlanStage::random_device
private

Definition at line 45 of file MotionPlanStage.h.

Referenced by Update().

◆ simulation_state

SimulationState& carla::traffic_manager::MotionPlanStage::simulation_state
private

Definition at line 25 of file MotionPlanStage.h.

Referenced by CollisionHandling(), SafeAfterJunction(), and Update().

◆ teleportation_instance

std::unordered_map<ActorId, cc::Timestamp> carla::traffic_manager::MotionPlanStage::teleportation_instance
private

Definition at line 42 of file MotionPlanStage.h.

Referenced by RemoveActor(), Reset(), and Update().

◆ tl_frame

const TLFrame& carla::traffic_manager::MotionPlanStage::tl_frame
private

Definition at line 36 of file MotionPlanStage.h.

Referenced by Update().

◆ track_traffic

TrackTraffic& carla::traffic_manager::MotionPlanStage::track_traffic
private

Definition at line 28 of file MotionPlanStage.h.

Referenced by SafeAfterJunction(), and Update().

◆ urban_lateral_parameters

const std::vector<float> carla::traffic_manager::MotionPlanStage::urban_lateral_parameters
private

Definition at line 32 of file MotionPlanStage.h.

Referenced by Update().

◆ urban_longitudinal_parameters

const std::vector<float> carla::traffic_manager::MotionPlanStage::urban_longitudinal_parameters
private

Definition at line 30 of file MotionPlanStage.h.

Referenced by Update().

◆ vehicle_id_list

const std::vector<ActorId>& carla::traffic_manager::MotionPlanStage::vehicle_id_list
private

Definition at line 24 of file MotionPlanStage.h.

Referenced by Update().

◆ world

const cc::World& carla::traffic_manager::MotionPlanStage::world
private

Definition at line 37 of file MotionPlanStage.h.

Referenced by Update().


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