This package does planning and navigation to the goal waypoint throught shortest path.
- Subscribes to odometry to locate the robot.
- Loads waypoints and their connections from a JSON file.
- Finds the nearest waypoint to current robot pose.
- Computes the shortest path using Dijkstra.
- Navigates through the computed path using
nav2
'sNavigateToPose
action.
- 📂 Clone the repository
mkdir -p ~/ros_ws/src
cd ~/ros_ws/src
git clone https://github.com/manojm-dev/waypoint_navigation.git
- 📦 Install dependencies
cd ~/ros_ws
sudo apt-get update -y && rosdep update && rosdep install --from-paths src --ignore-src -y
- 🛠️ Building the packages
cd ~/ros_ws
colcon build
These can be passed via --ros-args
cmd:
odom_topic
(odometery topic, default:/odom
)json_path
(path to json file, default:waypoint_navigation/data/waypoints.json
)waypoint_goal
(name of final destination waypoint, default:F
, input:A
toF
in the current setup)waypoint_limit
(max number of waypoints to process, default:100
)
ros2 run waypoint_navigation waypoint_navigator --ros-args -p waypoint_goal:="B"
[
{
"id": 0,
"name": "A",
"neighbours": [
"B",
"C",
"D"
],
"x": 0.000000000000000,
"y": 0.000000000000000
},
...
}
Made with ❤️ by Manoj M