Skip to content

Commit f769d77

Browse files
authored
Merge pull request #103 from j3soon/feat/readme-for-ai-agents
AI Agents (Claude Code, Codex) Support
2 parents 2fd985b + c6a4b56 commit f769d77

38 files changed

Lines changed: 610 additions & 17 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
_isaac_sim
2+
.env*

AGENTS.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
- `*_ws/` are independent ROS2 workspaces. Each contains `docker/compose.yaml`, `docker/Dockerfile`, `.devcontainer/`, and `src/` (ROS2 packages built with colcon inside the container).
5+
- `docker_modules/` holds shared install scripts that are hard-linked into each workspace via `./scripts/post_install.sh`.
6+
- `docs/` is MkDocs content, including per-workspace docs under `docs/<workspace-name>/`.
7+
- `scripts/` contains setup helpers (e.g., `post_install.sh`, `create_workspace.sh`).
8+
- `tests/` contains lint-style checks for compose files, Dockerfiles, MkDocs, and workspace templates.
9+
10+
## Build, Test, and Development Commands
11+
- `./scripts/post_install.sh` (or `-f` to force): refreshes docker module hard links; run after any repo change or branch switch.
12+
- `cd <workspace>/docker && docker compose build`: builds the workspace image.
13+
- `cd <workspace>/docker && docker compose up -d`: starts containers in the background.
14+
- `cd <workspace>/docker && docker compose exec <service> bash`: opens a shell in the container.
15+
- `./scripts/create_workspace.sh <new_workspace_name>`: scaffolds a new workspace from `template_ws`.
16+
- `./tests/test_all.sh`: runs linting scripts for structure and config validation.
17+
18+
## Coding Style & Naming Conventions
19+
- Workspaces must follow the `*_ws` naming pattern.
20+
- Use `docker/compose.yaml` (not `compose.yml` or other variants).
21+
- Keep required default files in each workspace: `.devcontainer/devcontainer.json`, `docker/Dockerfile`, `docker/compose.yaml`, `src/`, and `README.md`.
22+
- Prefer USDA over USD for Omniverse/Isaac assets where possible.
23+
24+
## Testing Guidelines
25+
- Primary checks are Python-based lint scripts executed via `./tests/test_all.sh`.
26+
- You can skip workspaces by setting `IGNORED_WORKSPACES` (e.g., `export IGNORED_WORKSPACES="tmp_ws"`).
27+
28+
## Commit & Pull Request Guidelines
29+
- Open and self-assign a GitHub issue before starting.
30+
- Branch naming: `feat/<name>` or `fix/<name>`.
31+
- Commit messages must follow Conventional Commits and include rationale and sources when relevant.
32+
- When `template_ws` changes require syncing other workspaces, make a separate minimal "unify" commit (preferred message: `feat: Unify workspaces style`).
33+
- If code/content is copied, include source and commit permalink in the commit message.
34+
- Add `Co-authored-by` lines for contributors who helped; avoid force-pushes once review starts.
35+
36+
## Configuration Tips
37+
- Set `export USER_UID=$(id -u)` on the host to match container user permissions.
38+
- Enable/disable modules via `build.args` in `docker/compose.yaml` (e.g., `CARTOGRAPHER=ON`).

CLAUDE.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Overview
6+
7+
ROS2 Humble multi-workspace repository for Autonomous Mobile Robots (AMRs) and robotic arm manipulators. Supports Isaac Sim/Lab/ROS for simulation-to-reality deployment. Targets amd64 (simulation+real) and arm64 (real only).
8+
9+
## Build & Run Commands
10+
11+
```sh
12+
# After clone, pull, or branch switch - ALWAYS run this first:
13+
./scripts/post_install.sh
14+
15+
# Force mode if files conflict:
16+
./scripts/post_install.sh -f
17+
18+
# Build and run a workspace:
19+
cd <workspace_name>/docker
20+
docker compose build
21+
docker compose up -d
22+
docker compose exec <service_name> bash
23+
24+
# Pull pre-built images (faster than building):
25+
cd <workspace_name>/docker
26+
docker compose pull
27+
28+
# Create a new workspace:
29+
./scripts/create_workspace.sh <new_workspace_name>
30+
31+
# Run linting tests:
32+
./tests/test_all.sh
33+
```
34+
35+
## Architecture
36+
37+
### Workspace Structure (`*_ws/`)
38+
Each workspace is independent and follows this pattern:
39+
- `docker/compose.yaml` - Primary build/run configuration with module args
40+
- `docker/Dockerfile` - Multi-arch image definition (references `modules/` scripts)
41+
- `.devcontainer/` - VS Code Dev Container configuration
42+
- `src/` - ROS2 packages (colcon builds these inside container)
43+
44+
### Docker Modules (`docker_modules/`)
45+
Shared install scripts (e.g., `install_ros.sh`, `install_isaac_sim.sh`) that get hard-linked into workspace `docker/modules/` directories via `post_install.sh`. This enables Docker build context to access shared scripts.
46+
47+
Modules are enabled/disabled via `build.args` in `compose.yaml`:
48+
```yaml
49+
args:
50+
CARTOGRAPHER: "YES" # or "" to disable
51+
RTABMAP: "YES"
52+
ISAAC_SIM_VERSION: "5.0.0" # or "" to skip
53+
ISAAC_LAB_VERSION: "2.2.1"
54+
```
55+
56+
### Key Files
57+
- `template_ws/` - Base workspace used as reference for creating new workspaces
58+
- `docs/` - MkDocs documentation source (each workspace has `docs/<workspace-name>/`)
59+
- `scripts/setup_docker_modules_link.sh` - Creates hard links for docker modules
60+
- `scripts/setup_docker_volume.sh` - Sets up shared Docker volumes
61+
62+
## Key Conventions
63+
64+
- Run `./scripts/post_install.sh` after any repo change affecting docker_modules
65+
- Set `export USER_UID=$(id -u)` in host shell for container user permissions
66+
- Workspaces share Docker volumes: `ros2-gazebo-cache`, `ros2-isaac-sim-cache`, `ros2-isaac-ros-assets`
67+
- `template_ws` Docker cache is shared by other workspaces to save build time
68+
69+
## Linting
70+
71+
The `tests/` directory contains Python linting scripts:
72+
- `lint_compose.py` - Validates compose.yaml files
73+
- `lint_dockerfile.py` - Validates Dockerfiles
74+
- `lint_comp_template.py` - Checks workspace compliance with template
75+
- `lint_filenames.py` - Validates file naming conventions
76+
- `lint_gitignore.py` - Checks gitignore consistency
77+
- `lint_workflows.py` - Validates GitHub Actions workflows
78+
- `lint_mkdocs.py` - Validates documentation structure
79+
- `lint_readme.py` - Checks README files
80+
81+
Set `IGNORED_WORKSPACES` env var to skip specific workspaces during linting.

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ We welcome all kinds of contributions, including but not limited to bug reports,
1919
2. Commit description should include as much details as possible. Try to include references you consulted and your rationale behind the changes. This will be essential for reviewers to understand the changes and for future reference. (e.g., [`058ff59`](https://github.com/j3soon/ros2-essentials/commit/058ff598ae705c95516353cd14a71945176c337e))
2020
3. If copied files from other sources, please include the source in the commit message. If copied from GitHub, include the permalink (link with commit ID) and the branch name. (e.g., [`6a2dac1`](https://github.com/j3soon/ros2-essentials/commit/6a2dac186e1321dc7f7ec961ad22628bffc352d3))
2121
4. Each commit should be atomic and self-contained.
22-
5. If anyone helped you during the development, please include them in the commit message using the `Co-authored-by` format (e.g., [`4f9832d`](https://github.com/j3soon/ros2-essentials/commit/4f9832d7a0c4156449d95b3503f9928d2d7de376) due to [this comment](https://github.com/j3soon/ros2-essentials/pull/85#discussion_r2204978905)). These include, but are not limited to, feedback from reviewers, in-person discussions, and pair programming sessions.
23-
6. Refrain from force-pushes after a reviewer has started reviewing your changes. The only exception is for new contributors when a reviewer has explicitly asked you to rebase your branch or modify commit messages.
24-
7. Use USDA instead of USD file format whenever possible for better readability and version control. (e.g., [PR#101](https://github.com/j3soon/ros2-essentials/pull/101))
22+
5. When updating `template_ws` defaults, follow up with a separate unify workspace style commit (preferred message: `feat: Unify workspaces style`) that applies the minimal template-alignment changes across all workspaces. Keep this separate from the template update commit.
23+
6. If anyone helped you during the development, please include them in the commit message using the `Co-authored-by` format (e.g., [`4f9832d`](https://github.com/j3soon/ros2-essentials/commit/4f9832d7a0c4156449d95b3503f9928d2d7de376) due to [this comment](https://github.com/j3soon/ros2-essentials/pull/85#discussion_r2204978905)). These include, but are not limited to, feedback from reviewers, in-person discussions, and pair programming sessions.
24+
7. Refrain from force-pushes after a reviewer has started reviewing your changes. The only exception is for new contributors when a reviewer has explicitly asked you to rebase your branch or modify commit messages.
25+
8. Use USDA instead of USD file format whenever possible for better readability and version control. (e.g., [PR#101](https://github.com/j3soon/ros2-essentials/pull/101))
2526

2627
Use `git log` and search for related commits to understand the commit message format.
2728

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ Edit the `build.args` section in the `*_ws/docker/compose.yml` file and rebuild
108108
| [Isaac Sim](https://j3soon.github.io/ros2-essentials/docker-modules/isaac-sim/) | ✔️ || Isaac Sim 5.0.0 Binary Install | ✔️ | [Johnson Sun](https://github.com/j3soon), [@JustinShih0918](https://github.com/JustinShih0918) |
109109
| [Isaac Lab](https://j3soon.github.io/ros2-essentials/docker-modules/isaac-lab/) | ✔️ || Isaac Lab 2.2.1 Git Install | ✔️ | [Johnson Sun](https://github.com/j3soon) |
110110
| [Isaac ROS](https://j3soon.github.io/ros2-essentials/docker-modules/isaac-ros/) | ✔️ | TODO | Isaac ROS 3.2 Apt Install (Base only) || [Johnson Sun](https://github.com/j3soon) |
111+
| [Claude Code](https://j3soon.github.io/ros2-essentials/docker-modules/claude-code/) | ✔️ | ✔️ | Claude Code CLI || [Johnson Sun](https://github.com/j3soon) |
112+
| [Codex](https://j3soon.github.io/ros2-essentials/docker-modules/codex/) | ✔️ | ✔️ | Codex CLI || [Johnson Sun](https://github.com/j3soon) |
111113
112114
## Docker Compose Cleanup
113115

aloha_ws/docker/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,5 +215,19 @@ COPY udev_rules/99-interbotix-udev.rules /etc/udev/rules.d/
215215
COPY --chown=$USERNAME:$USERNAME \
216216
.bashrc /home/$USERNAME/.bashrc
217217
# TODO: Copy additional files here
218+
219+
# Claude Code CLI configuration (installed last since the installation is fast)
220+
ARG CLAUDE_CODE=""
221+
COPY --chown=$USERNAME:$USERNAME \
222+
modules/install_claude_code.sh /tmp/install_claude_code.sh
223+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
224+
/tmp/install_claude_code.sh && rm /tmp/install_claude_code.sh
225+
# Codex CLI configuration
226+
ARG CODEX=""
227+
COPY --chown=$USERNAME:$USERNAME \
228+
modules/install_codex.sh /tmp/install_codex.sh
229+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
230+
/tmp/install_codex.sh && rm /tmp/install_codex.sh
231+
# TODO: Install more optional development tools here
218232
ENTRYPOINT []
219233
CMD ["/bin/bash"]

aloha_ws/docker/compose.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
chown ${USER_UID:-1000}:${USER_UID:-1000} /isaac-sim/standalone/cache &&
1919
chown ${USER_UID:-1000}:${USER_UID:-1000} /isaac-sim/standalone/cache/ov &&
2020
chown ${USER_UID:-1000}:${USER_UID:-1000} /isaac-sim/standalone/{logs,data}
21-
"
21+
"
2222
volumes:
2323
- isaac-sim-cache:/isaac-sim
2424
aloha-ws:
@@ -46,6 +46,10 @@ services:
4646
# CARTOGRAPHER: ""
4747
# TODO: Set to "YES" if using RTAB-Map or set to "" if not using RTAB-Map
4848
# RTABMAP: ""
49+
# TODO: Set to "YES" if using Claude Code CLI or set to "" if not using Claude Code CLI
50+
# CLAUDE_CODE: ""
51+
# TODO: Set to "YES" if using Codex CLI or set to "" if not using Codex CLI
52+
# CODEX: ""
4953
cache_from:
5054
- j3soon/ros2-aloha-ws:buildcache-amd64
5155
- j3soon/ros2-aloha-ws:buildcache-arm64
@@ -179,6 +183,10 @@ services:
179183
# TODO: Add more volume mounts here.
180184
# Mount root workspace to allow easy access to all workspaces.
181185
- ../..:/home/ros2-essentials
186+
# Mount credentials (for Claude Code CLI, Codex CLI, and etc.)
187+
- ../../.env/.claude:/home/user/.claude
188+
- ../../.env/.claude.json:/home/user/.claude.json
189+
- ../../.env/.codex:/home/user/.codex
182190
volumes:
183191
gazebo-cache:
184192
name: ros2-gazebo-cache

delto_gripper_ws/docker/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,19 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
182182
COPY --chown=$USERNAME:$USERNAME \
183183
.bashrc /home/$USERNAME/.bashrc
184184
# TODO: Copy additional files here
185+
186+
# Claude Code CLI configuration (installed last since the installation is fast)
187+
ARG CLAUDE_CODE=""
188+
COPY --chown=$USERNAME:$USERNAME \
189+
modules/install_claude_code.sh /tmp/install_claude_code.sh
190+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
191+
/tmp/install_claude_code.sh && rm /tmp/install_claude_code.sh
192+
# Codex CLI configuration
193+
ARG CODEX=""
194+
COPY --chown=$USERNAME:$USERNAME \
195+
modules/install_codex.sh /tmp/install_codex.sh
196+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
197+
/tmp/install_codex.sh && rm /tmp/install_codex.sh
198+
# TODO: Install more optional development tools here
185199
ENTRYPOINT []
186200
CMD ["/bin/bash"]

delto_gripper_ws/docker/compose.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
chown ${USER_UID:-1000}:${USER_UID:-1000} /isaac-sim/standalone/cache &&
1919
chown ${USER_UID:-1000}:${USER_UID:-1000} /isaac-sim/standalone/cache/ov &&
2020
chown ${USER_UID:-1000}:${USER_UID:-1000} /isaac-sim/standalone/{logs,data}
21-
"
21+
"
2222
volumes:
2323
- isaac-sim-cache:/isaac-sim
2424
delto-gripper-ws:
@@ -46,6 +46,10 @@ services:
4646
# CARTOGRAPHER: ""
4747
# TODO: Set to "YES" if using RTAB-Map or set to "" if not using RTAB-Map
4848
# RTABMAP: ""
49+
# TODO: Set to "YES" if using Claude Code CLI or set to "" if not using Claude Code CLI
50+
# CLAUDE_CODE: ""
51+
# TODO: Set to "YES" if using Codex CLI or set to "" if not using Codex CLI
52+
# CODEX: ""
4953
cache_from:
5054
- j3soon/ros2-delto-gripper-ws:buildcache-amd64
5155
- j3soon/ros2-delto-gripper-ws:buildcache-arm64
@@ -179,6 +183,10 @@ services:
179183
# TODO: Add more volume mounts here.
180184
# Mount root workspace to allow easy access to all workspaces.
181185
- ../..:/home/ros2-essentials
186+
# Mount credentials (for Claude Code CLI, Codex CLI, and etc.)
187+
- ../../.env/.claude:/home/user/.claude
188+
- ../../.env/.claude.json:/home/user/.claude.json
189+
- ../../.env/.codex:/home/user/.codex
182190
volumes:
183191
gazebo-cache:
184192
name: ros2-gazebo-cache
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ -z "$CLAUDE_CODE" ]; then
5+
echo "Skipping Claude Code installation as CLAUDE_CODE is not set"
6+
exit 0
7+
fi
8+
9+
# Ref: https://code.claude.com/docs/en/setup
10+
# Install Claude Code CLI
11+
# This script is intended to be run inside the Dockerfile during build.
12+
if [ "$CLAUDE_CODE" = "YES" ]; then
13+
echo "Installing Claude Code CLI"
14+
15+
# Install Claude Code CLI using official installer
16+
curl -fsSL https://claude.ai/install.sh | bash
17+
18+
echo "Claude Code CLI installed successfully!"
19+
echo "Version information:"
20+
claude --version || true
21+
fi
22+
23+
echo "Claude Code installation completed!"

0 commit comments

Comments
 (0)