39 float dt = 1.0f / 20.0f;
80 const std::vector<PlanItem> &plan,
81 bool stop_waypoint_creation =
true,
82 bool clean_queue =
true);
93 std::pair<SharedPtr<client::Waypoint>,
RoadOption>
97 const std::deque<PlanItem> &
GetPlan()
const;
LocalPlanner reproduces agents.navigation.local_planner.LocalPlanner.
void ComputeNextWaypoints(std::size_t k)
Append up to k waypoints to the back of the queue, branching with random choice on intersections (mir...
VehiclePIDController::LongitudinalArgs _longitudinal_args
std::deque< PlanItem > _waypoints_queue
SharedPtr< client::Vehicle > _vehicle
std::size_t _min_queue_length
SharedPtr< client::Waypoint > _target_waypoint
SharedPtr< client::Map > _map
rpc::VehicleControl RunStep(bool debug=false)
Drive one tick. Returns the VehicleControl to apply.
RoadOption TargetRoadOption() const
Currently active target RoadOption (mirrors target_road_option).
bool _follow_speed_limits
bool _stop_waypoint_creation
std::size_t _max_queue_size
void InitController()
Build the VehiclePIDController and seed the queue with the vehicle's current waypoint.
void FollowSpeedLimits(bool value=true)
Toggle automatic following of road speed limits.
SharedPtr< client::Waypoint > TargetWaypoint() const
Currently active target waypoint (mirrors target_waypoint).
void SetSpeed(float speed_kmh)
Override the target speed in km/h.
static Options DefaultOptions()
Construct a LocalPlanner.
VehiclePIDController::LateralArgs _lateral_args
bool Done() const
True when the queue is empty.
void SetGlobalPlan(const std::vector< PlanItem > &plan, bool stop_waypoint_creation=true, bool clean_queue=true)
Replace (or append to) the waypoint queue.
const std::deque< PlanItem > & GetPlan() const
Read-only view of the queued plan.
std::pair< SharedPtr< client::Waypoint >, RoadOption > GetIncomingWaypointAndDirection(int steps=3) const
Peek steps ahead in the queue, falling back to the last entry if the queue is too short.
std::unique_ptr< VehiclePIDController > _vehicle_controller
void SetOffset(float offset)
Apply a lateral offset to the underlying PID controller.
RoadOption _target_road_option
void ResetVehicle()
Drop the vehicle reference (mirrors reset_vehicle).
std::pair< SharedPtr< client::Waypoint >, RoadOption > PlanItem
RoadOption
Topological direction emitted by the planners.
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr
Aggregated configuration. Mirrors the opt_dict in local_planner.py.
VehiclePIDController::LongitudinalArgs longitudinal
VehiclePIDController::LateralArgs lateral