BRU is a simple command line tool (currently implemented as a bash script.) All it really does is help you properly set up the required ROS environment variables.
Here are the commands:
The most important part of BRU is the set up in the .bashrc script on computers, robots and vms. They all get it.
The bru.py script can be found in the rosutils repository. All our robots and VMs have this directory. However on a new robot, we create a symbolic link accessible to the path that is called just bru
so the commands are bru help
etc.
Whenever a new robot or robot type is created, certain key lines of bru.py need to be updated. Also of course, as we develop or fix bugs in the BRU package, that code will need to ne revised from time to time.
In order to make it convenient to use BRU as a cli:
Create a symbolic link to the bru.py package.
ln -s /my_ros_data/rosutils/bru.py /usr/local/bin/bru
Make it executable
chmod +x /my_ros_data/rosutils/bru.py
Before you get started, make sure you have the latest version of rosutils
on your VNC To update rosutils, use the command cd ~/rosutils && git pull
You will then need to run the command source ~/.bashrc
after updating rosutils
Make note of the name of your robot written on the top.
Connect the battery to the robot.
Turn on the robot using the switch just under the camera.
You should see the lights on the raspberry pi in the robot turn green. The robot may take up to a minute to finish its boot sequence.
Make note of the name of your robot. It should be written on the top of the robot. For the purposes of this tutorial, I will be connecting to roba, but you should replace roba with the name of your robot.
Run tailscale status | grep roba
in a terminal. You should get an output that looks something like this: 100.86.78.102 roba pitosalas@ linux -
. Make note of the IP starting with 100, this is the IP address of your robot.
Edit the file ~/.bashrc
in your vscode editor on the VNC. Add the following two lines to the bottom of the file, but in the second line you will need to replace where it says roba
and the IP address with the name of your robot and your robot's IP address respectively.
Run the command sb
in the terminal. You should see your command prompt change to something that looks like this: [real:roba]
If the robot is already on, run the command sshrobot
in your terminal in your VNC. You might be asked to add a new ssh fingerprint, if so simply type yes
in the prompt and continue. You will be asked the password of the robot, which is going to be ROSlab134
for all of the lab robots.
Once you see that your terminal prompt looks like [onboard:roba]
you are connected to the robot. The final step is to type bringup
in the robot's terminal. This will run the bringup script so it is crucial that you do not close the terminal where this is running.
All the key scripts for bru are in a standard github repo, . You will find the following scripts:
bru.py
- the main script as described
common_alias.bash
- the standard collection of aliases for our robots andVMs.
pi_connect.sh
- the script for setting up a robot or VM with tailscale
bashrc_template.bash
- A template for the bashrc script for all Robots or VMs that are running BRU
Note that in general we set up a new robot by copying the MicroSD from a similar robot. This is here for completeness. Here are the steps:
Follow the Robot vendor instructions to set it up and set up ROS. All libraries, environment variables and so on should be set up in a standard way
Clone to ~ on the robot
Clone to ~/catkin_ws/src
Create a symbolic link from ~/rosutils/bru.py to ~/bin and chmod +x that file (details may be different.)
BRU knows about types of robots. Currently:
platform
bullet
minirover
cat
Bru knows about all the instances of those types, for example, that platform2 is a specific robot of category platform. This knowledge is encoded in the bru.py script. This script is modified when creating a new type or instance of robot.
Currently is the repo containing all the custom ROS bits and pieces to make our robots go. There you will find, among other things, a directory for each BRU robot type. Each of those directories is structures as a standard ROS package, including in particular, a launch subdirectory.
As mentioned, under ~/catkin_ws/src/gpg_bran4
there are standard ROS package directories named after each of the robot types. For example, ~/catkin_ws/src/gpg_bran4/platform
. The most important subdirectory below that would be the launch directory, so for example ~/catkin_ws/src/gpg_bran4/platform/launch
. BRU defines a set of standard launch file names that should exist, and do the same thing, for each type of robot
NB: This is a work in progress. Treat this description more as a spec than as a description of reality. We are working to this goal
bringup_mini.launch
- Will launch the minimum nodes to allow the robot to move and have odometry.
bringup_full.launch
- Will launch the full set of nodes, for motion, odometry, lidar, and camera`
A key idea in ROS is that it is a distributed operating system. Separate computers, who can access each other over the network, together form a ROS system. ROS nodes
are run on each of the computers, and they cooperate with each other. There is a key node called roscore
which acts essentially as the traffic cop between them.
ROS nodes are always running at least on "the robot". But there can be other computers involved. In the Brandeis scenario, typically, the remote computer is a VM running on our cluster. And so you will have ROS nodes on the robot and additional ros nodes on the "remote computer" - the VM.
The coordination relies on the network and in particular that each side knows about the otjers' IP addresses. That is where BRU comes in.
First of all, BRU is not a finished product, it is constantly under development. You should expect inconsistencies and incompleteness. You are invited to fix and improve it. BRU embodies a series of python scripts, bash shells, and conventions, to make it more convenient to operate robots in the Brandeis Robotics Lab. We have many different robots that are all similiar but a little different. BRU attempts to unify and organize things in a sane manner.
While all our robots run ROS (so far, just ROS1) they are all a little different. They use different SBC (single board computers) and different controllers. They have different peripherals. Also students use the robots either from their own laptop but more commonly from a virtual machine in our cluster environment. ROS has very partoicular requirements about IP addresses and environment variables. All together this can become very confusing.