WRover Software
Loading...
Searching...
No Matches
WRover Setup
Collaboration diagram for WRover Setup:

This document describes the setup process for the rover.

Hardware Configuration

If the hardware is already configured (i.e. the rover is already put together), you can skip this section.

To begin with, you'll want to procure a Mars rover. The rover should have roughly the following hardware subsystems:

Preparing the Raspberry Pi

Flashing Ubuntu 20.04

You'll want to start by flashing the Raspberry Pi's SD card with Ubuntu 20.04 "Focal Fossa".

Canonical distributes server versions of Ubuntu 20.04, these can be deloyed to an SD card via the Raspberry Pi.

After re-inserting the SD card, you'll want to boot up the Raspberry Pi and complete the first-time setup for Ubuntu, which can be done with an external monitor and keyboard. Make sure you set the user account's name to wiscrobo!

Setting Up Python 3

You'll need Python 3 to run the ROS-based robot software, as well as a couple tools for installing dependencies. To install Python 3 and the pip package management tool, you can use the command:

sudo apt install python3 python3-pip

Then, you can use pip to install the virtualenv package:

python3 -m pip install virtualenv

Installing ROS

You'll now want to install ROS Noetic itself. Follow the installation instructions on the ROS wiki to do this. It is recommended that you install the ros-noetic-ros-base ("bare-bones") meta-package only, as the rover doesn't necessarily need the GUI tools included in ros-noetic-desktop.

Setting Up the SSH Server

For the base station (and any other remote machine) to interact with the rover, you'll need to install an SSH server. The recommended implementation is the OpenSSH server daemon sshd, which can be installed with the command:

sudo apt install openssh-server

Now, you'll want to modify the configuration to allow for public key authentication. Open the file /etc/ssh/sshd_config in your text editor of choice and ensure that the following line is uncommented:

-config
PubkeyAuthentication yes

Then, to start up the server, you can enable the SSH service with the commands:

sudo systemctl enable ssh
sudo systemctl start ssh

You could now test to see if it's possible to SSH to the rover from a remote machine. Get the WRover's IP address by running this command on the WRover:

ifconfig

Look for an ethernet address, and substitute it in for this command on the base station.

ssh wiscrobo@<ip-of-wrover>

You'll also have to configure public key authentication for any base station machines; see setup_dev.md for more details on this.

Setting Up mDNS/zeroconf

This section does not work reliably in practice. Consider the time cost of setting this up/debugging, and don't fall for the sunk-cost fallacy.

The software system uses mDNS/zeroconf to find the rover on the network. To allow for this, you'll need to install an mDNS service on the rover which responds to name resolution requests. Ubuntu should already ship with the Avahi daemon, a popular mDNS implementation, but if not, you can install it with:

sudo apt install avahi-daemon

Now, you'll need to do is update the rover's mDNS hostname to wrover-pi in the Avahi configuration file /etc/avahi/avahi-daemon.conf:

[server]
host-name=wrover-pi

Once this is done, you can restart the Avahi daemon using the command:

sudo systemctl restart avahi-daemon

To make sure this worked correctly, you can try pinging the rover by hostname from the base station:

ping wrover-pi.local

Setting Up IP Cameras

Use GStreamer/similar to convert the USB cameras to RTSP streams. Then, use the simple-rtsp-server program found online to act as a transmission manager for the RTSP streams and serve cameras to the base station.

The cameras typically involve a lot of tuning to get optimal streaming characteristics. The CPU load incurred by the cameras may cause the team to use a separate camera co-processor to alliviate load from the main CPU. Good camera characteristics would probably be:

These needn't be achieved at the same time, but if they aren't, the swap should be quick.

Getting the WRover Code

You'll want to start by cloning this repository to /home/wiscrobo/WRover_Software. Next, navigate into the repository and run the commands:

./assemble.py init # initialize the catkin workspace + venv
source setup.sh # acquire the workspace environment
./assemble.py build # build dependencies + workspace

Then, continue setting up the WRover environment according to the Developer Setup Instructions. Keep in mind that the WRover is a shared machine, so be careful adding things like GitHub SSH keys. You will have to locally build the code to get the executables and message definitions needed to run the code.