This repository integrates the ROSA agent framework with a simulated TurtleBot3 robot using ROS 1 Noetic and the standard ROS Navigation stack (move_base).
The setup uses two Catkin workspaces to manage separate Python environments:
turtlebot3_ws: For TurtleBot3 simulation and navigation (Python 3.8).zrosa_ws: For ROSA agent code using a Python 3.9 virtual environment.
The ROSA agent accepts natural language commands and sends goals to the /move_base action server to control TurtleBot3.
final-project/
├── turtlebot3_ws/ # Workspace for TurtleBot3 simulation/navigation
│ └── src/
│ ├── turtlebot3/
│ ├── turtlebot3_msgs/
│ └── turtlebot3_simulations/
├── zrosa_ws/ # Workspace for ROSA Agent (Python 3.9 venv)
│ ├── venv_rosa/ # Python 3.9 virtual environment
│ └── src/
│ └── llm-ur-control/
│ └── ur_agent/ # ROSA agent package
│ ├── scripts/
│ │ ├── ur_agent.py
│ │ ├── locations.py
│ │ ├── llm.py
│ │ ├── prompts.py
│ │ └── help.py
│ ├── package.xml
│ └── CMakeLists.txt
└── README.md # This file
- Operating System: Ubuntu 20.04 LTS
- ROS Version: ROS 1 Noetic
- Python:
- System: Python 3.8
- Additional: Python 3.9 (
python3.9,python3.9-dev,python3.9-venv)
- Dependencies:
sudo apt install git python3.9 python3.9-dev python3.9-venv \ ros-noetic-joy ros-noetic-teleop-twist-joy \ ros-noetic-teleop-twist-keyboard ros-noetic-slam-gmapping \ ros-noetic-navigation ros-noetic-amcl \ ros-noetic-map-server ros-noetic-move-base \ ros-noetic-turtlebot3-simulations - Map Files: Create via:
rosrun map_server map_saver -f ~/map - OpenAI API Key: Required for LLM interaction.
git clone https://github.com/ASIFXS/final-project.git
cd final-project- Ensure only this line is sourced:
source /opt/ros/noetic/setup.bash - Comment or remove any lines that source workspace-specific
setup.bashfiles.
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9 python3.9-dev python3.9-venvcd ~/final-project/turtlebot3_ws
source /opt/ros/noetic/setup.bash
rosdep install --from-paths src --ignore-src -r -y
catkin_makecd ~/final-project/zrosa_ws
python3.9 -m venv venv_rosa
source venv_rosa/bin/activate
pip install --upgrade pip
pip install python-dotenv langchain openai rich pyinputplus numpy
source /opt/ros/noetic/setup.bash
catkin_makeEdit locations.py:
gedit ~/final-project/zrosa_ws/src/llm-ur-control/ur_agent/scripts/locations.pyModify the LOCATIONS dictionary with appropriate (x, y, yaw) values.
cd ~/final-project/zrosa_ws
gedit .envAdd:
OPENAI_API_KEY='sk-YourActualKeyHere'
Open 3 terminals. In each, export the model:
export TURTLEBOT3_MODEL=burgercd ~/final-project/turtlebot3_ws
source devel/setup.bash
roslaunch turtlebot3_gazebo turtlebot3_world.launchcd ~/final-project/turtlebot3_ws
source devel/setup.bash
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yamlUse the 2D Pose Estimate tool in RViz to localize the robot.
cd ~/final-project/zrosa_ws
source venv_rosa/bin/activate
source devel/setup.bash
rosrun ur_agent ur_agent.pyInteract with commands like:
> go to L1
> navigate to CENTER
- Location Points: Modify
locations.py - API Key: Ensure
.envfile is correctly set
catkin_makeerrors: Ensure correct dependencies inpackage.xmlandCMakeLists.txt. Source/opt/ros/noetic/setup.bashfirst.ModuleNotFoundError: Activate venv and install missing packages.move_basenot found: Ensure Navigation stack is running.- Poor localization: Re-estimate pose in RViz.
- Navigation fails: Check map for obstacles or localization accuracy.
Enjoy controlling your TurtleBot3 using natural language with ROSA!