/path_planning

Create Nav2 plugin for path planning using dijkstra algorithm.

Primary LanguageC++

Path Planning

The aim of the project is to implement Dijkstra's Algorithm as Nav2 Plugin enabling a robot to be able to work autonomously using navigation stack.

ros cpp python

Structure

.
├── cartographer_slam
├── localization_server
├── map_server
├── nav2_dijkstra_planner
│   ├── include
│   │   └── nav2_dijkstra_planner
│   │       ├── nav2_dijkstra_planner.hpp
│   │       └── straight_line_planner.hpp
│   ├── src
│   │   ├── nav2_dijkstra_planner.cpp
│   │   └── straight_line_planner.cpp
│   ├── CMakeLists.txt
│   ├── nav2_dijkstra_planner_plugin.xml
│   └── package.xml
├── neo_nav2
├── parameter_tests
├── path_planner_server
└── README.md

Setup

Distribution

Use docker for quick-start (for both ROS1 or ROS2):

# using docker for ROS1
$ docker run -ti --rm --name local-ros-noetic ros:noetic
# using docker for ROS2
$ docker run -ti --rm --name local-ros-galactic ros:galactic

Build (Package)

Now, create a ros2 workspace, clone the package:

# setup directory
$ mkdir ~/ros2_ws/src/
$ git clone <repo_name> ~/ros2_ws/src/

Install the required packages (dependency) mentioned in package.xml using apt:

# check if package is available
$ ros2 pkg list
$ ros2 node list
# update path to installed packages
$ source /opt/ros/galactic/setup.bash

To build locally or inside docker use the following commands:

# execute build
$ cd ~/ros2_ws && colcon build
$ source ~/ros2_ws/install/setup.bash

Robot

The MP-400 is a versatile mobile robot designed for flexible material transport within industrial intra logistics, equipped with advanced AMR control software and full ROS 2 support for a wide range of applications, from carrying special equipment to serving as an experimental system in robotics research.

robot-neo

Note: Check more details about MP-400 from here.

Launch

The Navigation2 (Nav2) stack for ROS 2 includes a variety of plugins for path planning, enabling robots to navigate complex environments autonomously. To update the planner algorithm update plugin parameter in planner_server.yaml.

GridBased:
  plugin: "nav2_dijkstra_planner/DijkstraGlobalPlanner"
  tolerance: 0.5
  use_astar: false
  allow_unknown: true

Build the complete project and launch the simulation to view parameter change effect.

$ ros2 launch neo_nav2 neo_nav2_full.launch.xml

In rviz select the 2D Nav Goal tool for sending navigation goals to navigation stack.

neo-path-planning

Specifications

Dijkstra's Algorithm

Dijkstra's algorithm is used to find the shortest paths from a source vertex to all other vertices in a graph with non-negative edge weights. Below is the pseudocode representation of Dijkstra's algorithm:

code

Roadmap

  • Part 1 : Update the path planner in Navigation stack.
  • Part 2 : Implement Dijkstra's Algorithm in C++.

See the open issues for a full list of proposed features (and known issues).

Tools

System tool/modules used for project development.

License

Distributed under the MIT License. See LICENSE.txt for more information.