This file was already explained above. The Extended Kalman Filter is used by the robot_localization_node (see rsp.launch.py). Note, however, that it is changed, compared to the section above:
Files like camera.xacro, colors.xacro, imu_sensor.xacro and so on were explained above, so we are not going to do it here. All these files are going to be included in the robot.urdf.xacro file, forming one large robot description file.
From the educational point of view, it is a good idea to take some kind of a file diff. tool (I use Meld) and to see what was changed in these files compared to navigation_bot_02, and why. One obvious example is the range of a lidar: I reduced it, so mapping now requires some driving around (lidar can not scan the entire world at once, its range is now not enough).
This is a "main" launch file of our project. In this file, we launch RViz, Gazebo and a "spawn entity" that adds our robot.
This file does most of the "launch" work. It creates the "joint_state_publisher_node" so our system knows where the wheels are. It launches the RViz. It launches the EKF-based robot_localization_node.
# In a first Terminal: $ ros2 run teleop_twist_keyboard teleop_twist_keyboard # In a second Terminal: $ cd ~/SnowCron/ros_projects/harsh $ colcon build --packages-select navigation_bot_03 $ source install/setup.bash $ ros2 launch navigation_bot_03 launch_sim.launch world:=src/worlds/maze.sdf # In a third Terminal: $ ros2 launch slam_toolbox online_async_launch.py use_sim_time:=True
Using multiple terminals is inconvenient, I am going to fix this problem in future sections. For now, we need online_async_launch.py (that comes as part of ROS2 navigation) to bring up the slam toolbox.
Click "Add" button in RViz, select "by topic" and "Map". Also make sure the "fixed_frame" in RViz is set to "map. As the robot runs around, it will create a map (a laser scan of walls around it). When map is complete, use RViz menu to save it to file.