Warning
This page is located in archive.

TurtleBot Lab Guide

Booking a Robot

  • The booking system is available at https://cw.felk.cvut.cz/brute/student/reservation.php.
  • Each student can book one robot for up to six 45min time slots (no more than 6 scheduled slots).
  • Every two slots contain a 15min break, so that the slots are aligned with the school schedule hours.
  • Note: All the robots are already reserved for ARO students during the ARO lab slots. There is no need to book the robots for your ARO lab slot, just take one.

Technical Warnings

All robots and laptops are connected via a single Wifi AP. The more communication flows over this bottlneck, the worse experience for everyone in the room. Please, try to think about the consequences of your actions on the network utilization.

DOs:

  • Develop code on the desktops and make use of automatic synchronization of your home directory to the robots.
  • Develop code on your laptop and use rsync to synchronize the code to the robot, but not every second.
  • Develop code SSH'd on the robots in a text-mode editor like vim or nano (unless you're a Vim master, this is mostly good for hotfixes).
  • You can also manage your code in a gitlab repository and synchronize code to the robot via the git repo (git push on your computer and git pull on the robot).
  • Run visualization tools on the client machines (desktops, your laptop), not on the turtlebots via X11 tunneling.
  • Run teleoperation code on the client machines (they wouldn't work when launched on the robot).
  • Connect your laptop via Ethernet cable whenever it is possible.
When you are connected via Ethernet, disconnect from Wifi.

DON'Ts:

  • Don't copy large files over the wifi to or from the robot. You don't need any large files there. The Singularity image is already predownloaded in /local folder on the robots.
  • Don't run silly find commands in the home directory of the robot. If you call it on a folder with many files, it literally kills the wifi for everybody.
  • Don't run a graphical IDE via X11 tunelling (i.e. ssh -X … on the robot and run the IDE in there). The user experience from an IDE running over X11 tunnel is very bad. There might be exceptions, i.e. if you want to put a breakpoint in some code running on the robot, you might have to run the IDE directly on the robot in this way.
    • A better alternative is using the Remote interpreter option from Pycharm Professional (not available in Community Edition; but CTU has free Professional licenses).
  • Try to not connect your laptop via Wifi if possible.

The technical solution allowing to run a fully remotely managed fleet of robots and desktops on the very slow and unreliable network connection is actually quite interesting. If you're interested in details, read Turtlebot technical details (Czech only)

Where Should I Run Which Part of Code?

If you're wondering where you should run which part of the code, the rule is quite simple.

Drivers of the robot and sensor processing has to run on the robot (all the *_real.launch files from homeworks).

Visualization and teleoperation tools have to run on your laptop or lab desktop PC (rviz, *_rviz.launch, real_robot_*_teleop.launch, …).

Working with TurtleBots from Lab Desktop Computers

  • If you do not need to work with the robots, but only need a computer that can run all the required software, you can also use the workstations in E132 - they are set up the same way.
  • Login on a desktop computer (set the password here).
  • Set up an ARO ROS workspace according to Using ROS somewhere in your home directory.
  • Select a TurtleBot from turtle01, turtle02, turtle08-turtle13, turn it on (first the base, then the computer).
  • Wait until the robot boots into a graphical login screen.
  • Both the desktop and robot use the same network home directory. The workspace you configured above is directly available on the robot in the same path.
  • In a terminal window, SSH to your robot (use hostname of your robot):
    # on the desktop PC
    ssh -XYC your_ctu_username@turtle08
  • On the robot, run robot drivers (and your localization/control code) from within your workspace:
    # on robot:
    ~/deploy/scripts/start_singularity_aro tmux
    # (the console prompt should start with AROSingularity)
    roscore  # keep roscore running and open a new tmux tab with ''Ctrl-b+n'' or ''Ctrl-a+n''
    roslaunch aro_exploration real_robot.launch  # in a new tmux tab, start the base robot driver
    roslaunch_aro_exploration aro_localization_real.launch run_driver:=false  # in a new tmux tab, star the homework-specific launch file
  • Visualize, process robot data, develop or teleoperate the robot from the desktop computer. Run on a desktop terminal:
    # on the desktop PC
    export ROS_MASTER_URI=http://turtle08:11311
    ~/deploy/scripts/start_singularity_aro
    # (the console prompt should start with AROSingularity)
    rostopic list  # List all topics
    rosrun rqt_tf_tree rqt_tf_tree  # Show TF frames
    rosrun rqt_graph rqt_graph  # Show all nodes and topics
    
    rviz  # 3D visualizer
    roslaunch aro_exploration aro_localization_rviz.launch  # 3D visualizer preconfigured for a specific homework
    
    roslaunch aro_exploration real_robot_key_teleop.launch  # Control the robot via keyboard
    roslaunch aro_exploration real_robot_joy_teleop.launch  # Control the robot via the connected gamepad
    
    code .  # Start VSCode inside the Singularity container
    pycharm  # Start Pycharm inside the Singularity container
    subl  # Start Sublime editor inside the Singularity container
  • Try controlling the robot with your aro_reactive_control package, e.g. roslaunch aro_exploration aro_slam_real.launch reactive_control:=true.
  • Try your exploration pipeline once it's ready.

Working with TurtleBots from Your Laptop

  • Set up an ARO ROS workspace according to Using ROS somewhere on your laptop.
  • Select a TurtleBot from turtle01, turtle02, turtle08-turtle13, turn it on (first the base, then the computer).
  • Wait until the robot boots into a graphical login screen.
  • Connect your laptop to an Ethernet cable (preferred), or to the lab wifi: SSID: turtlebots, password: TurtlesDC .
    • If you connect via cable, turn off the Wifi.
    • If you set up the wifi, configure it to not connect automatically. It will save you some trouble when you'll want to connect via Ethernet later.
  • On your computer, test you can reach the robot: ping turtle08.
    • Do not run this command inside Singularity, it won't work.
    • If you get name resolution error from ping and you are connected via cable, make sure your wifi is disconnected. If you're connected only via Wifi, check that you are connected to the turtlebots wifi.
  • In a terminal window, SSH to your robot (use hostname of your robot):
    # on your laptop
    ssh -XYC your_ctu_username@turtle08
  • Connected via SSH to the robot, set up an ARO ROS workspace according to Using ROS somewhere in your home directory.
  • Use rsync to synchronize files from your computer to the robot:
    # on your laptop
    rsync -aAP /your/path/to/workspace/src/ your_ctu_username@turtle08:workspace/src
    # The ending / after the first path is important, as well as not having a / after the 2nd path
    • Alternatively, if your IDE supports automatic deployment over SSH/SCP/RSync, you can set the synchronization in the IDE.
  • On the robot, run robot drivers (and your localization/control code) from within your workspace:
    # on robot
    ~/deploy/scripts/start_singularity_aro tmux
    # (the console prompt should start with AROSingularity)
    roscore  # keep roscore running and open a new tmux tab with ''Ctrl-b+n'' or ''Ctrl-a+n''
    roslaunch aro_exploration real_robot.launch  # in a new tmux tab, start the base robot driver
    roslaunch aro_exploration aro_localization_real.launch run_driver:=false  # in a new tmux tab, star the homework-specific launch file
  • Then you can use the same visualization/teleoperation commands as described above

Passwordless Login to Robots

To configure passwordless login to the robots, run the following commands on the desktop or on your laptop:

ssh-keygen  # Only if you don't yet have an SSH key yet (stored in ~/.ssh/id_rsa)
ssh-copy-id your_ctu_username@turtle08

The first login to a robot or lab desktop after powering it on will always require your password.

Troubleshooting

  • General troubleshooting for working with Singularity: Common problems
  • Most things seem to work but I cannot teleoperate the robot using gamepad or keyboard.
    • Make sure you launch the teleoperation launch file on the desktop/laptop and not on the robot.
    • If you are on a lab desktop computer, the previous should fix it. If not, contact the lab maintainer.
    • It is possible the robot cannot resolve the hostname of your laptop. SSH to the robot and try ping my-computer-hostname (outside of Singularity). You can figure out the hostname of your computer e.g. by calling command hostname on your laptop. If the ping command does not succeed, disable wifi on your computer, connect cable, wait a few minutes and reboot your computer. This should resolve the issue.
  • My computer doesn't see any topics from the robot (e.g. rostopic list is almost empty or cannot communicate with master):
    • Make sure you have executed export ROS_MASTER_URI=http://turtle08:11311 (with the correct turtle name) in the console where you try to communicate with the robot.
  • ROS doesn't work in tmux (and I use a custom ~/.tmux.conf)
    • Add the following to your .tmux.conf: set-option -g default-shell /bin/bash
  • Sometimes, it happens that the Singularity image on the robots is truncated to 0 bytes. When this happens, start_singularity_aro fails with various error messages like “image format not recognized” and similar.
    • To resolve this issue, just reboot the robot.
courses/aro/tutorials/turtlebots.txt · Last modified: 2024/03/22 11:01 by peckama2