Runbook - MRoboSub/mrobosub GitHub Wiki

This is a beginners' guide to running and operating the sub from scratch. This guide requires little to no prior knowledge of the sub or programming. If you have any questions, feel free to reach out to a software team lead!

Quick reference

We wanted to be thorough in this guide to help give more understanding of what all the steps are doing. However, if you just need a quick reference, follow these steps. Otherwise, for the full guide, read on to the next sections.

  1. Turn on the sub, wait a few minutes, and connect the tether to the base station laptop
  2. Run ssh [email protected] in the terminal to connect to the Jetson
  3. Run arm on the Jetson's terminal
  4. Connect a USB controller to the base station and then run teleop on the base station terminal.
  5. Start controlling the sub with the controller. Move the left joystick up/down for forward/backward, the left joystick left/right for left/right, the right joystick left/right for turning, and the right joystick up/down for ascending/descending.

Background - the computers

First we will go over the main computers involved with running the sub. It is okay if you do not fully understand everything here yet, it is just meant to give some background and something to reference back to if you have questions.

The sub contains two main computers: a Jetson (which we call the "brain", but honestly we usually just call it the "Jetson") and a Raspberry Pi (which we call the "companion computer"). The Jetson and the Raspberry Pi are connected in the sub via Ethernet wires. This allows them to talk to eachother on the same network.

The Jetson is the main computer on the sub running the code. Despite being small, it is significantly powerful; for example, it is capable of running small machine learning models.

The companion computer is soley responsible for talking to another device on the sub called the PixHawk over a USB connection. The PixHawk is a flight controller, and it controls the motors. The PixHawk has a big blue light on it. When the blue light on the PixHawk is solid, that means the sub is armed, and is able to move. When it is blinking, that means the sub is disarmed, and is not able to move

For us to talk to the sub in order to test and drive it, we use a laptop, called the "base station". We connect the base station to the sub by using a waterproof tether. This allows it to join the same Ethernet network as the Jetson and companion computer, allowing us to talk to both of them.

When operating the sub, we typically only run commands on the base station and Jetson. To run commands on the Jetson, we use a common program called SSH, which allows us to connect to the Jetson and run commands on it.

To summarize, the main computers are:

  • The brain (a Jetson) - the main computer on the sub
  • The companion (a Raspberry Pi) - a computer on the sub that talks to the PixHawk
  • The PixHawk - a flight controller that controls the motor and has a big blue light telling you if the sub is armed/disarmed
  • The base station - a laptop used to talk to the sub's network over a tether

computers_in_sub.drawio

Connecting to the sub

First turn the sub on. It takes a few minutes for the computers to turn on and start all the code, so you may need to wait a bit before you can connect.

Then connect the tether to the Ethernet port of the base station. Once you connect, all the computer should be on the same network. Every device on a network has an IP address, which is used to identify and connect to it. On the sub's network, every IP address starts with 192.168.2.. The IP addresses of the important computers are:

  • The base station - 192.168.2.1
  • The companion computer - 192.168.2.2
  • The Jetson - 192.168.2.3

To run commands on the base station, open the "Terminal" program on the laptop. This allows you to type commands and run them. You can open multiple tabs in the terminal, which is handy.

Notice that every line in the terminal starts with something like mrobosub@basestation. This indicates that you are currently on a computer called basestation and your username is mrobosub.

To connect to the Jetson, open the terminal and run ssh [email protected]. This means that you are using SSH to connect to IP address 192.168.2.3 (the Jetson) with username jetson. If asked for a password, use the password companion. If this succeeds, you should now see that every line in the terminal starts with something like [email protected]. This indicates that when you now run commands, they will run on the Jetson! If you still want to also run commands on the base station, just open a new tab in the terminal; this should default to being on the base station.

In the next section, some commands will be ran on the base station and some on the Jetson, so take care to check which computer your terminal is connected to (by seeing if the next at the start of each line is mrobosub@basestation or [email protected]) before running the command you want.

Running the sub

Arming the usb

When starting the sub, it typically defaults to disarmed. To arm the sub, run the command arm on the Jetson.

Note that this is not a real Linux command; rather, it is an "alias" that we created, which is just a shorthand for another command. The full command actually expands to rosservice call /cmd/arming (we will explain more on what this means later, but feel free to ask a software lead if you are curious!).

The big blue light on the PixHawk should be solid once armed.

Running teleop

We wrote a teleop program to control the sub with a USB controller on the base station. Connect a USB controller and run the teleop command on the base.

Note that this is once again a command alias. This time, it expands to roslaunch mrobosub_teleop joystick_teleop.launch to run our teleop code.

You can then control the sub with the controller. Be careful when driving the sub, and start out slow. Many of the buttons provide advanced controls, but to start, just stick with using the left and right joysticks. Move the left joystick up/down for forward/backward, the left joystick left/right for left/right, the right joystick left/right for turning, and the right joystick up/down for ascending/descending.

⚠️ **GitHub.com Fallback** ⚠️