arrow-left

All pages
gitbookPowered by GitBook
1 of 18

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Tailscale VPN

We use a product called tailscale to create a vpn that allows our robots (which are on wifi) to be connected to our Rover cluster (which are connected to the network.)

hashtag
Problem: Two Robots have the same IP or have the same or wrong name

When this occurs you need to fully uninstall Tailscale from one of the robots. This is the sequence:

sudo systemctl stop tailscaled
sudo rm /var/lib/tailscale/tailscaled.state
sudo systemctl start tailscaled
tailscale up

hashtag
More to come

How to use the Rover Cluster

novnc

hashtag
Introduction

Cloud desktop is a virtual desktop environment which you can access with just your browser. This allows you to run intensive robot simulations without your computer breaking down.

You can access your cloud desktop with one of three ways:

hashtag
Accessing virtual desktop

hashtag
Requirements

  • Browser with javascript blocking turned off

For access link and password, please refer to the credentials given to you by the TA.

hashtag
Accessing code editor

hashtag
Requirements

  • Browser with javascript blocking turned off

For access link and password, please refer to the credentials given to you by the TA.

hashtag
Accessing via SSH

hashtag
Enable SSH for remote access

Cloud desktop comes with SSH access disabled.

  • To enable ssh, first login using cloud desktop/VScode

  • Open up the terminal

  • Run sudo passwd root to setup a password

hashtag
Access

You can now ssh in using the cloud desktop link given to you.

Using the terminal

hashtag
Private Networking

All cloud desktops are, by default, connected to a shared private Tailscale network. Using the cloud desktop, you can connect to any robots on the network anywhere in the world.

Each robot on the network is assigned with a Tailscale IP which looks like this: 100.xx.xxx.xxx

For more details and troubleshooting about Private Networking, see .

hashtag
Troubleshooting

hashtag
What is my IP address?

Run the following command

hashtag
What is my hostname?

Run the following command

hashtag
Virtual desktop refused to login

If repeated attempts to login through the browser failed, it is likely that your desktop has crashed. Please notify your TA, he/she will restart your desktop for you.

hashtag
White blank screen when visiting the code editor

This is usually an issue with slow internet connection, give it a while to load.

If nothing shows up within 5 minutes, try right click > inspect > console to look for any error messages. Please then notify your TA with the error message.

Virtual desktop environment via novnc
Browser-based code editor via vscode
SSH
this
ssh root@desktop1.ros.campusrover.org -p 2222

  100.89.2.122 desktop-1 \       / robot-1 100.89.2.122
                          \     /
  100.99.32.12 desktop-2 - - - - - robot-2 100.99.31.234
                           /    \
  100.88.77.234 desktop-3 /      \ robot-3 100.86.232.111
ssh root@100.89.2.122 # IP of robot-1
ip addr show dev tailscale0 | grep -Eo '([0-9]{1,3}[\.]){3}[0-9]{1,3}'
cat /etc/hostname

networking.md

hashtag
Robotics Lab Mac Addresses

  • One entry for each robot or roscore.

  • All these devices live in the Robotics Lab in Gzang 006

hashtag
Name, mac address, IP address, dns name

  • Wifi Connected Rasberry Pi's

    • b8:27:eb:e3:9b:a2 - mutant - mutant.dyn.brandeis.edu

    • b8:27:eb:75:89:b1 - roba - roba.dyn.brandeis.edu

hashtag
Internal DNS names

  • Currently the names are formed as .dyn.brandeis.edu

  • is literally the hostname of the particular robot

  • You can check and set it with the $ hostname command

b8:27:eb:01:e7:69 - robb - robb.dyn.brandeis.edu

  • b8:27:eb:83:21:e4 - robc - robc.dyn.brandeis.edu

  • b8:27:eb:8c:90:c5 - donatello - donatello.dyn.brandeis.edu

  • b8:27:eb:a4:d5:ec - rafael - rafael.dyn.brandeis.edju

  • 74:40:bb:d5:ea:2f - alien - alien.dyn.brandeis.edu

  • dc:a6:32:20:ac:16 - platform2 - platform1.dyn.brandeis.edu

  • e4:5f:01🆎b7:ff - platform3 - platform3.dyn.brandeis.edu

  • Wifi connected Linux Notebook

    • 5c:ff:35:0f:ef:6d - roscore2

  • Wired Linux Desktop

    • 44:37:e6:b7:4b:d1 - roscore1

  • ros-melodic.md

    hashtag
    Gen 4 - Going to Ubuntu 18.04

    • We are planning to move students' and teachers' computers to Ubuntu 18.04

    • It has a nicer to use Desktop and is also the currently supported Ubuntu

    • It supports ROS Melodic (and ROS Melodic does not support the old Ubuntu)

    hashtag
    Installation notes

    • Follow Ubuntu's own installation instructions to install a clean copy of Ubuntu

    • As Robotis is still on Ubuntu 16.04 and ROS Kinetic we have to amend their instructions a little

    • Our baseline is

    hashtag
    Commands

    hashtag
    Core install of Melodic

    hashtag
    Further install of needed melodic packages

    hashtag
    Further install of ROS Packages

    hashtag
    Important: OPEN A NEW SHELL

    http://emanual.robotis.com/docs/en/platform/turtlebot3/pc_setup/arrow-up-right
    sudo apt-get update
    sudo apt-get upgrade
    wget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_melodic.sh && chmod 755 ./install_ros_melodic.sh && bash ./install_ros_melodic.sh
    sudo apt-get install ros-melodic-joy ros-melodic-teleop-twist-joy ros-melodic-teleop-twist-keyboard ros-melodic-laser-proc ros-melodic-rgbd-launch ros-melodic-depthimage-to-laserscan ros-melodic-rosserial-arduino ros-melodic-rosserial-python ros-melodic-rosserial-server ros-melodic-rosserial-client ros-melodic-rosserial-msgs ros-melodic-amcl ros-melodic-map-server ros-melodic-move-base ros-melodic-urdf ros-melodic-xacro ros-melodic-compressed-image-transport ros-melodic-rqt-image-view ros-melodic-gmapping ros-melodic-navigation ros-melodic-interactive-markers ros-melodic-turtle-tf2 ros-melodic-tf2-tools ros-melodic-tf
    cd ~/catkin_ws/src/
    
    # Robotis
    git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
    git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
    git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
    
    # Cosi119a PRR Samples
    git clone https://github.com/campusrover/prrexamples.git
    exit
    cd ~/catkin_ws && catkin_make

    Lab Infrastructure

    A collection of notes and documents about all the equipment and facilities we have in the Robotics lab at Brandeis. Our lab is for undergraduates who come to us often never having touched a physical robot let alone programmed them. There are lots of very simple procedures that you can learn by picking them up randomly. We document them here for our students.

    copying-robot-sd-cards.md

    Often in the lab the need arises to create several robots with identical operating systems and packages, however it is incredibly time consuming to flash the base operating system to a new sd card and download all the required packages to each new robot.

    This guide will explain how to create identical boot sd cards from one working operating system in order to scale the ever-growing fleet of terminator robots this lab hopes to one day create, so let's get started.

    hashtag
    Shrink the existing SD card partition

    Say you have a working operating system on a robot with an SD card of 128GB, but most of the space on that SD card is unused. If you created an OS image from this SD card it too would be 128GB which is large and time consuming to flash, not to mention it won't fit on smaller SD cards. You'll first need to shrink your existing card to the minimum size to fit the operating system.

    Plug the SD card into your linux computer and boot up the program GParted. Select the SD card from the menu in the top left. You'll want to unmount both of the partitions displayed by right clicking on them in the list menu, and you'll then see they key icon next to their names disappear.

    You're going to resize the larger of the two partitions by selecting it from the list menu pressing the resize button in the top menu. Resize the partition to be slightly larger than the amount of used space. In my case here, I'm resizing the partion to be 13000MB with 12612MB used.

    Then you're going to apply the resizing operation by clicking the green checkmark on the top menu bar, it should take a little bit of time to complete.

    Now you are ready to create your image file. Open your terminal and type the command sudo fdisk -l. It should display a list of storage partitions, so find the partition in the list

    Now

    Creating a bootable SSD

    This procedure is very finicky. We used it before we had our Rover cluster. Avoid doing this if you can!

    hashtag
    Introduction

    • SSD Solid state disk. Either internal or external. In our case we are using external SSDs which connect to your computer with a USB connection.

    • USB Stick Also known as a thumb drive, flash drive, memory stick, a memory key. Its a small form factor, dongle like device which also plugs into your computer.

    • Bootable SSD and Bootable USB Stick have been formatted and created in such a way that the computer can boot from them and thereby leave your default internal disks untouched.

    Overview of the procedure We are going to create a bootable SSD with these instructions. You will:

    • Download the right version of Ubuntu onto your computer

    • Plug in your USB stick (which will be erased)

    • "Flash" the USB stick which will make it bootable

    hashtag
    Create Bootable Ubuntu USB stick

    In order to install Ubuntu onto an SSD, we need to first create a bootable USB Flash Drive. This drive will be used to boot Ubuntu and install it onto the SSD. The process can be completed as follows:

    1. Plug the USB SSD drive into your computer

    2. Download the appropriate Ubuntu 18.04 desktop image for your machine

    3. Flash the Ubuntu image onto your USB stick.

    How to flash Ubuntu with Mac:

    How to flash Ubuntu with Windows:

    How to flasg Ubuntu with Ubuntu:

    With Ubuntu flashed onto your flash drive, it can now be booted and installed onto your SSD. If your SSD has anything on it, be sure to format it before moving on to the next step.

    hashtag
    2. Boot Ubuntu

    Booting from a USB depends on your operating system. Instructions for Windows and Mac are below:

    hashtag
    MacOS

    Restart your computer. While it is booting up, hold down the alt/option button. A menu should appear, select the "EFI Boot" option. If the MacOS login screen appears, you will need to restart and try again.

    hashtag
    Windows

    Restart your computer. While it is booting up, press the boot menu key. This is often one of the F keys on most Windows machines, but sometimes ESC as well. With the boot menu button pressed, you will be shown the BIOS menu. From here you need to change the boot order so that your Ubuntu USB drive is prioritized above the drive where Windows is installed. Once this is done, reboot and Ubuntu should be booted.

    Continuing...

    With Ubuntu running on your machine, plug in your external SSD (while keeping the USB stick plugged in) and select “Try ubuntu without installing” to begin the installation process.

    NOTE: If you are unable to use your mouse and keyboard on the Ubuntu desktop, a USB keyboard and mouse is required from this point on.

    hashtag
    3. Install Ubuntu on External SSD

    Now that you are on the Ubuntu desktop, it is time to install Ubuntu to the SSD. The following steps will take you through installing Ubutnu onto your SSD:

    hashtag
    Partitioning your SSD

    You will use a program called GParted to partition your SSD for installation. From the applications menu in Ubuntu (top left corner), open up GParted and in the top right corner, select your SSD.

    Once the drive is selected, remove all the current partitions by selecting them and pressing the delete / backspace key. With these all removed, select the green check in the top menu to confirm the changes.

    Now that all the original partitions have been removed, the SSD needs to be partitioned for Ubuntu. To create a new partition, select the add button in the top left corner. You will need to create 3 partitions with the following specifications:

    Partition 1:

    New Size = 8000 MB File System = linux-swap

    Partition 2:

    New Size = 20,000 MB File system = ext4

    Partition 3:

    New Size = 80,000 MB File System = ext4

    To complete the process, click the green checkmark from the top menu once again. With all the partitions created, your GParted should look like this:

    hashtag
    Installing Ubuntu onto the SSD

    With the SSD partitioned, we can now install Ubuntu. Click the Install Ubuntu 18.04 icon from the side bar to begin the process. You will be prompted to go through a series of menus. Choose "minimal" install.

    To set up wifi, you need to choose: and the eduroam account robotics@brandeis.edu with our traditional password. See the image below for how to fill in the Wifi dialog box.

    You will eventually reach a screen which asks to you how to install, titled Installation Type.

    The “Something else” option allows us to assign mount points to the previously partitioned SSD. In the list of partitions, find the SSD. It should be called something like SDx. Be really careful that you are picking the right one. You will see the 3 partitions that were made in GParted. To set the partitions up for Ubuntu, double click on and configure the partitions as follows:

    hashtag
    sdx2

    hashtag
    sdx3

    The partitions are now ready and Ubuntu can be installed. Select the SSD from the menu below and click install. Ubuntu will now install, and once done you will need to restart your system and remove the thumb drive.

    hashtag
    Make The SSD Bootable

    Now that Ubuntu has been installed, we need to make it bootable. To do this, we will follow a tutorial online. The tutorial begins at the section Create an ESP on the Ubuntu HDD, and can be found at the following link:

    NOTE: You should skip the umount command instruction

    To be sure that this process worked, the final command should return a message saying the installation completed with no errors.

    hashtag
    5. Install ROS

    The final step in the process is to install ROS. In order to install ROS, you will need access to the internet. If you are using Eduroam, the following settings will need to be used:

    Once you are connected to the internet, follow these instructions to install ROS:

    With this completed, your SSD is configured!

    Boot using that USB stick
  • This brings up the Ubuntu installer. You will use it to just "try ubuntu"

  • You will now plug in the SSD and format it with the right partitions

  • Next you will install Ubuntu 18.04 onto the SSD and reboot.

  • http://releases.ubuntu.com/18.04/arrow-up-right
    https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-macos#0arrow-up-right
    https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-windows#0arrow-up-right
    https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#2arrow-up-right
    https://www.dionysopoulos.me/portable-ubuntu-on-usb-hdd/arrow-up-right
    http://emanual.robotis.com/docs/en/platform/turtlebot3/pc_setup/arrow-up-right
    Gparted
    Eduroam settings
    BE SURE TO CHECK THE BOX TO INSTALL THIRD PARTY SOFTWARE. Without this, you will be unable to connect to WiFi.
    DO NOT SELECT THE OPTION TO ERASE DISK AND INSTALL UBUNTU. THIS WILL ERASE YOUR CURRENT OS AND MEMORY. BE SURE TO SELECT "SOMETHING ELSE"
    Use as: ext4
    format: checked
    Mount point = /
    Use as: ext4
    format: checked
    Mount point = /home

    Danger Signs with Batteries and Chargers

    hashtag
    Danger

    LiPo batteries are dangerous. When mistreated they can cause a major fire. This is a serious concern and we ask you to be careful and take this seriously.

    hashtag
    Fire Extinguisher

    There is a fire extinguisher in the lab. It is near the main door, on the left as you enter the lab.

    hashtag
    Danger signs

    • When charging, LiPo batteries will become warm. As long as you can put your palm on it and keep it there for 10 seconds you are more or less ok.

    • If a LiPo battery becomes hot to the touch, immediately unplug it and put it into one of the safety bags.

    • If a LiPo battery starts emitting smoke or sparks, this is a fire emergency. Luckily we've not experienced this ever.

    hashtag
    Chargers

    We have many different types of chargers.

    hashtag
    Technical Information

    If a LiPo battery deforms in any way, that is bulges out on one of the sides, that battery is defective and should not be used any more.

    Battery Charging Instructions for Brandeis Robotics Labarrow-up-right
    Battery Technical Specsarrow-up-right

    external-ssd-instructions.md

    linux_terminal_eduroam_setup.md

    hashtag
    Setting up an Eduroam connection via Command Line Interface on Linux

    Often in robotics, you will find that it is necessary to configure wifi through a terminal interface rather than a GUI. This is often due to the fact that many on-board operating systems for robots lack a desktop environment, and the only way to interface with them is through a terminal.

    The task of connecting to a wireless network can be especially difficult when configuring Eduroam which requires a more involved setup process. The following method for connecting to Eduroam has been tested on a barebones version of Ubuntu 20.04.

    hashtag
    Using NMCLI

    nmcli is a command line tool used for networking on Linux machines. It is typically installed by default on Ubuntu Linux, so you should not need to connect your machine through a wired connection and install it before using it. However, if nmcli is not installed, follow the installation instructions.

    hashtag
    Installation (If needed)

    Connect your machine through a wired connection (e.g. To a router/wall connection through an ethernet port) and the following commands to install nmcli and configure it to start upon bootup of your machine.

    Note: If it doesn't work even with a connection, and you are on campus, send an email to help@brandeis.edu noting the mac address of the eth0 device (using ip link show) and the fact that you are trying to connect. Ask them if they see any activity at that particular mac address.

    • sudo apt-get update

    • sudo apt install network-manager

    • systemctl start NetworkManager.service

    hashtag
    Connection to Eduroam

    Run the following command to get the names of your wireless devices.

    • ip link show

    Running this command will list all of your networking devices. You will want to note the name of your wireless networking device, for this tutorial I will assume the wireless device's name will be wlan0 as it is named on the Raspberry Pi 3b+, however you will want to substitute this for the name of your wireless device if your's differs.

    Next you will run the following commands to connect your machine to eduroam.

    • nmcli connection up eduroam --ask

    You may then be prompted to enter in the wifi username and password, however the fields should already be filled in and you will just need to press enter.

    hashtag
    Troubleshooting

    1. If you are trying to connect a robot and it is failing, sometimes it's good to try it on the wired network. It should just work. Brandeis networking requires that the MAC address of special devices (like raspberry Pis) be recorded. This is only for the wired network. To do this use this link: : https://www.brandeis.edu/its/services/network-connectivity/netreg.html . It is extremely slow so be patient. When you click the netreg button it is very very slow (minutes) but eventually it allows you to add a mac adress to the list.

    2. Sometimes despite checking everything, the wireless (eduroam) network refuses to connect. One important detail that has caused problems is the system time on the Rasberry Pi. It has to be correct or close to it. Apparently that's part of the authentication. I think the command is date -s "19 APR 2012 11:14:00" and that sets the UTC time.

    systemctl enable NetworkManager.service

      nmcli con add type wifi con-name "eduroam" ifname wlan0 ssid "eduroam" wifi-sec.key-mgmt wpa-eap 802-1x.identity "exampleemail@brandeis.edu" 802-1x.password "examplepassword123" 802-1x.system-ca-certs yes 802-1x.eap "peap" 802-1x.phase2-auth mschapv2

    Setting up SSH on a new robot

    hashtag
    Note

    All our lab robots, as of now, have SSH set up. This is for new robots.

    hashtag
    setting up ssh on a new robot

    By default, ubuntu MATE comes with ssh installed but disabled. So there are a few steps to setup ssh to your raspberry pi.

    1. ensure that openssh-server is installed with sudo apt install openssh-server

    2. check ssh status with sudo systemctl status ssh

    For more information, here is

    if it is
    inactive
    , you can start it with
    sudo systemctl start ssh
    , and/or automatically start ssh on boot with
    sudo systemctl enable ssh
  • go to settings -> login window and set automatic login to your robot's username.

  • a useful site that explains it morearrow-up-right

    Turtlebot3s.md

    Download Image: ROS Noetic Ubuntu 20.04arrow-up-right

    hashtag
    Instructions:

    1. Flash the image into a microsd card using an imager (dd for linux, or RPiImager).

    2. Connect the Turtlebot to a monitor and keyboard, insert the microsd card and turn on the bot.

    3. Log into the turtlebot with the username: ubuntu and the password: ROSlab134

    4. You will want to remove the tailscale information using the following commands:

    5. Once the turtlebot is rebooted, change the hostname and reinstall tailscale:

    6. Now update the OpenCR board with the following commands:

    7. Once the OpenCR board is updated, shut down your bot and turn it back on and you are done with the setup.

    
    sudo apt-get remove tailscale
    sudo rm /var/lib/tailscale/tailscaled.state
    sudo nano /etc/hostname
    # change the hostname in this file from "roba" to your robot's name
    sudo reboot now
    
    sudo apt-get install tailscale
    sudo tailscale up --authkey=ask-pito-for-code
    
    export OPENCR_PORT=/dev/ttyACM0
    export OPENCR_MODEL=burger_noetic # or waffle_noetic if you have a waffle tb3
    rm -rf ./opencr_update.tar.bz2
    wget https://github.com/ROBOTIS-GIT/OpenCR-Binaries/raw/master/turtlebot3/ROS1/latest/opencr_update.tar.bz2
    tar -xvf opencr_update.tar.bz2
    cd ./opencr_update
    ./update.sh $OPENCR_PORT $OPENCR_MODEL.opencr

    ubuntubrandeis.md

    hashtag
    Setting Up Eduroam

    Ubuntu Eduroam Setup

    multi-robot-infrastructure.md

    hashtag
    How to namespace multiple robots and have them on the same roscore

    To have multiple robots on the same ROS core and each of them listen to a separate node, namespacing would be an easy and efficient way to help.

    hashtag
    Set namespace on robots' onboard computers with environment variable

    • Boot up the robot and ssh into it

    • On the robot's onboard computer, open the terminal and type in

    Then add the following line to the end of the file, using the robots name as the namespace

    Also make the following other changes:

    • Save the file and don't forget to do source ~/.bashrc

    hashtag
    Set namespace on your laptop with environment variable

    • Now that the robot is configured properly with its own unique name space, how do we talk to it?

    • There are three ways:

      1. Configure your laptop to be permanently associated with the same name space

    hashtag
    Permanently associate your laptop with the name space

    • Use the same steps above. Make sure your namespace is exactly the same as the namespace of the robot you want to control.

    • From now on, whenever you do, e.g. a cmd_vel, it will be directed just to your robot.

    hashtag
    Use an environment variable

    • Set namespace for a termimal with temporary environment variable.

    • To set a namespace temporarily for a terminal, which will be gone when you close the termial, just type in export ROS_NAMESPACE={namespace_you_choose} directly in your terminal window.

    • You can use echo $ROS_NAMESPACE

    hashtag
    Use the .launch file

    • To set namespace for a node in launch file, Use the attribute ns, for example:

    <node name="listener1" pkg="rospy_tutorials" type="listener.py" ns="{namespace_you_choose}" />

    hashtag
    Not recommended: add __ns to the run or launch command

    1. Launch/Run a file/node with namespace in terminal. Add a special key __ns (double underscore here!) to your command, for example: roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch __ns:={namespace_you_choose} However,

    2. Use of this keyword is generally not encouraged as it is provided for special cases where environment variables cannot be set. ()

    hashtag
    Publishing/Subsribing topics in other namespace

    Do a rostopic list, you will find out topics under a namespace will be listed as /{namespace}/{topic_name}

    hashtag
    Make changes to turtlebot3_navigation package on your laptop

    • Type roscd turtlebot3_navigation to go to the package directory.

    • Type cd launch to go to the folder that stores .launch files.

    • Open the turtlebot3_navigation.launch

    hashtag
    Change move base arguments

    • Add another argument cmd_vel_topic to the four arguments in the <!-- Arguments --> section:

      • Pass the new argument to move base launch file:

    hashtag
    Change rviz arguments

    • Type roscd turtlebot3_navigation to go to the package directory.

    • Type cd rviz to go to the folder that has turtlebot3_navigation.rviz. It stores all the arguments for rviz.

    external-ssd-instructions

    Set a temporary environment variable that specifies the name space

  • Add the namespace to a launch file

  • Use the __ns parameter for roslaunch or rosrun (not recommended)

  • to check it.
    file with nano or your favorite code editor.
  • You will see the scripts for launching move base and rviz:

  • These changes will make move base publish to /{namespace_you_choose}/cmd_vel instead of /cmd_vel. Open the move_base.launch file in the launch folder, you will see why it worked.
    Open turtlebot3_navigation.rviz with VSCode or other realiable code editors, since this file is long and a bit messy.
  • In the .rviz file, search for all the lines that has the part Topic:

  • Add your namespace to the topics you found. For example, change

    to

  • These changes will make rviz subsribe to topics in your namespace.

  • http://wiki.ros.org/Nodesarrow-up-right
      Topic: /move_base/local_costmap/footprint
      `
      Topic: /roba/move_base/local_costmap/footprint
    nano ~/.bashrc
    export ROS_NAMESPACE={namespace_you_choose}
    alias bu='roslaunch turtlebot3_bringup turtlebot3_robot.launch'
    export IP="$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')"
    export ROS_IP=$IP
    export ROS_MASTER_URI=http://roscore1.cs.brandeis.edu:11311
    export ROS_NAMESPACE=roba
    export TB3_MODEL=burger
    export TURTLEBOT3_MODEL=burger
      <!-- move_base -->
      <include file="$(find turtlebot3_navigation)/launch/move_base.launch">
        <arg name="model" value="$(arg model)" />
        <arg name="move_forward_only" value="$(arg move_forward_only)"/>
      </include>
    
      <!-- rviz -->
      <group if="$(arg open_rviz)">
        <node pkg="rviz" type="rviz" name="rviz" required="true"
              args="-d $(find turtlebot3_navigation)/rviz/turtlebot3_navigation.rviz"/>
      </group>
      <!-- Arguments -->
      <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
      <arg name="map_file" default="$(find turtlebot3_navigation)/maps/map.yaml"/>
      <arg name="open_rviz" default="true"/>
      <arg name="move_forward_only" default="false"/>
      <arg name="cmd_vel_topic" default="/{namespace_you_choose}/cmd_vel"/>
    <!-- move_base -->
    <include file="$(find turtlebot3_navigation)/launch/move_base.launch">
     <arg name="model" value="$(arg model)" />
     <arg name="move_forward_only" value="$(arg move_forward_only)"/>
     <arg name="cmd_vel_topic" value="$(arg cmd_vel_topic)"/>
    </include>

    private-networking.md

    hashtag
    Introduction

    To facilitate lab@home, we have created a private network for connect robots and computers together using Tailscale. This private network allows anyone to connect to any robots on the network around the world.

    hashtag
    Setup robot for private networking

    hashtag
    Requirement

    • Raspberry Pi

    • Authkey (like this tskey-123abc456)

    • Running either Raspbian 10, Ubuntu 18.04

    circle-info

    You can check your OS version by doing lsb_release -a

    circle-info

    If you don't have an Authkey, please reach out to your TA

    hashtag
    Installation

    • Clone the repo: https://github.com/pitosalas/tb3-ros.git

    • cd tb3-ros/clients

    Once the robot is successfully connected to the network, you can try to reach it via cloud desktop

    circle-check

    Now that the robot is on the network, you can configure your cloud desktop to control the robot directly.

    hashtag
    Setup robot remote control

    To control a specific robot, you need to connect to its ROS master.

    On your robot, edit ~/.bashrc, add or replace the following lines:

    circle-info

    If you are not sure what the Tailscale IP is, run ip addr show dev tailscale0 | grep -Eo '([0-9]{1,3}[\.]){3}[0-9]{1,3}'

    On your cloud desktop (or your computer if you are not using cloud desktop), edit ~/.bashrc, add or replace with the following lines:

    circle-info

    If you are not sure what the cloud desktop's IP is, run ip addr show dev eth0 | grep -Eo '([0-9]{1,3}[\.]){3}[0-9]{1,3}'

    Once this is setup, test the connectivity with

    circle-info

    The following instructions are for if you are running cloud desktop on your own computer!

    hashtag
    Setup non cloud desktop for private networking

    You can still connect to the private network without using cloud desktop. However, right now we have limited support for OS.

    Officially supported

    • Ubuntu 18.04

    • Ubuntu 20.04

    Unofficially supported

    • MacOS

    • Check this

    hashtag
    Officially supported installation

    • Clone the repo: https://github.com/pitosalas/tb3-ros.git

    • cd tb3-ros/clients

    To connect to the network after every reboot, just do

    hashtag
    Unofficially supported installation

    triangle-exclamation

    Caution: all the instructions here have not been tested, you are on your own!!!

    hashtag
    MacOS

    • Download and Install Tailscale from

    • Open the App, DO NOT login

    With your terminal do,

    hashtag
    Everything else

    Follow the instructions for installing for your OS .

    Once you have Tailscale installed, you can start it with the following command

    circle-check

    Now that your computer is on the network, follow the to control the robot directly.

    
      100.89.2.122 desktop-1 \       / robot-1 100.89.2.122
                              \     /
      100.99.32.12 desktop-2 - - - - - robot-2 100.99.31.234
                               /    \
      100.88.77.234 desktop-3 /      \ robot-3 100.86.232.111
    
    , or
    Ubuntu 20.04
    listarrow-up-right
    App Storearrow-up-right
    herearrow-up-right
    instructions
    chmod +x pi_connect.sh
    
    # Run the script with the authkey
    sudo ./pi_connect.sh tskey-123abc456
    
    # On successful connect, you should see this
    Connected. IP address: 100.xx.xxx.xxx
    ssh pi@100.xx.xxx.xxx
    # Replace with the robot's Tailscale IP
    export ROS_MASTER_URI=http://100.xx.xxx.xxx:11311/
    export ROS_IP=100.xx.xxx.xxx
    # Replace with the robot's Tailscale IP
    export ROS_MASTER_URI=http://100.xx.xxx.xxx:11311/
    # Replace with the cloud desktop's IP
    export ROS_IP=172.xx.xxx.xxx
    rostopic list
    chmod +x pi_connect.sh
    
    # Run the script with the authkey
    sudo ./pi_connect.sh tskey-123abc456
    
    # On successful connect, you should see this
    Connected. IP address: 100.xx.xxx.xxx
    sudo ./pi_connect.sh tskey-123abc456
    $(ps -xo comm | grep MacOS/Tailscale$) up --authkey=tskey-123abc456 --accept-routes
    sudo tailscale up --authkey=tskey-123abc456 --accept-routes

    setup-hints.md

    hashtag
    Hints on how to set things up

    • Reflects the "new" multi robot setup

    hashtag
    .bashrc ON BOTH your laptop and your Robot

    • This shell script is run automatically whenever you open a new terminal or tab in a terminal

    • This means that if you edit it and save it, it still does nothing until you open a new terminal

    • If you want to apply it without opening a new terminal, do source ~/.bashrc

    • ROS_HOSTNAME: the IP address of this computer.

    • ROS_MASTER: the IP address of whereever ROSCORE is running. We have roscore always running on the little computer by the door. It happens to be called roscore1.cs.brandeis.edu

    • ROS_NAMESPACE: Indicates a unique name for a specific robot. That way when we send a /cmd_vel it is turned into, e.g. /roba/cmd_vel. This way all the robots can coexist on one ROSCORE. It also means you don't have to run your own ROSCORE anymore.

    hashtag
    ON THE ROBOT

    • SSH into the robot

    • Run the following command to launch ROS on the robot

    hashtag
    Test the configuration

    • Did you do bringup on the ROBOT (NOT ON YOUR COMPUTER!

      • if not, do so!

    • Did bringup work

    hashtag
    Additional Intermediate Bash Tips

    hashtag
    Aliases: Live Better, Type Less(TM)

    You may notice that the ros installation process added a few Aliases to your .bashrc file. These serve to make your life easier, and you can add more of your own custom aliases to make your life even easier. Here are a few recommended changes to make:

    hashtag
    New Editor in eb

    You'll notice eb uses nano by default. nano is fine, if you enjoy living in the dark ages. To make eb open a different text editor, just replace nano with whatever your favorite installed editor is - code (vscode), atom, vim, emacs, etc. Bonus tip: if you're not already using eb as a shortcut to edit the .bashrc, start using eb!

    hashtag
    Networking Shortcuts

    Try using this chunk in your bashrc:

    NB the snippet of code above uses robc as the current robot, robc can be replaced with any valid robot name Here's what this chunk does: 1. The alias "connect" will ssh to your desired preconfigured robot (saves quite a bit of typing) 1. The variable ROBOT is used to reduce the redundancy of typing the robot name anythime you need to ssh or change your ROS_MASTER_URI 1. The last two lines will automatically obtain your IP address anytime you start a new terminal window Some additional things to note: 1. The connect alias grabs ROBOT when it is called, so it can be defined before ROBOT, but ROS_MASTER_URI grabs ROBOT when it is defined, so ROBOT must be defined first 1. The command export ROBOT=<name> can temporarily change the value of ROBOT - anything that accesses ROBOT will grab the temporary value (Think about what this means given the last point: connect wil ssh to the temporary robot, but ROS_MASTER_URI will not update)

    hashtag
    Universally Useful Time Savers

    One of the most common problems is that when you kill a ROS script, the most recent cmd_vel latches and the robot will continue in that manner therefore, it is useful to have some sort of emergency stop procedures. 2 viable and common options: 1. create an alias for rostopic pub that publishes a blank twist to cmd_vel 1. create an alias that launches teleop - this take longer, but will immediately stop the robot as soon as it is running.

    hashtag
    The Possibilities Don't Stop Here

    There's obviously still much more that could done to make a more efficient terminal experience. Don't be afraid to become a bash master. Here are some resources to help get started becoming more proficient in bash:

    These lines should be on your laptop as well as your robot, the same way.

    if not, check your environment variables

  • printenv | grep ROS

  • It should include all your settings and also env variables for the path to ROS

  • Make sure you run source ~/.bashrc

  • Can you run rostopic list? rostopic list

    • If not, check your IP addresses

    • Check whether the ROSCORE computer is running.

    • Try pinging roscore1.cs.brandeis.edu

  • Does it list /x/cmd_vel among them?

    • If not, check your IP addresses. Also make sure you ran

  • Can you teleop the robot? roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

    • if not, try a manual cmd_vel: rostopic pub /rob*/cmd_vel

  • Bash Cheatsheetarrow-up-right
    alias bu='roslaunch turtlebot3_bringup turtlebot3_robot.launch'
    export ROS_MASTER_URI=http://roscore1.cs.brandeis.edu:11311
    export ROS_NAMESPACE=roba
    export ROS_IP=<ip address of computer where this .bashrc is stored>
    export TB3_MODEL=burger
    export TURTLEBOT3_MODEL=burger
    roslaunch turtlebot3_bringup turtlebot3_robot.launch
    alias connect='ssh $ROBOT@$ROBOT.dyn.brandeis.edu'
    export ROBOT=robc
    export ROS_MASTER_URI=http://$ROBOT.dyn.brandeis.edu:11311
    export IP="$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')"
    export ROS_IP=$IP

    our-robots.md

    | hostname | maintainer | password | last updated | username | ros | OS | known problems | IMU | | -------- | ---------- | -------- | ------------ | -------- | --- | -- | -------------- | | mr1 | pito | default 2 | Mar 3 2022 | pi | noetic | ubuntu 20.04 | none | | mr2 | pito | default 2 | Jan 15 2022 | pi | noetic | ubuntu 20.04 | none | | rafael | pito | Default 1 | Jan 15 2022 | ubuntu | noetic | ubuntu 20.04 | none | | robb | adam | default 1 | Feb 16 2022 | ubuntu | noetic | ubuntu 20.04 | none | | robc | adam | default 1 | Dec 10 2021 | ubuntu | noetic | ubuntu 20.04 | none | | roba | adam | default 1 | Feb 2 2022 | ubuntu | noetic | ubuntu 20.04 | none | | donatello | adam | default 1 | Feb 16 2022 | ubuntu | noetic | ubuntu 20.04 | none | | bullet1 | pito | default 1 | Nov 11 2021 | ubuntu | noetic | ubuntu 20.04 | none | IMU9250 | | cat1 | pito | default 2 | Mar 3 2022 | ubuntu | noetic | ubuntu 20.04 | none | | alien | pito | default 2 | Mar 25 2022 | ubuntu | noetic | ubuntu 20.04 | no lidar |