Skip to content

1. Task

In this task, we will demonstrate the implementation of the polynomial-based local planner presented in the theoretical class. First, let's update the arj_packages repository!

Clone and Build

cd ~/ros2_ws/src/arj_packages/
git pull
Then build the package named arj_local_planner!

cd ~/ros2_ws
colcon build --packages-select arj_local_planner

Execution

Next, let's run the planner using the launch file after sourcing.

source ~/ros2_ws/install/setup.bash
ros2 launch arj_local_planner run_all.launch.py

Check which topics have been created (in a new terminal)!

ros2 topic list

The /goal_pose topic and the /planner/trajectory topic have been created. The goal_pose is the target position for the planner, and the planner/trajectory is the waypoint list, the planned trajectory itself. Let's start an rviz!

ros2 run rviz2 rviz2

Select the map frame and add the /planner/trajectory topic. Then, using the 2D Goal Pose option from the top bar, set a goal pose on the grid in the positive coordinate direction! The planner will automatically fit a polynomial to the target position.

This simple planner can be used for moving targets (another vehicle, lane center, a point on the global trajectory, etc.) or static targets (e.g., parking spot).

2. Task

The second task is to set up the ROS 2 Navigation stack in a simulator on an empty track. Detailed documentation can be found on navigation.ros.org.

Clone and Build

cd ~/ros2_ws/src
git clone https://github.com/rosblox/nav2_outdoor_example

cd ~/ros2_ws
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

cd ~/ros2_ws
colcon build --packages-select nav2_outdoor_example

Execution

source ~/ros2_ws/install/setup.bash
ros2 launch nav2_outdoor_example bringup.launch.py

3. Task

The third task is to set up the ROS 2 Navigation stack in a simulator on one of the turtlebot tracks. Detailed documentation can be found on navigation.ros.org.

Clone and Build

sudo apt install ros-humble-navigation2 ros-humble-nav2-bringup ros-humble-turtlebot3-gazebo

cd ~/ros2_ws/src
git clone https://github.com/ros-controls/gz_ros2_control
git clone https://github.com/art-e-fact/navigation2_ignition_gazebo_example
cd ~/ros2_ws/src/gz_ros2_control
git checkout humble
cd ~/ros2_ws
rosdep install -y --from-paths src --ignore-src --rosdistro humble

cd ~/ros2_ws
colcon build --packages-select sam_bot_nav2_gz

Execution

Gazebo, RViz2, and Navigation2

source ~/ros2_ws/install/setup.bash
ros2 launch sam_bot_nav2_gz complete_navigation.launch.py

Setting a goal in RViz2:

source ~/ros2_ws/install/setup.bash
ros2 run sam_bot_nav2_gz follow_waypoints.py
source ~/ros2_ws/install/setup.bash
ros2 run sam_bot_nav2_gz reach_goal.py

Sources