Maze Solver Bot Simulation
- ROS2 Humble/Iron
- OpenCV
- Gazebo
git clone https://github.com/Kuljot/maze_solver.git
cd maze_solver
colcon build
After sourcing the workspace
source install/setup.bash
Run
ros2 launch maze_solver launch_sim.launch.py
You will seethe simulation of a differential drive bot in gazebo , a maze is surrounding the bot.
And a camera overhead.
ros2 run teleop_twist_keyboard teleop_twist_keyboard
ros2 run maze_solver bot_localizer_node
It will use the camera's input image to localise the bot using the smallest contour size detection also apply thinning method to convert the free path into graph. You can see the intermediate steps of image processing for bot localisation.
It will also show a node graph in which end-nodes are shown in red with indices, tri junctions in blue and turning points in green.
ros2 run maze_solver ros2 run maze_solver path_planner_node 5
If the localization node is still running then you can run the above path planning node with an intezer argument that is the end-node index. It will find the nearest node to the bot and use an A* algorithm to trace the path to go to the input node. Blue path represents the A* search traversal and green path is the shortest path.
ros2 launch maze_solver slam.launch.py
After that you can drive the bot around to create the map. Add the slam toolbox plugin from Rviz->Panels->Add New Panel
Once the plugin is added you can save the map using Save Map button.
Launch the navigation framework using
ros2 launch maze_solver custom_nav2_bringup.launch.py
Give the goal
ros2 launch maze_solver autonomy.launch.py
It will make the bot visit points defined in config/locations.yaml
ros2 run maze_sover go_to_goal_node X Y
Here X & Y are coordinates of the goal point.