Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 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
5f9387b
Create jetson_realsense.sh
lzyang2000 Jul 4, 2025
6d2eb3c
Update jetson_realsense.sh
lzyang2000 Jul 4, 2025
741cea9
Update jetson_realsense.sh
lzyang2000 Jul 4, 2025
9515aa7
Update jetson_realsense.sh
lzyang2000 Jul 4, 2025
86e1b07
Update jetson_realsense.sh
lzyang2000 Jul 4, 2025
4143f37
Update jetson_realsense.sh
lzyang2000 Jul 4, 2025
52450ad
Update jetson_realsense.sh
lzyang2000 Jul 4, 2025
95f783d
Update jetson_realsense.sh
lzyang2000 Jul 4, 2025
647a98c
Update jetson_realsense.sh
lzyang2000 Jul 4, 2025
95132a1
Update jetson_realsense.sh
lzyang2000 Jul 4, 2025
dee911e
Update CMakeLists.txt to automatically detect arch
lzyang2000 Jul 5, 2025
20a6a00
fix bug in cmakelists
lzyang2000 Jul 5, 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
46 changes: 38 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,46 @@ 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:
```bash
source setup.sh \
--cyclone-perf \
--obk-aliases \
--zed \
--leap \
--pixi \
--config-groups
```

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,9 +56,6 @@ 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
Expand Down Expand Up @@ -78,7 +108,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 +132,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 +145,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/`.
21 changes: 15 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 Down Expand Up @@ -53,11 +53,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 Down
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
1 change: 1 addition & 0 deletions docker/docker-compose-no-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
OBELISK_DOCKER_PIXI: $OBELISK_DOCKER_PIXI
OBELISK_DOCKER_GROUP_LEAP: $OBELISK_DOCKER_GROUP_LEAP
dockerfile: Dockerfile
network: host
network_mode: host
ipc: host
environment:
Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
OBELISK_DOCKER_GROUP_LEAP: $OBELISK_DOCKER_GROUP_LEAP
OBELISK_DOCKER_GROUP_ZED: $OBELISK_DOCKER_GROUP_ZED
dockerfile: Dockerfile
network: host
network_mode: host
ipc: host
environment:
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.
18 changes: 17 additions & 1 deletion obelisk/cpp/obelisk_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,23 @@ find_package(visualization_msgs REQUIRED)
# ------- Mujoco ------- #
include(FetchContent)
set(MUJOCO_VERSION "3.1.6" CACHE STRING "mujoco version")
set(COMP_ARCH "x86_64" CACHE STRING "computer architecture")
# ------- Detect architecture and set COMP_ARCH accordingly ------- #
if(NOT DEFINED COMP_ARCH)
execute_process(
COMMAND uname -m
OUTPUT_VARIABLE ARCH_DETECTED
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(ARCH_DETECTED STREQUAL "x86_64")
set(COMP_ARCH "x86_64" CACHE STRING "computer architecture" FORCE)
message(STATUS "Detected architecture: x86_64")
elseif(ARCH_DETECTED STREQUAL "aarch64")
set(COMP_ARCH "aarch64" CACHE STRING "computer architecture" FORCE)
message(STATUS "Detected architecture: aarch64")
else()
message(FATAL_ERROR "Unsupported architecture: ${ARCH_DETECTED}")
endif()
endif()

FetchContent_Declare(
mujoco
Expand Down
Loading