SLAM and Navigation
SLAM
Troubleshooting
Date and Time off
one of the major problems with the Turtlebot 4 and communication is the time. Make sure you use the date
command and check what time it is. If the time is off use rasp-config
to set the correct timezone. The standard Turtlebot 4 image does not have rasp-config install so you will probably have to install it with sudo apt install rasp-config
.
The map keeps getting all messed up
try driving slower and not using the R1 shoulder button that puts the turtlebot in high speed.
The controller keeps disconnecting
Try pairing the controller to the computer so that you do not have to stay by the robot as it drives and maps. To pair the controller to the computer and drive it install the joy node.
Then pair the controller to the computer like normal. Once the controller is paired start the node by running this command. Once this command is running then you should be able to drive the robot like normalLaunching the SLAM command
Here is the slam.yaml
config file. You can change the resolution by changing the resolution parameter, by default it is 0.05 but i have had great success when running synchronous SLAM with values as low as 0.01.
To start the SLAM node using this command on the remote PC. If this command is run on the Turtlebot 4 you will have a smother experience and will not have as much trouble with connecting but this will limit your resolution because the raspberry pi 4 will have to do all the calculations.
To visualize the map run Rviz on the remote PC.Once you are done creating the map make sure you save it.
Navigation
To launch the navigation program on the Turtlebot 4 run the following commands. One per terminal window making sure to execute them on the Remote PC.
# Terminal Window 1
ros2 launch turtlebot4_navigation localization.launch.py map:/path/to/map.yaml
# Terminal Window 2
ros2 launch turtlebot4_navigation nav2.launch.py
# Terminal Window 3
ros2 launch turtlebot4_viz view_robot.launch.py
Use the 2D Pose Estimate
to select the spot on the map were the robot is at when the Navigation is launched. Then use the Nav2 Goal
button to select where the robot should navigate to.