-
Install Ignition-Edifice or greater.
-
Build ros_ign packages for foxy from source as the binaries on apt are only supported for Ignition-Citadel as of now so some features might not work with the package from apt.
-
Create a workspace
mkdir -p colcon_ws/src && cd colcon_ws/src
- Clone the repo
- Build the workspace & source the setup
colcon build --symlink-install
source install/setup.bash
Ign-Gazebo
ros2 launch igt_ignition igt_ignition.launch.py
ros2 launch igt_ignition igt_ignition.launch.py with_bridge:=true
Make sure you UNPAUSE physics by clicking "play" button in bottom left corner of ignition
and then open another terminal and run
ros2 run teleop_twist_keyboard teleop_twist_keyboard
ign topic -t "/model/igt_one/cmd_vel" -m ignition.msgs.Twist -p "linear: {x: 2.0}, angular: {z: 0.0}"
ign topic -t "/igt_one/laserscan" -e
ign topic -t "/model/igt_one/odometry" -e
-
Install slam_toolbox from apt for ros2 foxy using:
sudo apt install ros-foxy-slam-toolbox
-
Launch the simulation in ignition gazebo with ros_ign_bridge using:
ros2 launch igt_ignition igt_ignition.launch.py with_bridge:=true
-
Make sure you UNPAUSE physics by clicking "play" button in bottom left corner of ignition
-
Open another terminal and launch slam_toolbox for mapping and rviz2 using
online_sync_launch.py
fromigt_nav
package:ros2 launch igt_nav online_sync_launch.py
-
Open another terminal and run the ros2
teleop_twist_keyboard
node using:ros2 run teleop_twist_keyboard teleop_twist_keyboard
-
Use teleop to control the bot and map the world (as shown in the gif below). Save the map using:
ros2 run nav2_map_server map_saver_cli -f name_of_map_file
-
Install navstack2 for ros foxy.
-
Launch the simulation in ignition gazebo using:
ros2 launch igt_ignition igt_ignition.launch.py with_bridge:=true
-
Make sure you UNPAUSE physics by clicking "play" button in bottom left corner of ignition
-
Launch navigation2 using
navigation2.launch.py
launch file:ros2 launch igt_nav navigation2.launch.py
This launches the
bringup.launch.py
launch file fromnav2_bringup
package andmap/lab_map.yaml
andconfig/nav2.yaml
from igt_nav package as map and params_file. It also runs the rviz2 node with nav2 rviz config from nav2_bringup package. -
In rviz2, use
2D Pose Estimate
to provide initial pose of the bot to amcl so that it can start publishing the robot's pose &map->odom tf
. -
After providing the initial pose of the bot you will see the rviz2 window updating with estimated robot pose from amcl as well as updated global and local costmap. Use the
2D Goal Pose
in rviz2 to provide the bot with a goal pose to start navigation. (shown below in gif)