Skip to content

Path Planning

Tanish Bhatt edited this page Feb 5, 2024 · 4 revisions

Path Planning pkg

This package implements the algorithm for deciding the best path the vehicle (go-kart) should take when it approaches a corner. There are three nodes that communicate with each other to generate trajectories (paths), optimise/delete trajectories and send the final controlled state to the vehicle.


Nodes

Path Planning

Although not sure why it's not called 'trajectory generation' the node is designed to generate multiple trajectories for the vehicle. DANIEL - more details of the implementation here

Trajectory Optimization

Once trajectories have been generated you have to perform one crucial step prior to optimizing, i.e., finding the 'best' trajectory which is trajectory deletion. Therefore, there are two steps to do each time a set of trajectories have been generated by this node.

Deletion

It is possible that a single generated trajectory or many fall outside the boundaries of the given track and we would not want the car to choose this path as that could result in damage to the car or disqualification/loss of points in the competition. Hence, we must delete these invalid trajectories by simply checking if they intersect with the left or right boundaries, in the case they do they are removed from the feasible set.

Optimization

Once we have a valid set of trajectories, we can move on to select the best one. The current implementation is to make the vehicle take the trajectory closest to the centre line of the track to ensure a good distance from the boundaries due to the fact we are not representing a vehicle model with friction limits and only a section of the track is fed into these nodes so there is a possibility of an upcoming sharp corner which would be difficult for the vehicle to turn immediately if driving close to boundary.

The centre line of the track is predicted using the coordinate information of the left and right boundaries and the best/chosen trajectory is simply the one with the minimum distance from that predicted line.

Trajectory Following

Running Nodes

With a single command you run all the three nodes at once simultaneously. Copy and run the below command:

ros2 run path_planning path_planning

If you want to run these nodes with the fake cone map data (see Path Planning Visualization package) copy this command:

ros2 run path_planning path_planning --ros-args -p debug:=True

By default the trajectories are generated every 3 seconds, if you want to change this number, simple change the timer parameter similar to the above command.

Clone this wiki locally