|
| 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. |
0 commit comments