Skip to content

Installation and Setup

This page covers how to install and set up MOLARS, including dependencies and build instructions.

Dependencies

C++ Dependencies

MOLARS depends on the following C++ libraries:

  • LCM - Lightweight Communications and Marshalling library
  • Eigen 3 - Template library for linear algebra
  • BehaviorTree.CPP - Framework to create behavior trees

Install these dependencies using your package manager or by building from source.

Additionally, MOLARS depends on the following repositories, which are imported via vcstool:

Python Dependencies

MOLARS requires Python 3.12 with the following libraries:

  • lcm - Python bindings for LCM
  • lcmutils - Utilities for working with LCM in Python
  • fastapi - Web framework for building APIs
  • uvicorn - ASGI server for FastAPI

These can be installed using pip:

pip install -r requirements.txt

Building MOLARS

Clone and Import Dependencies

First, clone the MOLARS repository:

git clone https://github.com/CoMPASLab/molars.git
cd molars

Then, import the dependencies using vcstool:

vcs import < molars.repos

Build the Project

Create a build directory and build the project using CMake:

mkdir build
cd build
cmake ..
make

If you encounter build issues, please refer to the documentation for the dependencies listed above and submit an issue to the MOLARS repository.

Running MOLARS

MOLARS is composed of several components that run as separate processes. Before running any of the components, source the setup.bash file:

source setup.bash

Starting the Control Server

The control server provides an interface for issuing 6-DoF control commands to the AUV. It depends on the controller and state estimator, which should be running before starting the control server.

./control_server_node <report reference> <state> <reference> <global state>

Where:

  • <report reference> is the LCM channel on which the controller reports its target 6-DoF reference
  • <state> is the LCM channel on which the state estimator is publishing the current state
  • <reference> is the LCM channel on which the controller is listening for a 6-DoF reference
  • <global state> is the LCM channel on which the estimator is publishing the global state (if not applicable, use the same channel as <state>)

Starting the Navigation Server

The navigation server manages the navigation stack and coordinates planning, path following, and obstacle avoidance.

./navigation_server_node

Starting the Mission Server

The mission server manages the execution of missions by coordinating the other components.

./mission_server_node

Starting the API

MOLARS provides a REST API for interacting with the system via HTTP.

python -m api

Starting the REPL

MOLARS also provides a Python REPL for interactive control:

python repl.py

This will start an interactive Python shell where you can run commands to interact with the MOLARS system. The REPL automatically imports functions from several of the relevant mission_script modules for convenient access to the mission script API (see scripting documentation).