Caltech-AMBER / obelisk

A stable generic robot control interface.
https://caltech-amber.github.io/obelisk/
MIT License
5 stars 0 forks source link

Obelisk: A Stable Robot Control Interface

This repository hosts generic interfaces for controlling robots with ROS2.

Docs

Setup

Obelisk should be used as a dependency for external robot control code that is written in other downstream projects. There are a few options:

  1. Use Obelisk in Docker (this is mainly for developing in Obelisk).
  2. Use Obelisk on your local filesystem.
  3. Use Obelisk in a project that uses pixi.

Initial Setup

Initial setup proceeds by running the setup.sh script in the repository root. This script has the ability to make changes to your local dependencies - all such changes are opt-in. It is very important that you run setup.sh using the source command, and not bash, because there are environment variables that will be sourced!

This script has the ability to do 4 things:

  1. configure a conditional Docker build so that the image has the right dependencies in it to run Obelisk
  2. add the user to various groups necessary for running hardware
  3. install system dependencies on the machine running this script
  4. set up user-specific settings, including very useful bash aliases

The options are as follows:

source setup.sh [OPTIONS]

Options:
  --recommended                Apply recommended system-level changes
                               (cyclone performance optimizations, pixi, obelisk aliases)

  --basic                      Enables basic dependencies necessary for Obelisk locally
  --cyclone-perf               Enables cyclone performance optimizations
  --leap                       Enables LEAP hand dependencies
  --zed                        Enables ZED SDK

  --docker-install             Install Docker and nvidia-container-toolkit
  --install-sys-deps-docker    Installs system dependencies in Docker

  --config-groups              Configures user groups associated with hardware

  --install-sys-deps           Installs system dependencies
  --source-ros                 Sources base ROS in ~/.bashrc (only used if --install-sys-deps)

  --pixi                       Install pixi
  --obk-aliases                Add obelisk aliases to the ~/.bash_aliases file

  --help                       Display this help message and exit

Some guidance/recommendations on choosing flags:

If you're installing docker for the first time using this script, you also need to run afterwards

newgrp docker

Building Obelisk ROS Packages

Next, since Obelisk acts as a dependency for a downstream ROS2 project, you have to build it. You can either build it on your local filesystem or in a virtual environment that we manage using pixi.

Using Obelisk

Once Obelisk has been built, you can use it. If you have set up Obelisk using the --obk-aliases flag, we provide a very useful command:

obk

You should run obk in any terminal where you need to run Obelisk. It will set up important environment variables to configure the Obelisk stack while also sourcing the built Obelisk packages in that shell. obk also runs obk-build if it is detected that there is no install directory in the Obelisk workspace, so you can use it to first-time build Obelisk. You only need to run obk-build if you are developing and changing Obelisk's source code.

To clean Obelisk directories, run

obk-clean

This will delete cached build files associated with Obelisk. If you have tried building the Obelisk source code multiple times or from different environments/local filesystems, it may be corrupted, and cleaning the installation can help fix issues.

Building Docs

In the repository root, to build the docs locally, run sphinx-build -M html docs/source/ docs/build/.