The following tutorial will help you get started with rai using Turtlebot4 simulation. The step by step video tutorial is available here.
-
Install nav2 packages
sudo apt install "ros-${ROS_DISTRO}-nav2-*"
-
Clone and install rai
- Follow steps from 1. Setting up the workspace
- Then follow steps from 2. Build the project
-
O3DE simulation setup
-
Download turtlebot4 simulation binary matching your platform from :
cd rai # ubuntu 22.04 ~ humble wget https://robotec-ml-roscon2024-demos.s3.eu-central-1.amazonaws.com/ROSCON_Release/Turtlebot4Tutorial_1.0.0_jammyhumble.zip # ubuntu 24.04 ~ jazzy wget https://robotec-ml-roscon2024-demos.s3.eu-central-1.amazonaws.com/ROSCON_Release/Turtlebot4Tutorial_1.0.0_noblejazzy.zip
-
Unzip it:
# for Ubuntu 22.04 jammy and ros2 humble unzip -d src/examples/turtlebot4/simulation Turtlebot4Tutorial_1.0.0_jammyhumble.zip # for Ubuntu 24.04 noble and ros2 jazzy unzip -d src/examples/turtlebot4/simulation Turtlebot4Tutorial_1.0.0_noblejazzy.zip
-
-
Setup your LLM vendor in config.toml and configure access keys as in docs/vendors.md. OpenAI or AWS Bedrock are recommended for models, since current local
ollama
models don't support vision & tool calling.ollama
andllama:3.2
as an embedding model generate acceptable quality of robot's indentity in this tutorial creating identity -
Configure
rai_whoami_node
(based on "Your robot identity in RAI" tutorial):-
Create
whoami
package for turtlebot4 insrc/examples/turtlebot4
./scripts/create_rai_ws.sh --name turtlebot4 --destination-directory src/examples
TIP
Skip steps 2-4 by downloading generated files here unzip them tosrc/examples/turtlebot4_whoami/description/generated
with a command:unzip -d src/examples/turtlebot4_whoami/description turtlebot4_whoami_generated.zip
-
Download official turtlebot4 data sheet into
src/examples/turtlebot4_whoami/description/documentation
-
Download image of turtlebot4 into
src/examples/turtlebot4_whoami/description/images
-
Create robot's identity. Run the
parse_whoami_package
. This will process the documentation, building it into a vector database, which is used by RAI agent to reason about its identity../scripts/parse_whoami_package.sh src/examples/turtlebot4_whoami # you will be asked to press `y` to continue
-
Build the workspace which now includes the new package
deactivate # if poetry env is activated colcon build --symlink-install
-
Ensure
turtlebot4_whoami
package has been built:. ./setup_shell.sh ros2 pkg list | grep turtlebot4
Congratulations! Your
rai_whoami_node
is configured. In the following steps your RAI agent will assume a turtlebot4 personality. -
-
Run rai agent:
ros2 launch ./src/examples/turtlebot4/turtlebot.launch.xml \ game_launcher:=./src/examples/turtlebot4/simulation/TurtleBot4DemoGamePackage/TurtleBot4Demo.GameLauncher
You should be able to see a simulation scene.
TIP
Press 1, 2 or 3 on the keyboard when simulation window to change the camera. Use W,A,S,D to move the camera. -
Open you internet browser and go to
localhost:8501
-
You can interact with your RAI agent through the chat. On the left you can communicate with the RAI HMI Agent. On the right you will see status of missions that were send to the RAI Node and are executed on your robot.
HMI Agent
is responsible for human-robot interaction.RAI Node
is responsible for executing tasks on the robot.
For example you can try the following prompts:
- Testing robot's identity & RAG:
- who are you?
- what is the voltage of the battery and the diameter of the wheels?
- Testing ROS 2 connection:
- What are your ros2 interfaces?
- What do you see?
- Spin yourself left by 45 degrees and drive 1 meter forward
My robot doesn't have an identity.
-
Query
rai_whoami_node
for the identity manuallyros2 service call /rai_whoami_identity_service std_srvs/srv/Trigger
-
Make sure all required files were generated correctly in the
turtlebot4_whoami
package and have similar sizes to those listed below.ls -sh src/examples/turtlebot4_whoami/description/ total 52K 4.0K documentation 4.0K images 28K index.faiss 8.0K index.pkl 4.0K robot_constitution.txt 4.0K robot_identity.txt
You can also check the contents of
robot_identity.txt
file (it is generated by LLM, but should be similar to the one below).cat src/examples/turtlebot4_whoami/description/robot_identity.txt I am a TurtleBot® 4, a robotics learning platform designed for education and research in robotics. This next-generation mobile robot is built on the iRobot® Create® 3 mobile base and comes fully assembled with ROS 2 installed and configured, making it accessible for beginners and experienced developers alike. ...
If files above are incorrect please check your vendor configuration is as described in docs/vendors.md and rerun point 4 of this tutorial.
Robot doesn't move in the simulation.
-
Make sure you can see ros2 topic simulation binary is running
-
Run the binary manually:
cd src/examples/turtlebot4/simulation/ ./TurtleBot4DemoGamePackage/TurtleBot4Demo.GameLauncher -bg_ConnectToAssetProcessor=0
-
Check ros2 topics:
ros2 topic list
-
Verify if Turtlebot simulation binary publishes such topics:
/camera_color_info /camera_image_color /clock /cmd_vel /parameter_events /rosout /scan /tf
-
-
Make sure navigation stack actions work correctly:
-
Run binary as in the step above.
-
Run navigation stack:
cd src/examples/turtlebot4 ./run-nav.bash
-
Check available actions:
ros2 action list
-
Verify if such actions are available:
/backup /navigate_to_pose /spin
-
Try to run one of them from command line:
ros2 action send_goal /spin nav2_msgs/action/Spin "{target_yaw: 3.14}"
-