Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ab5272c
update/fix setup scripts
alberthli Jun 10, 2025
119106a
update pixi
alberthli Jun 10, 2025
fee68e3
update versions of internal deps
alberthli Jun 10, 2025
d1ba144
update docker to work for fr3 setup
alberthli Jun 10, 2025
af1d029
update README for clarity on FR3 setup
alberthli Jun 10, 2025
ad88a4d
remove recommended option in the README
alberthli Jun 10, 2025
1e919b4
update pixi version in workflow
alberthli Jun 10, 2025
ddb01fb
update python and ubuntu versions in CI
alberthli Jun 10, 2025
c787e46
updated pixi deps
alberthli Jun 10, 2025
e68a183
run linter on all files
alberthli Jun 10, 2025
5989875
fix ruff formatting
alberthli Jun 10, 2025
c491bd6
update linter versions + fix formatting
alberthli Jun 10, 2025
3810917
fix formatting
alberthli Jun 10, 2025
3248009
resolve merge conflicts
alberthli Jun 11, 2025
a5ab6c2
remove accidentally committed unresolved merge conflicts
alberthli Jun 11, 2025
808a459
update
alberthli Jun 23, 2025
cd6bb79
fix linting error
alberthli Jun 23, 2025
212b5c8
Merge pull request #136 from Caltech-AMBER/alberthli/update-setup
alberthli Jun 23, 2025
02c44f4
first cut at adding the fr3 hardware interface + package
alberthli Jun 23, 2025
be54eb7
fix pyright errors
alberthli Jun 23, 2025
a1712b3
[UNTESTED] push some code prior to testing the fr3 interface on multi…
alberthli Jun 23, 2025
aa12730
remove docker-fr3 flag
alberthli Jun 23, 2025
9ee373f
remove docker fr3 build args
alberthli Jun 23, 2025
4ebc7a7
various changes/fixes to get the FR3 interface to boot up
alberthli Jun 23, 2025
eba62d5
make ROS_DOMAIN_ID 0 by default unless something is passed for it
alberthli Jun 23, 2025
28794af
try publishing states at 1khz
alberthli Jun 23, 2025
883fe92
adjust to seemingly maximum of 250hz
alberthli Jun 23, 2025
4a86f06
change control mode to joint by default
alberthli Jun 23, 2025
ef0722e
try fixing indexing
alberthli Jun 23, 2025
f852c7f
add a joint_vel control mode to the driver
alberthli Jun 24, 2025
96a449f
add configuration of the realtime group for fr3 setup
alberthli Jun 24, 2025
d5a7549
update cap_add and ulimits
alberthli Jun 24, 2025
74ccf7d
update example joint controller
alberthli Jun 24, 2025
16c3e4b
catch control exceptions
alberthli Jun 24, 2025
b014d6c
set relative dynamics factor for arm
alberthli Jun 24, 2025
ef682ea
adjustments and debugging
alberthli Jun 24, 2025
5aae82d
adjust fr3 hardware settings
alberthli Jun 24, 2025
5d2f124
minor change to global state node entrypoint
alberthli Jun 24, 2025
0c751bc
test
alberthli Jun 24, 2025
05537b4
add launch_global flag to obk-launch
alberthli Jun 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ permissions:

jobs:
code-checks:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
- uses: prefix-dev/setup-pixi@v0.8.1
python-version: '3.13'
- uses: prefix-dev/setup-pixi@v0.8.8
with:
pixi-version: v0.26.1
pixi-version: v0.48.1
cache: true
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pixi.toml') }}
- name: Set Up Development Environment
run: |
source setup.sh --recommended --leap
source setup.sh --obk-aliases --leap
docker compose -f $GITHUB_WORKSPACE/docker/docker-compose-ci.yml up -d
- name: Build Obelisk ROS2 messages
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
pages:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand All @@ -26,5 +26,5 @@ jobs:
- id: deployment
uses: sphinx-notes/pages@v3
with:
python_version: 3.11
python_version: 3.13
documentation_path: ./docs/source
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.4.9
rev: v0.11.13
hooks:
- id: ruff
types_or: [ python, pyi, jupyter ]
args: [ --fix ]
- id: ruff-format
types_or: [ python, pyi, jupyter ]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.5
rev: v20.1.5
hooks:
- id: clang-format
args: ['--style=file']
Expand Down
49 changes: 41 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,47 @@ This repository hosts generic interfaces for controlling robots with ROS2.

[Docs](https://caltech-amber.github.io/obelisk/)

## Setup
# Quickstart

This section contains Quickstart information for members of the AMBER Lab.

## FR3
Initial setup in the repo root. For AMBER lab members, get the FR3 credentials from Albert or Gary.
```bash
source setup.sh \
--cyclone-perf \
--obk-aliases \
--pixi \
--fr3 \
--config-groups \
--fr3-username=<YOUR_FR3_USERNAME> \
--fr3-password=<YOUR_FR3_PASSWORD>
```

Enter Docker container + setup in the container:
```bash
cd docker
docker compose -f docker-compose.yml run --build obelisk
```

Inside the Docker container:
```
# build and enter the pixi shell
pixi shell -e dev

# activate obelisk, clean, and rebuild
obk
obk-clean
obk-build
```

# 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
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:
Expand All @@ -23,13 +57,12 @@ 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
--unitree Enables Unitree dependencies
--fr3 Enables FR3 dependencies

--docker-install Install Docker and nvidia-container-toolkit
--install-sys-deps-docker Installs system dependencies in Docker
Expand Down Expand Up @@ -78,7 +111,7 @@ If you're installing `docker` for the first time using this script, you also nee
newgrp docker
```

### Building Obelisk ROS Packages
## 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`.

* If you are building it on your local filesystem, you need some minimal set of local dependencies. These should have been installed in the previous step.
Expand All @@ -102,7 +135,7 @@ Next, since Obelisk acts as a dependency for a downstream ROS2 project, you have
obk-build
```

### Using Obelisk
## 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
Expand All @@ -115,5 +148,5 @@ 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
# Building Docs
In the repository root, to build the docs locally, run `sphinx-build -M html docs/source/ docs/build/`.
26 changes: 20 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

# base image
FROM ubuntu:22.04 as base
FROM ubuntu:24.04 as base
SHELL ["/bin/bash", "-c"]

# build args
Expand All @@ -14,6 +14,7 @@ ARG OBELISK_DOCKER_BASIC=false
ARG OBELISK_DOCKER_CYCLONE_PERF=false
ARG OBELISK_DOCKER_LEAP=false
ARG OBELISK_DOCKER_ZED=false
ARG OBELISK_DOCKER_FR3=false
ARG OBELISK_DOCKER_PIXI=false

ARG OBELISK_DOCKER_GROUP_LEAP=false
Expand All @@ -29,10 +30,12 @@ ENV OBELISK_DOCKER_BASIC=$OBELISK_DOCKER_BASIC
ENV OBELISK_DOCKER_CYCLONE_PERF=$OBELISK_DOCKER_CYCLONE_PERF
ENV OBELISK_DOCKER_LEAP=$OBELISK_DOCKER_LEAP
ENV OBELISK_DOCKER_ZED=$OBELISK_DOCKER_ZED
ENV OBELISK_DOCKER_FR3=$OBELISK_DOCKER_FR3
ENV OBELISK_DOCKER_PIXI=$OBELISK_DOCKER_PIXI

ENV OBELISK_DOCKER_GROUP_LEAP=$OBELISK_DOCKER_GROUP_LEAP
ENV OBELISK_DOCKER_GROUP_ZED=$OBELISK_DOCKER_GROUP_ZED
ENV OBELISK_DOCKER_GROUP_FR3=$OBELISK_DOCKER_FR3

ENV XDG_RUNTIME_DIR=/run/user/${UID}

Expand All @@ -53,11 +56,20 @@ RUN apt-get update && apt-get install -y \
locale-gen en_US.UTF-8

# create non-root user with sudo privileges
RUN groupadd --gid $GID $USER && \
useradd --uid $UID --gid $GID -m $USER -d /home/${USER} --shell /usr/bin/bash && \
echo "${USER}:password" | chpasswd && \
usermod -aG sudo ${USER} && \
echo "%${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# if the UID/GID in the container conflict with the host, then change the user/group to that of the host
RUN if id -u ${UID} &>/dev/null; then \
existing_user=$(getent passwd ${UID} | cut -d: -f1); \
usermod -l ${USER} ${existing_user} && \
usermod -d /home/${USER} -m ${USER}; \
existing_group=$(getent group ${GID} | cut -d: -f1); \
if [ "${existing_group}" != "${USER}" ]; then \
groupmod -n ${USER} ${existing_group}; \
fi; \
else \
groupadd --gid ${GID} ${USER}; \
useradd --uid ${UID} --gid ${GID} -m ${USER} -d /home/${USER} --shell /usr/bin/bash; \
fi && \
echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# conditionally install dependencies based on build args
# source base ROS if basic deps are installed and you are not using pixi
Expand All @@ -68,6 +80,7 @@ RUN FLAGS=""; \
[ "$OBELISK_DOCKER_BASIC" = "true" ] && [ "$OBELISK_DOCKER_PIXI" = "false" ] && FLAGS="$FLAGS --source-ros"; \
[ "$OBELISK_DOCKER_LEAP" = "true" ] && FLAGS="$FLAGS --leap"; \
[ "$OBELISK_DOCKER_ZED" = "true" ] && FLAGS="$FLAGS --zed"; \
[ "$OBELISK_DOCKER_FR3" = "true" ] && FLAGS="$FLAGS --fr3"; \
[ "$OBELISK_DOCKER_UNITREE" = "true" ] && FLAGS="$FLAGS --unitree"; \
bash /tmp/install_sys_deps.sh $FLAGS && \
sudo rm /tmp/install_sys_deps.sh
Expand All @@ -77,6 +90,7 @@ COPY config_groups.sh /tmp/config_groups.sh
RUN FLAGS=""; \
[ "$OBELISK_DOCKER_GROUP_LEAP" = "true" ] && FLAGS="$FLAGS --leap"; \
[ "$OBELISK_DOCKER_GROUP_ZED" = "true" ] && FLAGS="$FLAGS --zed"; \
[ "$OBELISK_DOCKER_GROUP_FR3" = "true" ] && FLAGS="$FLAGS --fr3"; \
bash /tmp/config_groups.sh $FLAGS && \
sudo rm /tmp/config_groups.sh

Expand Down
11 changes: 11 additions & 0 deletions docker/config_groups.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# --- script flags --- #
leap=false
zed=false
fr3=false

for arg in "$@"; do
case $arg in
Expand All @@ -15,6 +16,10 @@ for arg in "$@"; do
zed=true
shift # Enables ZED SDK
;;
--fr3)
fr3=true
shift # Enables FR3 dependencies
;;

# help
--help)
Expand All @@ -23,6 +28,7 @@ for arg in "$@"; do
Options:
--leap Adds user to the dialout group
--zed Adds user to the video group
--fr3 Adds user to the realtime group
--help Display this help message and exit
"
shift
Expand All @@ -43,3 +49,8 @@ fi
if [ "$zed" = true ]; then
sudo usermod -a -G video $USER
fi

if [ "$fr3" = true ]; then
sudo addgroup realtime
sudo usermod -a -G realtime $USER
fi
1 change: 1 addition & 0 deletions docker/docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
OBELISK_ROOT: $OBELISK_ROOT
OBELISK_DOCKER_PIXI: true
dockerfile: Dockerfile
network: host
network_mode: host
ipc: host
environment:
Expand Down
12 changes: 12 additions & 0 deletions docker/docker-compose-no-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ services:
OBELISK_DOCKER_BASIC: $OBELISK_DOCKER_BASIC
OBELISK_DOCKER_CYCLONE_PERF: $OBELISK_DOCKER_CYCLONE_PERF
OBELISK_DOCKER_LEAP: $OBELISK_DOCKER_LEAP
OBELISK_DOCKER_FR3: $OBELISK_DOCKER_FR3
OBELISK_DOCKER_PIXI: $OBELISK_DOCKER_PIXI
OBELISK_DOCKER_GROUP_LEAP: $OBELISK_DOCKER_GROUP_LEAP
OBELISK_DOCKER_GROUP_FR3: $OBELISK_DOCKER_GROUP_FR3
dockerfile: Dockerfile
network: host
network_mode: host
ipc: host
environment:
Expand All @@ -25,13 +28,22 @@ services:
OBELISK_DOCKER_BASIC: $OBELISK_DOCKER_BASIC
OBELISK_DOCKER_CYCLONE_PERF: $OBELISK_DOCKER_CYCLONE_PERF
OBELISK_DOCKER_LEAP: $OBELISK_DOCKER_LEAP
OBELISK_DOCKER_FR3: $OBELISK_DOCKER_FR3
OBELISK_DOCKER_PIXI: $OBELISK_DOCKER_PIXI
OBELISK_DOCKER_GROUP_LEAP: $OBELISK_DOCKER_GROUP_LEAP
OBELISK_DOCKER_GROUP_FR3: $OBELISK_DOCKER_GROUP_FR3
FR3_USERNAME: $OBELISK_DOCKER_FR3_USERNAME
FR3_PASSWORD: $OBELISK_DOCKER_FR3_PASSWORD
QT_X11_NO_MITSHM: 1
security_opt:
- seccomp=unconfined
cap_add:
- SYS_NICE
- NET_ADMIN
ulimits:
rtprio: 99
rttime: -1
memlock: 8428281856
volumes:
- $OBELISK_ROOT:$OBELISK_ROOT
- /tmp/.X11-unix:/tmp/.X11-unix
Expand Down
12 changes: 12 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ services:
OBELISK_DOCKER_CYCLONE_PERF: $OBELISK_DOCKER_CYCLONE_PERF
OBELISK_DOCKER_LEAP: $OBELISK_DOCKER_LEAP
OBELISK_DOCKER_ZED: $OBELISK_DOCKER_ZED
OBELISK_DOCKER_FR3: $OBELISK_DOCKER_FR3
OBELISK_DOCKER_PIXI: $OBELISK_DOCKER_PIXI
OBELISK_DOCKER_GROUP_LEAP: $OBELISK_DOCKER_GROUP_LEAP
OBELISK_DOCKER_GROUP_ZED: $OBELISK_DOCKER_GROUP_ZED
OBELISK_DOCKER_GROUP_FR3: $OBELISK_DOCKER_GROUP_FR3
dockerfile: Dockerfile
network: host
network_mode: host
ipc: host
environment:
Expand All @@ -29,14 +32,23 @@ services:
OBELISK_DOCKER_CYCLONE_PERF: $OBELISK_DOCKER_CYCLONE_PERF
OBELISK_DOCKER_LEAP: $OBELISK_DOCKER_LEAP
OBELISK_DOCKER_ZED: $OBELISK_DOCKER_ZED
OBELISK_DOCKER_FR3: $OBELISK_DOCKER_FR3
OBELISK_DOCKER_PIXI: $OBELISK_DOCKER_PIXI
OBELISK_DOCKER_GROUP_LEAP: $OBELISK_DOCKER_GROUP_LEAP
OBELISK_DOCKER_GROUP_ZED: $OBELISK_DOCKER_GROUP_ZED
OBELISK_DOCKER_GROUP_FR3: $OBELISK_DOCKER_GROUP_FR3
FR3_USERNAME: $OBELISK_DOCKER_FR3_USERNAME
FR3_PASSWORD: $OBELISK_DOCKER_FR3_PASSWORD
QT_X11_NO_MITSHM: 1
security_opt:
- seccomp=unconfined
cap_add:
- SYS_NICE
- NET_ADMIN
ulimits:
rtprio: 99
rttime: -1
memlock: 8428281856
volumes:
- $OBELISK_ROOT:$OBELISK_ROOT
- /tmp/.X11-unix:/tmp/.X11-unix
Expand Down
2 changes: 1 addition & 1 deletion docs/source/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ docker compose -f docker/docker-compose-no-gpu.yml run --build obelisk

Either way, your repository root will be mounted into the container at the exact same file location, your username, user ID, and group ID will be shared with the container, and you can freely run `sudo` without supplying a password for any command.

<!--
<!--
Once ready for development, you should start the `pixi` shell, which is like activating a `conda` environment (but `pixi` environments are project/directory-specific, not shell-wide). To do this, run in the repo root:
```
# if your machine has a gpu
Expand Down
5 changes: 1 addition & 4 deletions docs/source/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ is critical as this runs the Obelisk setup script within the docker container. I
The flag options are:
```
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
Expand Down Expand Up @@ -131,4 +128,4 @@ obk-launch config_file_path=dummy_cpp.yaml device_name=onboard
```
At this point you should see a Mujoco simulation running.

`obk-launch` is an important alias that calls the obelisk launch file. Assuming your code conforms to Obelisk standards (discussing in a later section), an `obk-launch` command should be all you need to bring the full stack, including simulation/hardware.
`obk-launch` is an important alias that calls the obelisk launch file. Assuming your code conforms to Obelisk standards (discussing in a later section), an `obk-launch` command should be all you need to bring the full stack, including simulation/hardware.
2 changes: 1 addition & 1 deletion obelisk/cpp/obelisk_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ find_package(visualization_msgs REQUIRED)

# ------- Mujoco ------- #
include(FetchContent)
set(MUJOCO_VERSION "3.1.6" CACHE STRING "mujoco version")
set(MUJOCO_VERSION "3.3.2" CACHE STRING "mujoco version")
set(COMP_ARCH "x86_64" CACHE STRING "computer architecture")

FetchContent_Declare(
Expand Down
Loading