Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
offline tests, installed-wheel tests and explicit user-operated real-machine trials.
- Do not commit machine profiles, calibration, credentials, logs, models, SDK builds
or caches. Configure device paths externally. Preserve third-party license notices.
- Sole calibration exception: the operator explicitly approved publishing the
sanitized, installation-specific head-camera baseline under `configs/cameras/`.
Keep its versions, hashes, frames and limitations; never include raw evidence,
personal paths/device topology, or auto-activate it on another installation.
- Maintain one CLI, concise Viser interfaces, and public APIs documented in README.
- Initial extraction keeps the legacy CAN lock directory to interoperate with the
original bimanual_tactile installation; do not change one side independently.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.8.2 — 2026-11-10

- Publish the operator-approved, installation-specific Astra Pro RGB head-camera
baseline `20261110-v1`: native 1280×720 intrinsics/distortion, metric
`base_from_camera`, coordinate conventions, robot FK identity and provenance.
A SHA-256-pinned current selection prevents silent parameter replacement.
- Bind the same bytes to the existing Hugging Face OpenArm supplied-gripper model
in asset package `v0.3.1`. The immutable lock and camera scene entry reproduce
`head_calibrated` without modifying original meshes, task cameras or model/data
payloads. Retain physical-calibration limitations and the original raw evidence
externally; this is not independent absolute-accuracy certification.
- Add dependency-free configuration integrity tests and include the baseline and
asset lock in source distributions. No motor behavior, device selection,
live-service deployment or automatic hardware activation changes.
- Fix a read-only collection-preview freshness race by sampling wall time after
reading an atomic status snapshot. Preserve explicit-time checks and stale/future
rejection; add a deterministic concurrent-publication regression test.

## 0.8.1 — 2026-11-01

- Add same-origin collection visualization at `/#collection`: fresh/stale
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ including exception cleanup, rather than copying implementation details.
Record actual hardware checks separately in [validation](docs/validation.md).
Keep device configuration, calibration, logs and cached assets outside Git.

The explicit operator-approved exception is the sanitized, installation-specific
head-camera baseline in `configs/cameras/`. Keep it versioned and hash-bound;
raw calibration evidence and personal machine/device configuration stay external.
See `configs/cameras/README.md` for its scope and coordinate/validity contract.

## API changes

Keep examples and [the API guide](docs/api.md) aligned with public exports.
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ recursive-include docs *.md
recursive-include tests *.py
include LICENSE CHANGELOG.md CONTRIBUTING.md
recursive-include examples *.py *.json
recursive-include configs/cameras *.json *.md
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ the CLI for live inspection and user-operated control.

Python 3.12 · MIT · Linux SocketCAN for followers · Independent community project

## 固定头部相机配置与仿真资产

**v0.8.2** includes the operator-selected Astra Pro RGB head-camera baseline
`20261110-v1`: [versioned parameters and usage](configs/cameras/README.md),
[SHA-256-pinned selection](configs/cameras/current-head.json), and the
[immutable Hugging Face asset lock](configs/cameras/huggingface-head.lock.json).
The bound MuJoCo scene renders `head_calibrated` using the same intrinsics and
camera-to-base transform. It reuses the existing robot model; historical task
cameras, policies and physical-control behavior are unchanged. This is specific
to the approved camera installation, not a universal Astra Pro default or an
automatic hardware activation. Raw calibration evidence remains external.

## Policy execution and gravity compensation

The platform also provides **数采可视化** at `/#collection`: recording state,
Expand Down Expand Up @@ -55,10 +67,10 @@ python3.12 -m venv .venv
source .venv/bin/activate

# Core: state types, software mapping and control API; no GUI or hardware SDK.
pip install "openarm-runtime @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.1"
pip install "openarm-runtime @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.2"

# Serial leader readout, with a browser-based virtual robot.
pip install "openarm-runtime[leader,viewer] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.1"
pip install "openarm-runtime[leader,viewer] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.2"
```

Extras compose freely:
Expand All @@ -82,7 +94,7 @@ project's environment. With uv, declare and lock the dependency directly:

```sh
# Run in your own Python 3.12 project.
uv add "openarm-runtime[leader,viewer] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.1"
uv add "openarm-runtime[leader,viewer] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.2"
```

**Modify the runtime while developing your application:** clone the source
Expand Down Expand Up @@ -127,7 +139,7 @@ configure the machine once using [platform.example.json](platform.example.json),
then launch:

```sh
python -m pip install "openarm-runtime[platform] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.1"
python -m pip install "openarm-runtime[platform] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.2"
openarm-runtime platform --profile ~/.config/openarm-runtime/platform.json
```

Expand Down Expand Up @@ -282,7 +294,7 @@ ssh -N -L 8890:127.0.0.1:8890 -L 8891:127.0.0.1:8891 your-workstation
Video is available starting with v0.3.0:

```sh
python -m pip install "openarm-runtime[video] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.1"
python -m pip install "openarm-runtime[video] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.2"
# No cameras or vendor SDK required; clearly labelled SIMULATION.
openarm-runtime video --simulate --port 5004
```
Expand Down Expand Up @@ -400,7 +412,7 @@ examples in `examples/`. [Changelog](CHANGELOG.md) · [Provenance](ORIGIN.md) ·
Paxini IP-M2324-Core (68 points) with the single-channel USB serial converter:

```sh
pip install "openarm-runtime[tactile,viewer] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.1"
pip install "openarm-runtime[tactile,viewer] @ git+https://github.com/Edge-Intelligence-Lab/openarm-runtime.git@v0.8.2"
openarm-runtime tactile --device /dev/serial/by-id/YOUR_CONVERTER --device-id 2 --port 8891
```

Expand Down
85 changes: 85 additions & 0 deletions configs/cameras/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 头部相机基准配置

这是当前 OpenArm V2 安装上,经操作者确认的 **Astra Pro RGB 头部相机基准**。
它包含实测内参、畸变、相机到机器人基座的外参,以及数据来源和适用条件。
它不是所有 Astra Pro 的通用出厂参数,也不是程序启动时自动应用的全局默认值。

入口是 [`current-head.json`](current-head.json),其中的相对路径和 SHA-256 指向
不可就地覆盖的版本文件 [`head-astra-pro/20261110-v1.json`](head-astra-pro/20261110-v1.json)。
后续修订应增加版本文件、保留旧版,并在重新核对后更新入口及其哈希;不要只改矩阵。

## 怎么使用

- `camera.matrix` 是原生 **1280×720** 图像的 OpenCV 内参 K。
`camera.distortion` 的顺序是 `[k1, k2, p1, p2, k3]`。
- `extrinsics.base_from_camera` 将相机光学坐标转换到机器人 URDF 基座坐标:
`p_base = base_from_camera @ p_camera`,使用齐次列向量,平移单位为米。
相机轴是 **右、下、前**。不要直接把这个矩阵当作相机的 view matrix;
基座点转到相机坐标时,应取它的逆。
- 基座名 `world` 是已固定 URDF 的根坐标,不是测量过的房间/桌面世界坐标。
仿真场景若有自己的世界偏移,应另外组合该变换。
- MuJoCo 相机轴是 **右、上、后**,因此旋转使用
`R_base_mujoco = R_base_camera @ diag(1, -1, -1)`。
保留 K 中不相等的焦距和非居中的主点,不要只用一个近似视场角替代。
- 仿真是理想针孔投影。与实拍对照时,使用同一个 K 和已保存的畸变参数去畸变;
不做额外图像配准,也不手调相机以掩盖模型误差。
- `robot.kinematics` 记录标定使用的 URDF 哈希、关节映射和工具坐标。
这些 locked 关节仅是当时 FK 的建模约定,不是当前右臂姿态。
`calibration_fixture.tool_from_board` 仅描述当时的装板,不是永久 TCP。

使用前,调用者必须明确选用此安装实例并核对外部设备身份;不能仅因型号相同就套用。
仓库不包含 USB 拓扑、设备端口、个人主机路径或认证信息。本次发布不修改实物运行配置,
不自动启用跟随、相机流或电机;也不依赖尚未发布的仿真重放实现。
文件随 Git 和源码分发包保存,消费程序应显式选择配置路径,而非假设安装 wheel 会自动启用它。

## 这版已经检查了什么

- 原图、观测和机器人 FK 身份已核对,离线重算与保存结果一致。
- **12 张拟合 + 4 张独立留出检查**;留出 RMS 为 **3.38 mm / 0.78°**。
这是同组一致性残差,不是独立测量的绝对定位精度。
- 已按 16 个实测关节姿态复现仿真相机,并查看 4 个留出姿态的实拍/仿真对应关系;
没有手调相机。渲染器的轴向、非居中主点和索引板纹理也已离线核对。
- 内参边缘覆盖不足、静止时间区间不等于精确曝光同步等限制保留在版本文件中。

**相机移动、安装松动、对焦/镜头改变,或图像裁剪/缩放后,都要重新核对适用性。**
原始图像及连续关节反馈仍在外部证据存储,版本文件记录其原始文件与规范 JSON 的哈希,
两类哈希不可混用;精简后的本文件有自己的哈希,由 `current-head.json` 固定。

这是操作者明确要求发布的、去除个人环境信息的相机基准例外。
其他机器配置、原始标定证据、日志和模型仍遵循仓库的外部存储规则,不应一起提交。

## 已绑定的 Hugging Face 仿真资产

[`huggingface-head.lock.json`](huggingface-head.lock.json) 固定私有模型仓库
`tacpilot/tacpilot` 的完整提交和 `v0.3.1` 资产清单哈希;不要用不断变化的 `main`
代替锁中的 revision。仿真组件是 `head-camera`,其入口为
`assets/simulation/cameras/head-astra-pro/20261110-v1/scene.xml`,相机名为
**`head_calibrated`**。HF 内的 `calibration.json` 与这里的版本文件逐字节相同。

有 TacPilot 源码环境时,可复用其现有 SSH/LFS 资产下载器,只下载相机和模型依赖:

```bash
python -m tacpilot.artifacts fetch \
--lock /path/to/openarm-runtime/configs/cameras/huggingface-head.lock.json \
--directory /path/to/new/external/assets --component head-camera
```

需要已有 HF SSH 授权和 Git LFS,不要求额外 API Token。不下载策略权重或示教数据。
下载目录不能已存在,模型/场景保持原目录结构。

```python
import mujoco

model = mujoco.MjModel.from_xml_path(
asset_root + '/assets/simulation/cameras/head-astra-pro/20261110-v1/scene.xml')
data = mujoco.MjData(model)
mujoco.mj_forward(model, data)
with mujoco.Renderer(model, height=720, width=1280) as renderer:
renderer.update_scene(data, camera='head_calibrated')
rgb = renderer.render()
```

这只加载并渲染仿真,不连接实物。入口引用原有机器人/夹爪场景,只增加固定相机和
离屏分辨率;模型原始场景、历史训练/评测相机与模型权重不变。新工作明确选择这个
相机入口;旧策略仍保留原有图像契约,不能因为标定已固定就宣称旧策略可直接换视角。
场景的基座偏移另见绑定文件,不要将场景世界坐标误作物理桌面测量。
10 changes: 10 additions & 0 deletions configs/cameras/current-head.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"schema": "openarm.camera-baseline-selection.v1",
"installation_id": "openarm-v2-head-astra-pro",
"camera": "head",
"version": "20261110-v1",
"path": "head-astra-pro/20261110-v1.json",
"sha256": "2e33f3028e7e320f43b319b2ed0c7c60079ae8a4e1abab9e80b7732dfcfa9df4",
"automatic_device_selection": false,
"automatic_hardware_activation": false
}
156 changes: 156 additions & 0 deletions configs/cameras/head-astra-pro/20261110-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"schema": "openarm.camera-baseline.v1",
"version": "20261110-v1",
"installation_id": "openarm-v2-head-astra-pro",
"scope": "this_installation_only_not_factory_calibration",
"selection": "operator_accepted_baseline_after_offline_simulation_visual_review",
"independently_physically_verified": false,
"automatically_activate_hardware": false,
"camera": {
"name": "head",
"model": "Astra Pro RGB",
"image_size": [1280, 720],
"image_geometry": "native_no_transform",
"camera_model": "pinhole",
"distortion_model": "opencv_5",
"pixel_coordinates": "x right, y down; native OpenCV image pixels",
"matrix": [
[1007.3759323261551, 0.0, 648.5412534547582],
[0.0, 1005.894776547822, 383.16680235990856],
[0.0, 0.0, 1.0]
],
"distortion": [
0.056219346631710014,
0.38021308615459354,
-0.00025174339295446564,
-0.0006971512942885714,
-1.2772477652608862
],
"distortion_order": ["k1", "k2", "p1", "p2", "k3"],
"intrinsics_version": "20261110-v1"
},
"extrinsics": {
"transform_name": "base_from_camera",
"base_frame": "world",
"base_frame_semantics": "root of the pinned robot URDF, not a surveyed room frame",
"camera_frame": "head_optical",
"camera_axes": {"x": "right", "y": "down", "z": "forward"},
"units": "m",
"equation": "p_base = base_from_camera @ p_camera; homogeneous column vectors",
"base_from_camera": [
[-0.0032977033174182158, -0.8940526827815002, 0.44794969088507086, 0.0567064761899711],
[-0.9995586812198728, 0.016171713676243114, 0.02491823578748592, 0.008392649899155363],
[-0.029522329698338623, -0.4476698293251111, -0.8937114500560048, 0.7890478461241447],
[0.0, 0.0, 0.0, 1.0]
],
"mujoco_optical_rotation": [
[1.0, 0.0, 0.0],
[0.0, -1.0, 0.0],
[0.0, 0.0, -1.0]
],
"mujoco_rotation_equation": "R_base_mujoco_camera = R_base_opencv_camera @ mujoco_optical_rotation"
},
"robot": {
"model": "OpenArm V2",
"calibration_arm": "left",
"tool_frame": "openarm_left_ee_base_link",
"kinematics_sha256": "79bd7cbe2ad98b46115f06f10c74934508eef7b93f86ffbd03a8ef5957c34af3",
"kinematics": {
"urdf_sha256": "56bd506b9686f5e472b143684dcd045c4e30783d27e1266f6f480a49f01b8bd8",
"joints": [
"openarm_left_joint1", "openarm_left_joint2", "openarm_left_joint3",
"openarm_left_joint4", "openarm_left_joint5", "openarm_left_joint6", "openarm_left_joint7"
],
"signs": [1, 1, 1, 1, 1, 1, 1],
"offsets": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"locked": {
"openarm_left_finger_joint1": 0.0,
"openarm_left_finger_joint2": 0.0,
"openarm_right_joint1": 0.0,
"openarm_right_joint2": 0.0,
"openarm_right_joint3": 0.0,
"openarm_right_joint4": 0.0,
"openarm_right_joint5": 0.0,
"openarm_right_joint6": 0.0,
"openarm_right_joint7": 0.0,
"openarm_right_finger_joint1": 0.0,
"openarm_right_finger_joint2": 0.0
},
"frame": "openarm_left_ee_base_link",
"tcp": [
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
],
"encoder_limit_tolerance_rad": 0.008726646259971648
}
},
"calibration_fixture": {
"scope": "source_calibration_mount_only_not_a_permanent_robot_TCP",
"board_spec": {
"type": "charuco",
"squares_x": 6,
"squares_y": 4,
"square_size_m": 0.0225,
"marker_size_m": 0.0165,
"dictionary": "DICT_4X4_50"
},
"tool_from_board": [
[0.012978869663394066, -0.015578883162274959, -0.9997944025356797, 0.02576363703886798],
[-0.994733529809124, 0.10146488385157795, -0.014494206375876229, 0.0697281229014311],
[0.10166982647640022, 0.9947171335331477, -0.01417993793557265, -0.2155277765898749],
[0.0, 0.0, 0.0, 1.0]
]
},
"validation": {
"semantics": "within_session_consistency_not_absolute_accuracy_certification",
"fit": {
"samples": 12,
"rms_translation_m": 0.0026779717784152853,
"rms_rotation_rad": 0.01101961287392166,
"max_translation_m": 0.004164814363000099,
"max_rotation_rad": 0.018684684838539144
},
"validation": {
"samples": 4,
"rms_translation_m": 0.0033823555165824223,
"rms_rotation_rad": 0.013590291281268891,
"max_translation_m": 0.004937677744859555,
"max_rotation_rad": 0.019009805973595566
},
"rms_acceptance_limits": {"translation_m": 0.005, "rotation_rad": 0.03},
"intrinsics_fit_rms_px": 0.25797656123975005,
"intrinsics_validation_rms_px": 0.23441138018504198,
"timing_contract": "stationary_bracket_not_exposure_synchronization",
"exposure_timestamp_known": false,
"simulation_review": "16 recorded joint poses replayed; 4 held-out real/rendered views visually reviewed without camera adjustment"
},
"provenance": {
"group_id": "ef9692cd4c164350ac70b9c4b7de5466",
"intrinsics_session_id": "56db91e3fa30433d96a875a6852a5b7c",
"intrinsics_file_sha256": "378b052ca6a7c9032b1be8fafcad3fc971e21433e848b63a7f92742b007bb407",
"estimate_file_sha256": "d1198852e0c9d48867013f67c9dfdc9262119a03d56a700d9adc967fcee90d88",
"observations_file_sha256": "d543fc150c7d45c29023946105f6b49e6fcdfc97e8b5a33ec9c69c88a3f6e650",
"observations_canonical_json_sha256": "c24c91717829aaaab9019f933d40a7bb91e8a7fcb90683716acebd60fd3438ec",
"session_file_sha256": "173d79ed96f5d31c0da9f9fd2938453f2f8546994888b734cea57200a799e667",
"route_canonical_json_sha256": "ae8534b147cec562f0f685770d10a34096ec9c9a8196308b177966430919c62f",
"raw_evidence_storage": "external; original PNGs and feedback retained, not embedded in this repository"
},
"validity_conditions": [
"Use only this approved physical camera/lens and rigid mounting instance; model name alone is not a device identity check.",
"Keep focus and zoom unchanged. Refocusing or replacing the camera/lens requires intrinsics review.",
"Use native 1280x720 pixels. Cropping, resizing, rotation or binning requires an explicit corresponding intrinsic transform.",
"Moving the camera relative to the robot base invalidates these extrinsics.",
"Use the pinned robot coordinate frame, kinematic geometry and joint sign/offset conventions.",
"Raw images use the OpenCV distortion coefficients. Ideal simulation must be compared to images undistorted with the same K.",
"MuJoCo scene-world placement is not the robot base frame; apply the scene's declared base/world transform separately."
],
"limitations": [
"Intrinsics corner coverage near image edges, especially the bottom edge, was limited; edge distortion is less constrained.",
"This is an operator-accepted baseline, not independently surveyed physical metric accuracy.",
"Stationary acquisition intervals are qualified; exact exposure-time synchronization and moving-scene accuracy are not certified.",
"Right-arm current joint angles, table geometry, gripper transmission, lighting and background are not calibrated by this result.",
"The board transform applies only to its original rigid mount and must not be reused after re-clamping."
]
}
10 changes: 10 additions & 0 deletions configs/cameras/huggingface-head.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"schema": "tacpilot.artifact-lock.v1",
"repo_id": "tacpilot/tacpilot",
"repo_type": "model",
"revision": "b712883b433a5d7005c38d2d99820dc70fedb3c8",
"manifest": {
"path": "releases/v0.3.1/manifest.json",
"sha256": "b066d7ec2e5f386ffabe4b139fd5d4360a3128e84fcd561df92c996853c9aa4b"
}
}
Loading
Loading