Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Software Overview

Carmen edited this page Sep 5, 2021 · 15 revisions

Here you can find a general overview of the rover's software architecture and a brief explanation of the roles of some important applications in the system. For more in-depth documentation of each program, check out the README in its sub-directory.

Table of Contents

  1. Introduction
  2. 3rd Party Software
  3. Ansible Playbooks
  4. Jarvis
  5. LCM Utilities
  6. Jetson
  7. Base Station
  8. Beaglebones
  9. Raspberry Pi Zeroes
  10. Common
  11. Scripts
  12. Simulators

1. Introduction

All custom software for the rover is contained in the mrover-workspace tree. Programs are organized into functional clusters, with each cluster having its own sub-directory (e.g., programs that run on the Jetson can be found in onboard and those running on the base station in base_station). Individual programs are contained in sub-directories within their functional cluster (e.g., the program controlling the drive motors is in onboard/odrive_bridge and the autonomous path planning program is in onboard/nav).

Programs are built and executed using MRover's custom build system Jarvis, for which documentation can be found here. The majority of the software is written in Python, C++, and JavaScript.

2. 3rd Party Software

Some of the software relies on third party applications. For the sake of simplicity, we include copies of their GitHub repositories in our own under the 3rdparty sub-directory. This allows us to build and use these dependencies with minimal additional effort in the development environment setup.

2.1 LCM

LCM (Lightweight Communications and Marshalling) is the primary means by which separate programs communicate with each other on the rover network. It uses a simple publisher/subscriber message passing model. A more in-depth explanation of how to use LCM for rover applications can be found here.

2.2 RapidJSON

RapidJSON is a fast JSON parser/generator for C++.

2.3 Phoenix

The phoenix sub-directory contains pre-compiled binaries of the Phoenix library for interfacing with Talon SRX motor controllers from the Jetson TX2. Their use on the rover is deprecated as of 2019-20.

3. Ansible Playbooks

Ansible is an IT automation tool. On MRover, it is used to easily configure a system with the necessary dependencies, services and network configurations for rover applications. Each script is called a playbook, and the ansible directory contains a playbook and associated roles for each of the rover's computers. The instructions to run an ansible script can be found in the ansible sub-directory's README, and a more in-depth discussion can be found on the development environment setup page.

4. Jarvis

Jarvis is MRover's custom build system. It features an easy-to-learn user interface and makes it simple to build applications and their dependencies, as well as execute them. Jarvis is invoked by executing the bash script jarvis in the root workspace directory. The bulk of Jarvis' code is found in jarvis_files. In-depth documentation on how to use Jarvis can be found here.

Jarvis was written largely by Nathan Moos, Software Branch lead until 2018.

5. LCM Utilities

The repository contains some utilities to extend the functionality of LCM to meet the needs of MRover. Most notably, LCM does not natively support JavaScript. The LCM Bridge client and server enable JavaScript applications such as the Base Station GUI to communicate with other applications. Their source code can be found in the lcm_bridge sub-directory.

Additionally, some command-line utilities for LCM that are useful for debugging are contained in lcm_tools. These include echo (which dumps all messages on a given channel to the terminal) and send (which is used to send a single message).

Finally, all message structs used by rover programs are found in the rover_msgs sub-directory.

6. Jetson

The rover's central onboard computer is an Nvidia Jetson TX2. The jetson sub-directory contains the applications which are run on this computer. Some notable applications include nav (autonomous path planning), cv (computer vision), odrive_bridge (mobility motor control), nucleo_bridge (general motor control), and teleop (rover heartbeat and translation of user commands).

7. Base Station

The base station is the computer from which the rover is operated. One of the team laptop's typically serves as the base station. Programs running on the base station are found in the base_station sub-directory. The most important of these is gui, which handles transmission of controller commands and displays relevant information for the operator.

8. Beaglebones

The rover has one BeagleBone Black for interfacing with most of the science sensors and actuators. It has a great deal of IO capabilities such as GPIOs, UARTs, I2C, and ADCs. Programs that run on the BeagleBone are found in the beaglebone sub-directory. They typically perform only basic functionality like reading and publishing data from a sensor or controlling GPIO devices.

9. Raspberry Pi Zeroes

The rover has eight Raspberry Pi Zeroes that each interface with a Raspberry Pi Camera and stream its video feed back to the base station. The pi_zeroes sub-directory contains the only program that runs on the Pis (video).

10. Common

Many of the Python programs in the repository require common functionalities. Libraries which implement these functions are found in the rover_common sub-directory. Most notably, many applications take advantage of the asyncio module to write concurrent programs. Some helper functions to simplify this as well as an async wrapper for LCM can be found in rover_common.

11. Scripts

The scripts sub-directory contains scripts for things such as radio configuration and generation of a JSON file representing all of the message structs in rover_msgs for use by the LCM utility programs.

12. Simulators

A great deal of testing done by the Autonomous Navigation subteam happens in a simulator. This enables quick, idealized testing of path-planning algorithms without having to worry about the logistical challenges and complicating factors that come with setting up and running the actual rover. The team's simulator for testing the navigation state machine is found in simulators/nav.

Clone this wiki locally