This ROS package enables robots to autonomously navigate through predefined 2D waypoints while effectively avoiding obstacles. It integrates seamlessly with the ROS move_base
framework, buffering navigation goals and sequentially dispatching them upon command.
This project is part of the Autonomy Task at the European Rover Challenge 2019.
- Waypoint Buffering: Queue multiple navigation goals.
- Sequential Navigation: Automatically navigate through waypoints in order.
- Obstacle Avoidance: Utilize ROS
move_base
to avoid obstacles effectively. - Customizable Parameters: Control waypoint wait duration and waypoint arrival tolerance.
For source installation, follow this:
source /opt/ros/melodic/setup.bash
cd catkin_ws/src
git clone https://github.com/ArghyaChatterjee/waypoint-based-2D-navigation.git waypoint_nav_2d
cd ..
catkin build
source devel/setup.bash
cd catkin_ws/src/waypoint_nav_2d
For binary package installation, follow this:
sudo apt-get install ros-melodic-follow-waypoints
Most of the time, the data is in the form of a tiled image file. You can see in the ArcGIS website for more info.
First, convert the tiled map to image file with color inverted.
cd scripts
python3 convert_tiff_to_png.py
Then convert the image file to binary bit map.
python3 convert_png_to_bitmap.py
This will generate 2 files namely mapa100-binary_raster_res0.0744m_org-start600x320pix_inv.pgm
and mapa100-binary_raster_res0.0744m_org-start600x320pix.yaml
. Here is some metadata:
Map size: 647x615 px → 48.14m x 45.76m
Map Resolution: 0.0744
Image Name: mapa100-binary_raster_res0.0744m_org-start600x320pix.pgm
Origin (px): 600x320
Origin (m): [-44.63999999999999, -23.808, 0.0]
Negate: 0
Occupied_thresh: 0.65
Free_thresh: 0.196
There are in total of 25 coordinate points. They are:
- 19 Landmarks (Aruco Marker)
- 5 Waypoints
- 1 Start point
The original global coordinates are:
- latitude,
- longitude, and
- altitude
Convert the global coordinate to local x, y, z coordinates:
python3 convert_global_to_local_cordinate.py
The start point is:
start point: PSK_1 0.000 0.000 0.000
The waypoints to navigate are:
waypoint 1: PSK_25 8.040 -13.266 0.504
waypoint 2: PSK_13 4.365 -23.413 0.037
waypoint 3: PSK_17 -1.436 -37.767 -0.199
waypoint 4: PSK_20 -8.369 -31.065 -0.087
waypoint 5: PSK_24 -7.325 -24.162 -0.756
Save the above-mentioned list of waypoints to:
waypoint_nav_2d/saved_path/pose.csv
This CSV will also contain a list of robot's yaw heading after the robot reaches each waypoint.
A SLAMtec RPLidar A1 has been used during this project.
Launch the waypoint follower:
rosrun follow_waypoints follow_waypoints.py
Controls the pause duration between reaching one waypoint and navigating to the next. Default is 0.0
seconds (no wait).
rosparam set wait_duration 5.0
Triggers the robot to move to the next waypoint once it is within this threshold distance, resulting in smoother continuous navigation. Default is 0.0
(feature disabled).
rosparam set waypoint_distance_tolerance 0.5
The list of waypoints will be loaded from:
follow_waypoints/saved_path/pose.csv
Publish to the /start_journey
topic to initiate navigation using the previously saved waypoints:
rostopic pub /start_journey std_msgs/Empty -1
We sincerely thank the developers and contributors of Automatic Addison, Snowcron, Follow waypoints by SLAMCore, Follow waypoints by Qbotics Lab, Follow waypoints by daniel snider, Follow waypoints by Sugbuv, Follow waypoints ROS Tutorial, Follow waypoints in ROS2 Tutorial and Neo Goal Sequence Driver.