Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save iamdejan/650f511c2db8a41597bd216c41fcbfc1 to your computer and use it in GitHub Desktop.

Select an option

Save iamdejan/650f511c2db8a41597bd216c41fcbfc1 to your computer and use it in GitHub Desktop.
Hierarchical Motion Planning prompt
Hierarchical Motion Planning is a two-layer logic that allows self-driving cars to have a planned path at the beginning of the journey, while being able to avoid sudden collision with another moving object (e.g. other cars, pedestrians). Here is how the hierarchy typically works:
1. Layer 1: The Global Planner (The "GPS"):
- Algorithm: A*
- Input: A high-definition (HD) static map of the world (lanes, road boundaries, stop signs).
- Goal: Find the most efficient route from Point A to Point B.
- Characteristics: It is slow and computationally expensive because it considers a large area. It assumes the world is "static" (it doesn't know about a pedestrian walking across the street right now).
2. The Local Planner (The "Reflexes")
- Algorithm: RRT*
- Input: Real-time sensor data (LiDAR, Cameras) and a small segment of the Global Path.
- Goal: Ensure the car doesn't hit anything that just appeared. If a ball rolls into the road, the Local Planner deviates from the A* path to avoid it and then tries to merge back onto the A* path.
- Characteristics: It is extremely fast and operates in a small "look-ahead" window (e.g., the next 10–50 meters).
Implement Hierarchical Motion Planning that I've just described using ROS Noetic and C++ 17. The details are as follows:
- For C++ 17, prioritize using smart pointers instead of raw pointer, unless you have a good justification if you decide to use raw pointer. You have to add C++ documentation. The documentation should contain what is the function for (basically the description), a brief summary of the steps, and input and output parameters. If your function has the ability to throw panic, please state it in the documentation as well.
- Include 3D simulation in RViz and/or Gazebo using Turtlebot3 simulator, so that I can see how the robot reacts in the simulation. Turtlebot3 documentation for ROS Noetic is attached, and can be accessed using `rag-v1` tool.
Do not hallucinate. Make no mistake.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment