- Software Division
- Software Division Home
[ Software Division : Path Planning Code Flow May 2020 ]
Created by [ Charles Zhang] on May 13, 2020
Main local_planning ROS Node:
https://git.uwaterloo.ca/WATonomous/decision/blob/develop/local_planning/ros_main.cpp
Inputs:
/navsat/odom
- Position, velocity, heading
/path_planning/environment
- Road signage, dynamic objects, traffic signals
/path_planning/global_command
- List of link_ids (analagous to roads) to traverse with
left_turn, right_turn instructions.
Main
Loop: https://git.uwaterloo.ca/WATonomous/decision/blob/develop/local_planning/ros_main.cpp#L210
- Plan Lane level route (Global
Interface)
- Evaluate behavioural planner (Behavioural
Planner)
- Update dynamic object state (Occupiable
Objects)
- Plan with
Frenet
- Publish path to Controller (MPC/PID) (out of the scope of this
document)
**Global Interface
**
- Takes` /path_planning/global_command`, which is a high level
path traversing roads, and converts it to a low level path
traversing lanes
- Uses the HDM Interface defined in the localization node
(https://git.uwaterloo.ca/WATonomous/localization/tree/develop/hdmap_processing/srv),
Documentation: HDM Service
- Key API:
GlobalInterface::planLaneRoute()
Based on the list of link_ids in the global command (stored as
a
queue),
update the current route so that it reaches to the next link id
in the global command queue. If updating the current path is
impossible, it will try to replan. If that again is impossible,
it will throw and we publish a global reroute
instruction
Returns: The current
LANE we
are on, and the next lane we want to be on. If a lane change is
required, the two lanes will be different. Otherwise, they will
be the same.
GlobalInterface::NearIntersection()
Returns BOOL based on our distance to the next global command.
LaneTopology& getTopology()
Returns
the Lane
Topology
(unordered_map of lane_id to
Lane
struct) as populated by the global interface during planning.
Should be used in the behavioural planner to get lane
information. Note
RoadLines
are physical lines on the ground.
Lanes
are the hypothetical grouping of two adjacent RoadLines that
form a lane that we drive down the center of. Note the Lane
class is an instance of std::vector, and contains the points
denoting the center of that lane.
- Other generic API that i'm sure you can figure
out
- Pseudocode for the main planning
algorithm: https://git.uwaterloo.ca/WATonomous/decision/merge_requests/245
- PR for the global
interface https://git.uwaterloo.ca/WATonomous/decision/merge_requests/253/diffs
Behavioural Planner
- Currently barely used and barely functional. Behavioural planner
has a reference to the global
interface
and can thus access any of the global interface's APIs.
- Only functional and used bit of code is the code to decide which
blinker to turn on (thanks
ray)
- Useful
Util:
findClosestPolylineIndex(
https://git.uwaterloo.ca/WATonomous/decision/blob/develop/behavioral/behavioral_planner.cpp#L31 )
- Does what the name and it's comment says. Broken since I
modified the LaneTopology structure. Instead of taking a
Vector<T>, it should take a Lane
Topology
- State machine that Oswaldo wrote last year. Works, not being
compiled right
now. https://git.uwaterloo.ca/WATonomous/decision/blob/develop/behavioral/StateMachine.h
- Documentation and ideas for the lane changing Behavioural planner
from W20: Behavioral. Corresponding merge
request: https://git.uwaterloo.ca/WATonomous/decision/merge_requests/243
- Baseline idea is to modify the lane level path from Global
Interface so that it avoid construction/blocked lanes and only
makes the lane change when it's most reasonable and safe to do.
READ THE DOCUMENTATION: Behavioral
- TODO: Integrate NearIntersection, Fix findClosestPolyline, Fix
picking out the left/right
The HPP file could use some cleaning up. I've already commended out all
the code in
behavioural_planner.cpp
BehaviouralState,
BehavioralPlannerStateManager,
the
constants,
and anything else related to the old behavioural planner should be
deleted
Occupiable Objects
Unchanged since summer of 2020. We finally have the opportunity to test
traffic lights in CARLA. Turns out, they don't work! Fix it
.
There are also some dirty hacks since Processing tracking doesn't work
at all. We're currently ignoring object IDs and assuming there's one
of each object. This should be removed (Charles
Zhang{.confluence-userlink
.user-mention}) since we have reliable IDs in CARLA, and hopefully
processing will get on their shit
Wiki: Occupiable Objects
Plan with Frenet
<TODO_BEN>
\
Document generated by Confluence on Dec 10, 2021 04:01
Atlassian