Welcome to the ROSbot Tutorials repository! This repository contains detailed instructions for working with the ROSbot 2.0 to complete assignment projects and classwork in the Experimental Robotics course π.
Before you begin, ensure you meet the following requirements:
- Access to a ROSbot 2.0.
- A compatible computer for programming and simulation:
- Linux Distribution (specifically Ubuntu 20.04) is recommended for compatibility with ROS 1 Noetic and ROS 2 Foxy.
- Use one of the following methods if you don't have native Linux:
- Virtual Machine
- Docker
- WSL (Windows Subsystem for Linux)
- Dual Boot PC
- ROS 1 Noetic and ROS 2 Foxy installed on your computer.
Important
Ensure your hardware and software setup meets the course's requirements to avoid issues during the project.
- Connect your laptop to the [FRITZ!Box 6850 XU] WiFi or the specific WiFi the robots are connected to.
- WiFi Password:
06537900605465042712
- WiFi Password:
- Turn on the ROSbot and wait for about 2 minutes for it to boot up.
- Copy the IP Address written on the robot. This will be referred to as
<ROBOT_IP>
.
Note
Ensure your laptop is on the same WiFi network as the ROSbot to establish a connection.
- Open a terminal and run the following command to SSH into the robot:
ssh husarion@<ROBOT_IP>
- Password:
husarion
- Password:
- Ensure your laptop is connected to the same WiFi as the ROSbot.
- Get the IP address of your laptop:
hostname -I
- Use the IP starting with
192.168.178.XX
if multiple IPs are listed. This will be referred to as<PC_IP>
.
- Use the IP starting with
- Open your
.bashrc
file for editing:gedit ~/.bashrc
- Add the following lines to your
.bashrc
file:export ROS_MASTER_URI=http://<ROBOT_IP>:11311 export ROS_IP=<PC_IP>
- Save the file and source it:
source ~/.bashrc
- Go back to the terminal where you SSHβd into the robot and run:
roslaunch tutorial_pkg all.launch
- Open a new terminal on your laptop and run:
rostopic list
- Ensure you DO NOT run
roscore
on your laptop, as the ROSbot is the ROS Master.
- Ensure you DO NOT run
Caution
Running roscore
on your laptop while connected to the ROSbot will cause conflicts with the ROSbot's master node.
- You can now use your ROS workspace on your laptop to control the robot.
- Move the robot:
rosrun teleop_twist_keyboard teleop_twist_keyboard
- View camera feed:
rosrun image_view image_view image:=/camera/rgb/image_raw _image_transport:=compressed
- Visualize laser scan and TF in RViz:
rviz
Note
If any of these commands fail due to missing packages, install them using:
sudo apt install ros-noetic-PACKAGE_NAME
To use ROS 2 to control the robot, follow these additional steps:
- Follow the instructions here to install ROS 2 Foxy.
Install the ros1_bridge
package to enable communication between ROS 1 and ROS 2:
sudo apt install ros-foxy-ros1-bridge
-
Create a ROS 1 workspace:
mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src catkin_create_pkg load_params cd load_params mkdir launch params touch launch/load_params.launch params/topics.yaml
-
Add the following code to
launch/load_params.launch
:<launch> <rosparam command="load" file="$(find load_params)/params/topics.yaml"/> </launch>
-
Add the following to
params/topics.yaml
:topics: [ { topic: /tf, type: tf2_msgs/msg/TFMessage, queue_size: 10 }, { topic: /camera/rgb/image_raw/compressed, type: sensor_msgs/msg/CompressedImage, queue_size: 10 }, { topic: /cmd_vel, type: geometry_msgs/msg/Twist, queue_size: 10 }, { topic: /odom, type: nav_msgs/msg/Odometry, queue_size: 50 }, { topic: /scan, type: sensor_msgs/msg/LaserScan, queue_size: 50 }, ]
Important
Ensure the correct message types and queue sizes for your application.
- Compile the workspace:
cd ~/catkin_ws/ catkin_make source devel/setup.bash
- Open three terminal shells and source the appropriate environments:
- Shell 1:
source /opt/ros/noetic/setup.bash
- Use this shell for ROS 1 operations.
- Shell 2:
source /opt/ros/noetic/setup.bash source /opt/ros/foxy/setup.bash
- Use this shell to run the ROS 1 Bridge.
- Shell 3:
source /opt/ros/foxy/setup.bash
- Use this shell for ROS 2 operations.
- Shell 1:
- In the shell where ROS 1 was sourced, start the parameter server:
roslaunch load_params load_params.launch
- Run the bridge in the terminal with both Noetic and Foxy sourced:
ros2 run ros1_bridge parameter_bridge
To access the ROSbot remotely over the internet through a VPN connection, follow these steps:
- Contact the Teaching Assistants (TAs) to request an authentication code for the VPN.
- You will receive a personalized auth key that can only be used once and will expire in 7 days if not used.
Note
Ensure you are connected to the internet (e.g., via Eduroam or any other internet connection) before proceeding. Do not connect to the FRITZ!Box network, as it does not provide internet access required for the VPN.
- Open a terminal and set your authentication key:
TS_AUTH_KEY=<auth_key_from_TAs>
- Verify that the auth key is saved successfully:
echo $TS_AUTH_KEY
- Ensure the output matches your provided auth key.
Important
Do not run the setup commands inside a Docker container. This setup is intended for native Ubuntu environments, WSL, virtual machines, or dual-boot systems.
- Run the following command to install the VPN client and establish the connection:
curl -fsSL https://tailscale.com/install.sh | sh && sudo tailscale up --auth-key=$TS_AUTH_KEY
- Obtain your VPN IP address:
hostname -I
- Look for an IP address starting with
100.xxx.xxx.xxx
.
- Look for an IP address starting with
-
SSH into the ROSbot using its VPN IP:
ssh husarion@<ROS_VPN_IP>
- Password:
husarion
- Password:
-
Verify the connection:
- Once connected, you should have access to the ROSbot's terminal over the VPN.
-
Configure Your Environment:
- Set the ROS Master URI to point to the ROSbot's VPN IP:
export ROS_MASTER_URI=http://<ROS_VPN_IP>:11311 export ROS_IP=<YOUR_VPN_IP>
- Add these environment variables to your
.bashrc
to make them persistent:echo "export ROS_MASTER_URI=http://<ROS_VPN_IP>:11311" >> ~/.bashrc echo "export ROS_IP=<YOUR_VPN_IP>" >> ~/.bashrc source ~/.bashrc
- Set the ROS Master URI to point to the ROSbot's VPN IP:
Tip
WSLg (Windows Subsystem for Linux GUI) allows you to run Linux GUI applications directly on Windows, providing an integrated desktop experience. This is useful if you prefer or need to use Linux tools alongside your Windows environment without setting up a separate virtual machine.
Important
To use WSLg, ensure you are running Windows 10 (version 2004 and higher) or Windows 11. Make sure your Windows installation is up to date.
-
Install WSLg by running the following command in an elevated PowerShell or Command Prompt:
wsl --install -d Ubuntu-20.04
-
Follow the prompts to complete the Ubuntu 20.04 installation, setting up your Linux username and password.
-
Launch Ubuntu 20.04 by searching for "Ubuntu 20.04" in the Start Menu and clicking on the application.
Note
You can also start Ubuntu 20.04 from PowerShell by setting it as the default distro and using the bash
command:
- Set Ubuntu 20.04 as the default WSL distro:
wsl -s Ubuntu-20.04
- Launch Ubuntu 20.04 by simply entering
bash
in PowerShell:bash
- This will open the Ubuntu 20.04 terminal.
- Open the Ubuntu terminal from the Start Menu or PowerShell.
- Follow Step 2: Set Up the VPN Connection as described above within the Ubuntu terminal.
Important
Ensure that you are using WSLg with Ubuntu 20.04 and not running the VPN setup commands inside a Docker container.
If you encounter any issues:
- Contact the professor.
- Reach out to the tutors on Teams:
- Alice Nardelli
- Omotoye Shamsudeen Adekoya
- Open an issue on the GitHub repository.
Warning
Do not attempt to reconfigure the ROSbot's hardware/software unless instructed by a tutor or professor.