18#include <unordered_map>
38 class GlobalRoutePlanner;
65 float target_speed_kmh = 20.0f,
85 std::optional<geom::Location> start = std::nullopt);
87 void SetGlobalPlan(
const std::vector<LocalPlanner::PlanItem> &plan,
88 bool stop_waypoint_creation =
true,
89 bool clean_queue =
true);
91 std::vector<LocalPlanner::PlanItem>
107 float same_lane_time = 0.0f,
108 float other_lane_time = 0.0f,
109 float lane_change_time = 2.0f);
118 std::pair<bool, SharedPtr<client::TrafficLight>>
120 std::optional<float> max_distance = std::nullopt);
131 std::optional<float> max_distance = std::nullopt,
132 float up_angle_th = 90.0f,
133 float low_angle_th = 0.0f,
134 int lane_offset = 0);
140 const std::string &direction =
"left",
141 float distance_same_lane = 10.0f,
142 float distance_other_lane = 25.0f,
143 float lane_change_distance = 25.0f,
145 int lane_changes = 1,
146 float step_distance = 2.0f);
156 std::unordered_map<uint32_t, SharedPtr<client::Waypoint>>
_lights_map;
C++ port of agents.navigation.basic_agent.BasicAgent.
SharedPtr< client::Map > _map
bool _ignore_traffic_lights
std::pair< bool, SharedPtr< client::TrafficLight > > AffectedByTrafficLight(SharedPtr< client::ActorList > lights=nullptr, std::optional< float > max_distance=std::nullopt)
Returns (affected, light) similar to Python _affected_by_traffic_light.
void SetOffset(float offset)
VehicleObstacle VehicleObstacleDetected(SharedPtr< client::ActorList > vehicles=nullptr, std::optional< float > max_distance=std::nullopt, float up_angle_th=90.0f, float low_angle_th=0.0f, int lane_offset=0)
Mirrors Python _vehicle_obstacle_detected.
rpc::VehicleControl AddEmergencyStop(rpc::VehicleControl c) const
Overwrites throttle/brake to perform an emergency stop.
void IgnoreTrafficLights(bool active=true)
SharedPtr< client::World > _world
static Options DefaultOptions()
Out-of-line default factory; see LocalPlanner::DefaultOptions().
SharedPtr< client::ActorList > _lights_list
void IgnoreVehicles(bool active=true)
void SetTargetSpeed(float speed_kmh)
void SetGlobalPlan(const std::vector< LocalPlanner::PlanItem > &plan, bool stop_waypoint_creation=true, bool clean_queue=true)
void FollowSpeedLimits(bool value=true)
SharedPtr< client::TrafficLight > _last_traffic_light
std::vector< LocalPlanner::PlanItem > TraceRoute(SharedPtr< client::Waypoint > start, SharedPtr< client::Waypoint > end)
float _base_vehicle_threshold
SharedPtr< client::Vehicle > _vehicle
std::vector< LocalPlanner::PlanItem > GenerateLaneChangePath(SharedPtr< client::Waypoint > waypoint, const std::string &direction="left", float distance_same_lane=10.0f, float distance_other_lane=25.0f, float lane_change_distance=25.0f, bool check=true, int lane_changes=1, float step_distance=2.0f)
Mirrors Python _generate_lane_change_path.
virtual rpc::VehicleControl RunStep()
float _base_tlight_threshold
std::unordered_map< uint32_t, SharedPtr< client::Waypoint > > _lights_map
virtual ~BasicAgent()=default
SharedPtr< GlobalRoutePlanner > _global_planner
float _sampling_resolution
std::unique_ptr< LocalPlanner > _local_planner
void SetDestination(const geom::Location &end, std::optional< geom::Location > start=std::nullopt)
Computes a route from start (or the current target waypoint) to end and forwards it to the local plan...
void IgnoreStopSigns(bool active=true)
GlobalRoutePlanner * GetGlobalPlanner()
LocalPlanner * GetLocalPlanner()
C++ port of agents.navigation.global_route_planner.GlobalRoutePlanner.
LocalPlanner reproduces agents.navigation.local_planner.LocalPlanner.
Represents an actor in the simulation.
road::element::LaneMarking::LaneChange LaneChange
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr
bool ignore_traffic_lights
float base_vehicle_threshold
float detection_speed_ratio
float base_tlight_threshold
float sampling_resolution
SharedPtr< client::Actor > actor
Aggregated configuration. Mirrors the opt_dict in local_planner.py.