Enter the folder
cd turtlebot4-dockerPull the latest docker containers
docker compose -f compose-physical.yaml pullRequired environmental variable need to be in a .env file. An example.env file is available. Rename that file to .env and update the values as required.
For the real robot operation, following parameters are relevant. In this scenario, the turtlebot4 robot (The raspberry pi 4 on the robot), contains the discovery server.
We connect our system (whatever we develop) with that, using following parameters.
ROBOT_ROS_DOMAIN_ID=10
ROBOT_ROS_DISCOVERY_SERVER=10.0.0.192:11811ROS_DISCOVERY_SERVER
Each robot has a small display near its Power button. That shows the IP address. Other option is to connect to the Rpi's Ethernet via Ethernet cable and connect to the robot. Set remote machine's IP address 192.168.185.10, NetMask 255.255.255.0 and use SSH to connect. Use following command. Password is turtlebot4
ssh ubuntu@192.168.185.3Once in the robot, use one of the following commands to check the ip address
ros2 topic echo /ipip a #look for wlanOn your host macchine use this as the IP address for ROS_DISCOVERY_SERVER. Port is 11811
ROS_DOMAIN_ID
Use the domain id of the robot, generally this is matched to the robot's name. If the robot is TBOT4-001, the ROS_DOMAIN_ID is 1.
Otherway to find out is SSH into the robot and run the following command
echo $ROS_DOMAIN_IDOnce these parameters has been identified update the .env file to match.
SSH into the robot and run the following command to start the SLAM process
ros2 launch turtlebot4_navigation slam.launch.pyMove the robot using joystick/teleop to map the room.
Give a name to the map file so the map can be saved.
SSH into the robot and run the following command to start the localization process. Update the "map:=crlab.yaml" parameter with the correct file name.
ros2 launch turtlebot4_navigation localization.launch.py map:=crlab.yamlUse the 2D pose Estimate tool to align the robot's laser scan with the map.
Note: Comparatively, SLAM is more resource intensive compared to localization. So its often recommended to use the localization where ever possible for long term exections
Update the .env as mentioned above. Then,
Allow permission for UI interfaces from docker containers and start the containers.
xhost +local:root
docker compose -f compose-physical.yaml up