This project is my implementation of a navigation package, including the Hybrid A* planner and pure pursuit and LQR controller.
It also has a basic simulator for an Ackermann robot (using the bicycle model). This simulator has only the calculation parts. The visualization happens in RVIZ.
My implementation of Hybrid A* has the incremental searching and Reeds-Shepp curve searching. This generates acceptable results but it certainly can be improved more:
- avoid some very short path segments that are too hard to steer
- add additional cost for the paths closer to obstacles
Every code in this project was developed by myself using standard C++ and ROS tools.
This branch hawa_ros2 is the continued work of branch main.
I moved from ros1 to ros2, and finished some items in the to-do list:
- path validator for dynamic obstacles.
- Linear quadratic regulator controller, that controls the speed and steering fo the robot.
- re-organize the files in the project for better simplicity.
- gether all tunable parameters into one Json file to make it easy to tune.
It was developed and tested on ROS Humble on Ubuntu 22, on both x86 and RaspberryPi 4.
As shown in the last demo below, it was tested on a mini-ackermann robot platform, made of
- a RaspberryPi 4,
- a DC motor controller board,
- a LeiShen lsn10 2D lidar
- 2 DC motor for rear wheels
- a servo motor control the steering wheels
colcon build
The target pose is selected in RVIZ, using the 2D Nav Goal button.
The whole path is rendered in red color.
The green part is the current segment that the robot is following at the moment.
The big red dot (in front of the robot) on the path is the target point selected by the pure-pursuit controller.
GIF: Case 3: path around obstacle
This is a test running indoor.
For the controller, I was using LQR.
The SLAM module was GMapping.
Note the RVIZ window was very slow and laggy because the WiFi signal was terribly bad in that room.
The RVIZ process was running on a laptop, while everything else is running on robot's Raspberrypi 4.
The processes on robot was running smoothly. After the target pose is set (the big green arrow at the begining), the path is instantly found (the red curve), but it is not shown in the RVIZ until the last few seconds.
Just to quickly explain what does the this package do:
It receives the occupancy grid provided by the SLAM module, then add inflation into it. And publish the result so the path planner can plan the path with considering sufficient clearance from the obstacles.
- Finish refactoring the remaining parts in the reeds shepp curves code. (Currently, only CSC and CCC types are used)
- Improving the scoring method in RS curves so that it will prioritize the curves with fewer reversing motions. The current solution only considers the total length.
- Add feature: while searching for the path, hold multiple valid paths before terminating, so that it can have several options to choose from.