Skip to content

Releases

v0.1.9 - xArm UJ_BR_2403 Inertials, Unified Meshes, and Bio/G2 Gripper Refinements

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 24 Nov 11:27

Upgraded xArm 5/6/7 link inertials to the official UJ_BR_2403 parameters, unified xArm meshes on xarm6 with the production version A base, fixed Bio Gripper G2's flange mount and 11-hull collision geometry, refined Bio Gripper G2 and Gripper G2 visual meshes and materials (including frosted anodized aluminum and translucent inner silicone finger pads), and aligned all standalone gripper display poses flange-up. See CHANGELOG.md.

Install

pip install ufactory_mujoco-0.1.9-py3-none-any.whl   # attached below; Python 3.12–3.14
ufactory-mujoco pick-place --robot xarm6              # opens the viewer; add --headless without a display
python -c "import ufactory_mujoco; print(ufactory_mujoco.__version__)"

The wheel is a 95.8 MiB download (513.2 MiB of bundled models, meshes, task configs and licenses once installed) and requires MuJoCo >=4,<5.

Changed

  • xArm 5/6/7 link inertials (UJ_BR_2403): updated link1..linkN masses, COM offsets and full inertia tensors in ufactory_mujoco/models/{xarm5,xarm6,xarm7}/{xarm5,xarm6,xarm7}.xml from pre-1305 HT_BR2 defaults to the official xarm_ros2 UJ_BR_2403 parameters (>= 1305 hardware). Offline validation across xarm5, xarm6 and xarm7 reduces static S1 gravity L2 residual mean by 91%–95% (to 0.031–0.139 Nm), and real-hardware 20-pose S1 validation on xArm 6 (XI130505L56A01, firmware v2.8.2) reduces mean L2 torque error by 84.0% (0.603 -> 0.097 Nm). Updated the frozen xArm 6 3 kg payload gravity regression baseline (ufactory_mujoco/tasks/dynamics.py, tests/test_dynamics_validation.py); joint/actuator parameters (armature, damping, frictionloss, forcerange) remain unchanged for separate evaluation.
  • Unify xArm 5/6/7 meshes on xarm6 (synced from ufactory_genesis d812529): xarm5 now shares all visual OBJs and 22 convex collision STLs with xarm6 (link3 includes xarm6 link4 placed at J4 = 0; link4/link5 use xarm6 link5/link6), and xarm7 shares link_base and flange (link7 ← xarm6 link6). Removed the duplicate xarm5 and xarm7 link_base/link7 meshes (~129 MB, 38 files; DOUBLE_SIDED_COUNT 51 -> 44); kinematics and inertials are unchanged.
  • Standalone Bio Gripper G2 display orientation (synced from ufactory_genesis ebed948): flipped bio_gripper_g2_base_link in bio_gripper_g2.xml to pos="0 0 0.17" quat="0 1 0 0" (adapter flange facing +Z, fingers and link_tcp pointing downward at (0.135, 0, 0.115) m) and updated bio_gripper_g2/scene.xml statistic center to 0.04 0 0.14; compose._mount() now explicitly resets quat when mounting tools so arm combinations remain unchanged.
  • Bio Gripper G2 frosted anodized aluminum appearance (aligned with ufactory_genesis): replaced the shared silver material in bio_gripper_g2.xml with dedicated bio_g2_anodized_aluminum (rgba="0.60 0.62 0.64 1", specular="0.72", shininess="0.16", reflectance="0.03", metallic="0.8", roughness="0.64") on base_silver_vis, left_finger_vis, and right_finger_vis, and enabled soft satin headlight specular (0.35 0.35 0.38) in bio_gripper_g2/scene.xml and composed <arm>_with_bio_gripper scenes.
  • Standalone Gripper G2 display orientation & 4-material base split (synced from ufactory_genesis): flipped xarm_gripper_base_link in gripper_g2.xml to pos="0 0 0.23" quat="0 1 0 0" (flange facing +Z, fingers and link_tcp pointing downward at (0, 0, 0.0565) m) and updated gripper_g2/scene.xml statistic center to 0 0 0.14 / extent 0.25 with soft satin headlight specular (0.35 0.35 0.38, propagated to non-F/T *_with_gripper compositions); split base.obj into base_white.obj (white), base_silver.obj (g2_anodized_aluminum), base_black.obj (black +Y connector cover), and base_anodized_black.obj (g2_anodized_black, bearing cover 机械手轴承盖 A1 and 4× M3×8 countersunk screws), while keeping mounted arm+G2 kinematics and TCP (0, 0, 0.1735) m unchanged.
  • Standalone Vacuum Gripper, Lite6 Gripper & Lite6 Vacuum Gripper display orientation (aligned with ufactory_genesis): flipped the standalone root body to flange-up (quat="0 1 0 0") and centered scene.xml framing (center="0 0 0.14") in vacuum_gripper (pos="0 0 0.20", suction_site at z = 0.074 m), lite6_gripper (pos="0 0 0.18", link_tcp at z = 0.0964 m), and lite6_vacuum_gripper (pos="0 0 0.17", suction_site at z = 0.109 m); mounted arm and F/T combinations remain unchanged.
  • Gripper G2 finger inner silicone pads (synced from ufactory_genesis): split left_finger.obj / right_finger.obj into opaque black finger bodies ({left,right}_finger_black.obj, double-sided inertia="shell") and single-sided watertight inner grip pads ({left,right}_finger_silicone.obj, bound to translucent g2_silicone rgba="0.92 0.92 0.90 0.75" specular="0.45" shininess="0.55" roughness="0.30"), keeping vertex bounds and 85-opening kinematics identical across standalone gripper_g2 and all mounted arm/F/T combinations.

Fixed

  • Production xArm base and xarm5 flange: xarm6 and xarm7 link_base visual OBJs and xarm5 link_base collision hulls now use the production version A base (flat top at 150.35 mm, body Ø95.4 mm) instead of the prototype version B base (152.3–152.6 mm), and xarm5 link5 uses the centered xarm6 link6 flange mesh (fixing the 1.0 mm off-axis visual shift). Updated BASE_PLATE_MOUNT for xarm6 and xarm7 to match xarm5 ((-0.00012433, -0.00038722, -0.00001016) m, yaw 0.000002356 rad).
  • Bio Gripper G2 flange mount and collision hulls (synced from ufactory_genesis d812529): replaced the four per-arm BIO_GRIPPER_MOUNT offsets with the single yaw-only xArm-flange mount ((0.022642, 0.000814, 0.002516) m, yaw -0.00628537 rad) across xarm5/xarm6/xarm7/uf850, moving the flange-frame TCP from (159.7–162.0, -1.9–0, 54.2–55.0) mm to (157.6, 0.0, 57.5) mm; rebuilt all 11 convex collision STLs (1 base + 5 per finger) from the G2 visuals (bio_gripper_g2.xml and tests/fixtures/bio_gripper_g2_movable_visual.urdf).
  • Bio Gripper G2 adapter plate visual mesh (synced from ufactory_genesis ebed948): updated bio_gripper_g2_base_silver.obj from bio_gripper_g2_base.glb (105,457 vertices / 183,837 faces, doubled with inertia="shell"), removing the two protruding M6 mounting screw tips at 135°/-135°, restoring analytic curved surfaces and normals on the outer rim, lugs, fillets, center bore, M6/lug countersinks, and stepped locating-pin hole, and trimming face slivers at hole rims.
  • Gripper G2 flange outer circle, centering boss, and slotted locating pin (synced from ufactory_genesis): rebuilt base_silver.obj and base_black.obj from the updated 4-primitive base.glb with analytic circular surfaces and normals across the Ø75.0 mm flange rim, Ø31.5 mm centering boss, R = 3.00 mm pin hole, +Y cover fillets, and the watertight dome-tipped slotted locating pin at (0, -25) mm (r = 2.98 mm, z = -4.50..2.00 mm, -7.04° 1.00 × 2.00 mm slot).

Verified

  • Local 3-environment sequential acceptance (py312, py313, py314): ruff check ., git diff --check (excluding OBJ), 39 static XML + 46 composed model compilation (0 errors, 0 warnings across all 3 envs), full pytest tests (py312: 541 passed, 875 subtests passed; py313: 541 passed, 875 subtests passed including Pinocchio checks; py314: 536 passed, 5 skipped, 875 subtests passed), CI headless example smoke suite (SMOKE PASS across all 3 envs), 30 golden task reports per env (30/30 byte-identical across py312/py313/py314; all 30 reports passing; 11/11 task config_sha256 hashes and all 12 lite6/uf850 reports + 6 xarm5/xarm6/xarm7 dry-run reports byte-identical to 0.1.8, with expected numeric updates on 12 xarm5/xarm6/xarm7 physics simulation reports from UJ_BR_2403 inertials and unified xarm5 collision meshes), twine check --strict, distribution verification (39 static models, 46 composed models, 455 meshes, 2 configs / 11 task presets, 7 licenses), and isolated wheel acceptance (52 commands PASS across all 3 envs).
  • GitHub Actions CI run #45381692287: all 8 jobs passed (lint, build, test and installed across Python 3.12, 3.13, 3.14 with MuJoCo 4).

SHA-256

9731726e584b07a3cb919411294ed88b0db7527c995a08242f250c1fddcf3369  ufactory_mujoco-0.1.9-py3-none-any.whl
1e218fb2295a380f7b99c78ad8977a090d7c21db9320371ae43d4783703de886  ufactory_mujoco-0.1.9.tar.gz

v0.1.8 - Native MjSpec Composition, Rigid G2 Grasps, and Unified Pick-Place

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 20 Nov 10:26

Runtime model composition with MuJoCo's native MjSpec.attach (19 atomic parts assembling all 46 named combinations and task scenes), in-package models and configs without setup.py, unified all-zero home / init / task start poses, shared five-arm pick-place layout with one-motion descent and rapid grasp lift, rigid anti-creep Gripper G2 contacts, and streamlined simulation docs. See CHANGELOG.md.

Install

pip install ufactory_mujoco-0.1.8-py3-none-any.whl   # attached below; Python 3.12–3.14
ufactory-mujoco pick-place --robot xarm6              # opens the viewer; add --headless without a display
python -c "import ufactory_mujoco; print(ufactory_mujoco.__version__)"

The wheel is a 117.2 MiB download (645.5 MiB of bundled models, meshes, task configs and licenses once installed) and requires MuJoCo >=4,<5.

Added

  • Native model assembly (ufactory_mujoco.compose): one MjSpec.attach mounting routine and the data in ufactory_mujoco/robots.py (recipes, tool mounting rules, combo keyframes, mount poses, task scene geometry) build all 46 named combinations from 19 atomic parts, plus custom stacks such as arm + base plate + F/T sensor + gripper + D435. Exported XML keeps authored values exactly (compiler.savecompiled disabled).
  • load_model(): compiles a model given by name, MJCF path, MjSpec or MjModel; SimRobot, XArmRobot, CollisionChecker, ArmDynamics and attach_payload accept the same inputs. TaskConfig.scene_spec() and config.arm_scene_spec() return scenes in memory.
  • CLI subcommands: ufactory-mujoco export-model (--list, custom composition flags, --copy-meshes), export-calibration and kinematics-check, alongside pick-place, box-pack, dynamics and the four dynamics-* entry points.
  • Task config presets: load_task_config(..., preset=...), get_task_preset() and list_task_presets(), backed by presets: in configs/default.yaml.

Changed

  • Models: models/ moved to ufactory_mujoco/models/ and holds 19 atomic part directories (39 XML files including xarm6/scene_obstacles.xml, 482 meshes, no symlinks). The five *_with_gripper combinations and the ten pick-place / box-pack scenes are generated; task props come from the presets. Mesh and material ids of base-plate and F/T + tool combinations are ordered differently; geometry, physics and rendering are unchanged.
  • Configs: configs/ moved to ufactory_mujoco/configs/; the ten task overlays are presets in default.yaml, which no longer repeat robot, scene or the default executor.
  • Packaging: setup.py and MANIFEST.in are removed; pyproject.toml ships models/ and configs/ as package data, so the wheel layout equals the source layout.
  • Model lookup: package runs load composites in memory; resolve_model_path(), resolve_arm_scene() and TaskConfig.scene_path (now computed on first use) export them to a cache keyed by installation and model name. resolve_arm_scene moved to ufactory_mujoco.config; top-level imports are unchanged.
  • Code: SimRobot and XArmRobot share their IK and planning helpers through RobotInterface; XARM_IP is resolved by one helper; robot-key aliases live in robots.py.
  • Tests and CI: the zero-warning compile check of every model runs in pytest; the CI example smoke step keeps only what pytest does not run; docs no longer hard-code model counts.
  • Keyframes and start pose: home is all-zero joints on every model. xArm 5/6/7 combinations, whose tools reach below the floor at zero, add an init keyframe equal to ready; SimRobot and 01_load_and_view.py start from init when present, otherwise from keyframe 0. SimRobot(start=...) takes arm joint angles or a TCP pose (pos, quat). Simulated pick-place and box-pack start every arm with the TCP at [300, 0, 300] mm, RPY = [180, 0, 0]°; hardware modes start from the measured pose. The xArm 6 combination ready now puts the G2 TCP exactly at (300, 0, 300) mm (it was 2 mm low).
  • Pick-place layout: all five arms take the cube from (300, 0) mm on the floor to (300, 300) mm and lift it to the same TCP height. xArm 5, xArm 7, UF850 and Lite 6 used to have their own spots, and the Lite 6 cube stood on a 20 mm stand. Lite 6 preset: flange_grasp_z_m 0.115 → 0.095, lift_z_m 0.24 → 0.21, approach_m 0.06 → 0.10.
  • Simulation docs and --help: examples/simulation/README.md and README_zh.md are about a quarter of their former length: one viewer command per example, model names as a pattern, and short start-pose, real-robot and viewer sections. The option tables are gone; --help now also describes --executor, --cycles and --speed of pick-place / box-pack and --robot, --samples and --seed of dynamics, and keeps the line breaks of the task descriptions. Commands meant for watching the 3D view no longer pass --headless.

Fixed

  • Gripper G2 grasps: the finger pads use rigid contacts that take priority over the object's, and the linkage couplings are stiff, so the force-limited servo stops at the object's surface (0.5 mm instead of 3.5 mm penetration per side) with the full calibrated pinch force. Task scenes enable MuJoCo's noslip pass, so a held cube no longer creeps out of the fingers (6.4 mm slip during transport, now 0.02 mm).
  • Pick-place timing: the arm descends from the task start, which is above the cube, to the grasp in one straight motion without stops (it used to stop above the cube). The jaw closes as soon as the TCP reaches the grasp height, and the lift starts as soon as both pads hold (about 0.45 s after closing instead of 2.5 s).

Breaking (Internal Submodule Paths)

Top-level imports (from ufactory_mujoco import ...) are unchanged, and load_model was added. Callers importing internal submodules directly should migrate as follows:

Removed internal path (0.1.7) Replacement
ufactory_mujoco.model_paths ufactory_mujoco.compose (resolve_model_path, available_models), ufactory_mujoco.config (resolve_arm_scene), ufactory_mujoco.robots (registry data)
ufactory_mujoco.ik ufactory_mujoco.kinematics
ufactory_mujoco.collision, ufactory_mujoco.path_planning ufactory_mujoco.planning
ufactory_mujoco.task_geometry ufactory_mujoco.preflight
ufactory_mujoco.g2_model, ufactory_mujoco.g2_controller ufactory_mujoco.g2
ufactory_mujoco.bio_g2_model, ufactory_mujoco.bio_g2_controller ufactory_mujoco.bio_g2
ufactory_mujoco.tasks.{_reporting,_motion,_command} ufactory_mujoco.tasks._common
ufactory_mujoco.dynamics.{poses,runtime} ufactory_mujoco.dynamics.profiles
ufactory_mujoco.dynamics.{reference,probe} ufactory_mujoco.dynamics.backends
ufactory_mujoco.dynamics.plot ufactory_mujoco.dynamics.report
ufactory_mujoco.data/ resources ufactory_mujoco/models/, ufactory_mujoco/configs/; licenses in .dist-info/licenses/

Removed

  • models/*_with_gripper/ (15 XML files, 10 symlinks) and the 41 other static combination directories; configs/{pick_place,box_pack}/.
  • setup.py, MANIFEST.in, _build_support.py, scripts/gen_kinematics_params.py (use ufactory-mujoco export-calibration).
  • dynamics-hardware-check --include-stress and the stress pose plumbing; the stress pose set was always empty.
  • BioGripperG2Model, the test-only Gripper G2 joint constants (G2_JOINT_NAMES, G2_ARMATURE, G2_DAMPING, G2_FRICTIONLOSS, G2_MIMIC_SOLREF, G2_MIMIC_SOLIMP), five unused aliases in dynamics.analysis, ft_sensor.SENSOR_INTERNAL_HZ, xarm6_default_dynamics_configs and HoldTimeSeriesSample.

Verified

  • Local 3-environment sequential acceptance (py312, py313, py314): ruff check ., git diff --check, 39 static XML + 46 composed model compilation (0 errors, 0 warnings across all 3 envs), full pytest tests (py312: 528 passed, 833 subtests passed; py313: 528 passed, 833 subtests passed including Pinocchio checks; py314: 521 passed, 7 skipped, 828 subtests passed), CI headless example smoke suite (SMOKE PASS across all 3 envs), 30 golden task reports per env (30/30 byte-identical across py312/py313/py314; all 30 reports passing; expected config_sha256 updates only on xarm5/xarm7/uf850/lite6 pick-place from the shared layout), twine check --strict, distribution verification (39 static models, 46 composed models, 482 meshes, 2 configs / 11 task presets, 7 licenses), and isolated wheel acceptance (52 commands PASS across all 3 envs).
  • GitHub Actions CI run #44714560371: all 8 jobs passed (lint, build, test and installed across Python 3.12, 3.13, 3.14 with MuJoCo 4).

SHA-256

4a6e74b6aa40d90932ae09002231814c03500615b1adb7ded795599e2a083657  ufactory_mujoco-0.1.8-py3-none-any.whl
2f442acc48368261a9df33eef8be8f3b9bbdfa827e61a59c123a5175f7723f44  ufactory_mujoco-0.1.8.tar.gz

v0.1.7 - AI1500 F/T Sensor, Mounting Base Plates, and Safety/Planning Hardening

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 19 Nov 02:35

AI1500 6-axis force/torque sensor (ft_sensor), official mounting base plates (*_base_plate), hardware safety gate hardening, Cartesian SLERP / trajectory planning fixes, and API/governance improvements across 65 model directories (141 MJCF XMLs, 482 canonical meshes). See CHANGELOG.md.

Install

pip install ufactory_mujoco-0.1.7-py3-none-any.whl   # attached below; Python 3.12–3.14
ufactory-mujoco pick-place --robot xarm6 --headless
python -c "import ufactory_mujoco; print(ufactory_mujoco.__version__)"

The wheel is a 117.4 MiB download (646.9 MiB of bundled models, meshes, task configs, and licenses once installed) and requires MuJoCo >=4,<5.

Added

  • Force/Torque Sensor (ft_sensor): 13 new MJCF model directories (ft_sensor plus {xarm5,xarm6,xarm7,uf850}_with_ft_sensor, *_with_ft_sensor_and_gripper, and *_with_ft_sensor_and_vacuum_gripper) using 15 double-sided visual OBJs (inertia="shell"), stainless-steel adapter ring (part_02) and fastener materials, <headlight specular="0.55 0.57 0.6"/> scene lighting, and a convex collision STL hull (total mass=0.6 kg split into 0.45 kg base + 0.15 kg floating output head at CoM +3.87 mm ahead of the +32.0 mm sensing site ft_sensor_site, +58.6 mm output face, timestep="0.001").
  • Sensor Reader & SimRobot / XArmRobot Integration: ufactory_mujoco.ft_sensor (AI1500Reader, FTSensorReader, SensorReading, apply_ft_sensor_wrench, clear_ft_sensor_wrench, is_hardware_ft_sensor_enabled, read_hardware_ft_sensor_config, read_hardware_ft_sensor), re-exported from ufactory_mujoco, providing 200 Hz (5-step) IEEE-754 fp32 sampling, real-hardware +applied polarity, dual raw / ext (dynamically gravity- and zero-compensated) channels, optional hardware-calibrated noise (noise_std="calibrated", RAW_NOISE_STD, EXT_NOISE_STD), and ±400 N / ±20 Nm overrange / ±600 N / ±30 Nm overload tracking. SimRobot attaches AI1500Reader automatically (has_ft_sensor, ft_sensor, ft_sensor_reading, get_ft_sensor_reading(), reset_ft_sensor(), zero_ft_sensor()); XArmRobot adds read-only F/T config/reading APIs (avoiding SERVO_R16B state-reset queries) and fail-closed bare-arm preflight/motion gates across XArmRobot, tasks.dynamics, and dynamics CLI when a controller reports an enabled F/T sensor.
  • Simulation Example 11: examples/simulation/11_force_torque_sensor.py demonstrating dual-channel (raw/ext) baseline and +applied wrench verification across all 13 ft_sensor models plus strictly read-only live hardware F/T sampling (--ip <ROBOT_IP> --gripper ft_sensor).
  • Mounting Base Plates (base_plate): 8 new MJCF model directories ({xarm,uf850,lite6}_base_plate and {xarm5,xarm6,xarm7,uf850,lite6}_with_base_plate) with CAD-derived visual STLs (group=2), hole-filled convex collision prism STLs (group=3), top mounting planes at z=0, scene floors at -thickness (-8 / -10 / -5 mm), long edges parallel to base Y (with the two-chamfered long side of xarm_base_plate facing base +X), and least-squares mounting-hole alignments (< 0.01 mm fit residual).
  • Public API, Hardware Telemetry & Safety Controls: exported __version__ ("0.1.7"), quat_error, and clear_ft_sensor_wrench from ufactory_mujoco; exposed SimRobot public helpers (step, step_hook, n_arm_actuators, has_viewer, viewer_is_running, sync_viewer, gripper_actuator_id, gripper_ctrl_range, gripper_qpos, gripper_wait_duration); added ControllerConfigSnapshot / restore_controller_config(), --no-return-home, and --gripper hardware preflight support across dynamics-hardware-check and ufactory-mujoco dynamics; and added real-gripper telemetry fields (gripper_actuated, commanded_grasp_gap_m, measured_grasp_gap_m, object_grasped_inferred) to --mode real task reports.
  • Licenses & Tests: added licenses/ufactory_robot_viewer.LICENSE (BSD-3-Clause) and Sections 5–6 in NOTICE; added tests/test_ft_sensor.py, tests/test_base_plates.py, and regression tests across test_hardware_safety.py, test_dynamics_suite.py, test_trajectory.py, test_kinematics.py, test_preflight.py, and test_installable_tasks.py.

Changed

  • Updated pyproject.toml version to 0.1.7 with [tool.pytest.ini_options] pythonpath = ["."] and bumped ufactory_mujoco/__init__.py:__version__ to "0.1.7", updated ufactory_mujoco/robots.py ({xarm5,xarm6,xarm7,uf850} F/T gripper registries while keeping _PICK_PLACE_DIRS unchanged), and updated tests/test_all_models.py (65 models and ft_sensor* downward ready checks) and tests/test_converted_assets.py (DOUBLE_SIDED_COUNT = 51).
  • Modularized ufactory_mujoco/dynamics/cli.py:cli_hardware_check (reducing cyclomatic complexity and deduplicating DynamicsSample construction), added DOF-mismatch validation (exit 2) in dynamics-report-compare, added a 141-XML zero-warning compilation step in .github/workflows/ci.yml, and updated scripts/accept_installed.py (>= 141 XMLs, >= 482 meshes, 7 licenses, read-only checks for xarm6_with_ft_sensor_and_gripper / xarm6_with_base_plate, and directory/file permission restoration in finally).
  • Updated simulation examples (02, 03, 04, 06, 07, 09, 11) to use public SimRobot interfaces, CWD-independent MODELS_ROOT paths, explicit CLI argument validation, and non-zero exit self-checks; updated README.md, README_zh.md, examples/simulation/README.md, and examples/simulation/README_zh.md.
  • Note on golden task reports: all 10 pick-place and box-pack --dry-run preflight reports are byte-identical to 0.1.6, and all 30 task reports remain byte-identical across Python 3.12/3.13/3.14 and MuJoCo 4.0.0/4.0.1; the 20 simulation task reports reflect minor numeric refinement (<= 0.5 mm, e.g. xarm7 pick-place place_error_mm improved from 3.02 mm to 2.65 mm) from the body-frame SLERP and deterministic qpos0 IK seeding fixes below.

Fixed

  • Hardware safety gates: tasks.dynamics hardware preflight and shadow streams now start from measured q_now instead of all-zero home and block unmodeled non-zero tcp_load/tcp_offset or enabled F/T sensors when --gripper is omitted; dynamics-hardware-check --hold-current-only is strictly read-only (mutually exclusive with --dry-run/--clear-tcp-offset); Ctrl-C halts immediately via stop() (set_state(4)) without unpreflighted return_home, and normal exit runs collision preflight before returning home; dynamics-sim-collision-check requires --confirm-real; XArmRobot validates joint limits, single-step servo deltas, and trajectory start/peak-velocity bounds, flushes sdk-sim queues before leaving simulation mode, and stops motion cleanly in close(); kinematics_validation avoids firmware get_inverse_kinematics() queries that could latch warn_code=14; and preflight checks non-base floor contacts instead of globally ignoring "world".
  • Planning & kinematics: plan_cartesian_line now uses body-frame right-multiplied conj(quat0) * quat1 SLERP (eliminating world-frame orientation drift), copies and normalizes input quaternions without mutating caller arrays, and marks adjacent IK jumps (> 0.5 rad) with ok=False; plan_ptp_quintic and plan_ptp_lspb reject non-finite parameters and infeasible duration < t_min; JointTrajectory validates non-empty finite non-decreasing timestamps; manipulability restricts singular-value calculation to ancestor-chain DOFs so mounted grippers and free bodies no longer force zero manipulability; SimRobot with q=None syncs data.qpos and plan_cartesian_trajectory slices output to n_arm columns; _flange_tcp_offset seeds IK deterministically at model.qpos0; and preflight refines collision stepping (_CHECK_RES = 0.02 rad).
  • API & CLI validation: Gripper G2 / Bio Gripper G2 automatically resume their last positive speed after speed_percent=0 pause commands; SimRobot and ArmDynamics reject NaN/Inf and out-of-range inputs; config.py rejects bool values in numeric YAML fields and merges multi-level overlays; and task CLIs return exit code 2 on --robot vs --config conflicts, task/scene mismatches, or hardware dynamics --robot all.

Hardware Validation

  • xArm 6 + Gripper G2 + 8 mm base plate (firmware v2.8.0, Python 3.14.6, MuJoCo 4.0.1): read-only kinematics_validation, --hold-current-only, and dynamics --gripper gripper_g2 --mode real-read-only (max static residual 0.658 Nm, err/warn = 0/0); sdk-sim dynamics, pick-place, and dynamics-sim-collision-check (<= 0.000004 rad physical drift, full controller load/offset/collision config restoration); single-cycle --mode real dynamics (arrival_error_rad = 0.0) and empty-grasp pick-place (21.94 mm closed / 83.8 mm open, final_joint_error_rad = 4.94e-07, err/warn = 0/0); and compound-rotation plan_cartesian_line round-trip (+80 mm Y, +50 mm Z, +0.35 rad Z + 0.15 rad X: sdk-sim 2e-06 rad drift, --mode real 0.1882 mm / 0.0435° outbound and 0.1909 mm / 0.044° return arrival error, 0.0007 mm max lateral deviation, err/warn = 0/0).
  • xArm 6 + AI1500 F/T Sensor (firmware v2.8.0, Python 3.14.6, MuJoCo 4.0.1): 6-pose static gravity calibration (0.150 kg floating head mass, <= 0.013 N / 0.00124 Nm static residual, 200 Hz IEEE-754 fp32 polling, calibrated RAW_NOISE_STD/EXT_NOISE_STD); bare-arm --mode sdk-sim blocked (exit 1); --gripper ft_sensor real-read-only (1.758 Nm max static delta) and sdk-sim (272 samples, 7.43e-5 rad max joint error, 0.043 mm max EE error, 8e-6 rad physical drift); and 11_force_torque_sensor.py --ip read-only live sampling (86 samples over 0.5 s, err/warn = 0/0, state=2 preser...
Read more

v0.1.6 - Schema v4 Hardware Dynamics Validation Suite

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 17 Nov 11:08

Schema v4 dynamics validation suite, xarm_ros2-aligned port-502 calibration, <= 40 °/s hardware dynamics speed ceiling, and bare-arm 20-pose hardware verification across all five arm families (xArm 5, xArm 6, xArm 7, Lite 6, and UF850). See CHANGELOG.md.

Install

pip install ufactory_mujoco-0.1.6-py3-none-any.whl   # attached below; Python 3.12–3.14
ufactory-mujoco pick-place --robot xarm6 --headless
dynamics-sim-check --robot xarm6

The wheel is a 111.8 MiB download (630.7 MiB of bundled models, meshes, task configs, and licenses once installed) and requires MuJoCo >=4,<5.

Added

  • ufactory_mujoco.dynamics subpackage (preserving ArmDynamics and attach_payload exports at both ufactory_mujoco and ufactory_mujoco.dynamics), adding Schema v4 validation dataclasses, five-arm 20-pose expansion (configs/dynamics_validation_pose.yaml), closed-loop MuJoCo PD-hold probing, independent MujocoRneaReference / optional PinocchioReference oracles, L1/L2a/L2b/L3a/L3b static diagnostics, PD tracking-saturation gating, RealRobotSession safety checks, CSV/JSONL/_torque.png reporting (gracefully skipping plots when matplotlib is absent), and python -m ufactory_mujoco.dynamics <subcommand> CLI.
  • Four ufactory_genesis-aligned console scripts in pyproject.toml: dynamics-sim-check, dynamics-sim-collision-check, dynamics-hardware-check, and dynamics-report-compare.
  • Shared port-502 calibration extraction helpers in ufactory_mujoco.calibration (robot_name_from_firmware, fetch_kinematics_bytes, decode_kinematics_payload, DegenerateCalibrationError, export_kinematics_calibration), reused by both scripts/gen_kinematics_params.py and python -m ufactory_mujoco.dynamics export-calibration.
  • tests/test_dynamics_suite.py covering five-arm 20-pose simulation regressions, Schema v4 cross-repo CSV/JSONL compatibility, mocked RealRobotSession safety gates, <= 40 °/s speed-ceiling enforcement, xarm_ros2-aligned port-502 decode and xarm5 degeneracy skip tests (exit 2), optional PinocchioReference cross-engine checks, and default_validation_poses joint-limit bounds.

Changed

  • Enforced a hard <= 40 °/s (0.6981 rad/s, MAX_DYNAMICS_MOVE_SPEED_RAD_S) joint speed ceiling via validate_dynamics_move_speed across dynamics-hardware-check, dynamics-sim-collision-check, RealRobotSession.move_to, XArmRobot(..., max_joint_speed_rad_s=...), and ufactory-mujoco dynamics --mode sdk-sim/real.
  • Updated scripts/accept_installed.py to track the 12th packaged YAML (configs/dynamics_validation_pose.yaml) and smoke-test dynamics-sim-check, dynamics-hardware-check --dry-run, and dynamics-report-compare under read-only wheel installations.
  • Updated .gitignore to ignore local reports/ and per-unit calibrations/*.yaml exports (retaining the tracked calibrations/xarm6_kinematics_L56A01.yaml test fixture).

Fixed

  • ufactory_mujoco.calibration: aligned decode_kinematics_payload directly with xarm_ros2 (removing the legacy abs(value) > 1.0 -> /= 1000.0 heuristic) and raised DegenerateCalibrationError so export_kinematics_calibration skips non-physical > ±2.0 m port-502 parallel-axis packets (e.g. xarm5) cleanly with exit code 2 and directs users to --nominal-model without writing invalid YAMLs.
  • ufactory_mujoco.kinematics_validation: adjusted default_validation_poses("lite6")["pose_b"] (J3 = 0.6 rad) to stay within Lite 6's joint3 range [-0.061087, 5.23599] rad, aligned default_validation_poses("uf850")["ready"] ([0.0, -0.5, 0.0, 0.0, 0.5, 0.0]) with ufactory_genesis / runtime defaults, and aligned ik_ok with the declared 1.0 mm / 0.5° tolerance on both MuJoCo and controller FK reprojections so singular wrist poses (home) do not fail solely on the inner solver's 0.1 mm polish flag.

Hardware Validation

  • xArm 5 (bare flange, firmware v2.8.2, --nominal-model, Python 3.14.6, MuJoCo 4.0.1): controller internal simulation self-collision check 20/20 PASS (0.000002 rad physical drift); full 20-pose hardware static torque check 20/20 PASS (torque_l2 error 0.520–0.780 Nm, mean 0.622 Nm, L2a/L2b/L3a/L3b all 20/20 pass).
  • xArm 6 (bare flange, firmware v2.8.0, Python 3.14.6, MuJoCo 4.0.1): controller internal simulation self-collision check 20/20 PASS (0.000000 rad physical drift); full 20-pose hardware static torque check 20/20 PASS (torque_l2 error 0.470–0.765 Nm, mean 0.619 Nm, L2a/L2b/L3a/L3b all 20/20 pass).
  • xArm 7 (bare flange, firmware v2.8.2, Python 3.14.6, MuJoCo 4.0.1): standard FK/IK validation PASS (FK <= 0.0003 mm, IK <= 0.095 mm), controller internal simulation self-collision check 20/20 PASS (0.000004 rad physical drift); full 20-pose hardware static torque check 20/20 PASS (torque_l2 error 0.816–3.303 Nm, mean 1.750 Nm, L2a/L2b/L3a/L3b all 20/20 pass).
  • Lite 6 (bare flange, firmware v2.8.2, Python 3.14.6, MuJoCo 4.0.1): standard FK/IK validation PASS (FK <= 0.649 mm, IK <= 0.660 mm), controller internal simulation self-collision check 20/20 PASS (0.000080 rad physical drift); full 20-pose hardware static torque check 20/20 PASS (torque_l2 error 0.028–0.156 Nm, mean 0.094 Nm, L2a/L2b/L3a/L3b all 20/20 pass).
  • UF850 (bare flange, firmware v2.8.100, Python 3.14.6, MuJoCo 4.0.1): standard FK/IK validation PASS (FK <= 0.854 mm, IK <= 0.871 mm), controller internal simulation self-collision check 20/20 PASS (0.000004 rad physical drift); full 20-pose hardware static torque check 20/20 PASS (torque_l2 error 0.086–0.569 Nm, mean 0.240 Nm, L2a/L2b/L3a/L3b all 20/20 pass).

Verified

  • Local 3-environment sequential acceptance (py312, py313, py314): ruff check ., git diff --check, 99 XML compilation (0 errors, 0 warnings across all 3 envs), full pytest tests (py312: 386 passed, 601 subtests passed; py313: 386 passed, 601 subtests passed including Pinocchio checks; py314: 379 passed, 7 skipped, 596 subtests passed), CI headless example smoke suite (SMOKE PASS across all 3 envs), 30 golden task reports per env with zero unintended drift (26 match 0.1.4, 4 lite6 simulation reports match v0.1.5 byte-for-byte), twine check --strict, distribution verification (99 models, 444 meshes, 12 configs, 6 licenses), and isolated wheel acceptance (47 commands PASS across all 3 envs).
  • GitHub Actions CI run #44068096128: all 8 jobs passed (lint, build, test and installed across Python 3.12, 3.13, 3.14 with MuJoCo 4).

SHA-256

041022979d124cabec8bc8f8d93ab75fe3dea296111fda9eea0c58662e067c57  ufactory_mujoco-0.1.6-py3-none-any.whl
78134ab559dab3f7a0d663ea875124f7556cd26cf4358ad01a441a6a9e6a0ebd  ufactory_mujoco-0.1.6.tar.gz

v0.1.5 - Full-Precision Visuals, Multi-Arm D435, and Slimmed Public API

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 16 Nov 11:31

Full-precision visual meshes, multi-arm RealSense D435 assemblies, Lite 6 joint PD tuning, end of MuJoCo 3 support, and a smaller public API. See CHANGELOG.md.

Install

pip install ufactory_mujoco-0.1.5-py3-none-any.whl   # attached below; Python 3.12–3.14
ufactory-mujoco pick-place --robot xarm6 --headless

The wheel is a 111.8 MiB download (630.7 MiB of bundled models, meshes, task configs, and licenses once installed) and requires MuJoCo >=4,<5 (MuJoCo 3.x is no longer supported from 0.1.5).

Breaking

  • ufactory_mujoco exports 39 user-facing names instead of 84 (lower-level helpers remain importable from their submodules).
  • Consolidated gripper/Jacobian APIs on RobotInterface, SimRobot, and XArmRobot: get_gripper_gap(measured=True) (replaces get_measured_gripper_gap()), set_gripper_gap(mm / 1000, ...) (replaces set_gripper_command), SimRobot.gripper_control_output property (replaces get_gripper_control_output()), grippers.gripper_object_contact_forces_n(...) (replaces SimRobot.get_gripper_contact_forces), and kinematics.pose_jacobian(...) (replaces SimRobot.tcp_jacobian).
  • Removed redundant helpers (pose_error, condition_number, path_length, bio_g2_physics_summary, MASS_KG, BIO_G2_PHYSICS_PROFILE, bio_g2_model.bounded, PACK_PHASES, XArmRobot.get_controller_tcp_pose) and the assets extra.

Fixed

  • Restored full upstream tessellation on all arm and accessory visual OBJ meshes (vertices match ufactory_genesis v0.3.6 GLBs within 1.4e-8 m), eliminating joint banding creases and rounded-edge polygonization.
  • Converted 36 thin-walled/open visual OBJ parts (including all 7 Gripper G2 meshes, 4 Bio Gripper G2 parts, vacuum gripper housing, and arm end parts) to double-sided meshes with inertia="shell", eliminating back-face culling holes.

Added

  • Seven RealSense D435 arm assemblies ({xarm5,xarm6,xarm7,uf850}_with_d435 and {xarm5,xarm7,uf850}_with_gripper_and_d435; 14 XMLs reusing meshes via relative symlinks) with regression tests locking human-eye upright view and base Y- (flange +Y) USB-C orientation across all 8 xArm/UF850 D435 assemblies.
  • Asset regression tests covering visual OBJ disk footprint (450–650 MiB), flattened-normal area bounds, and double-sided OBJ / inertia="shell" checks.

Changed

  • Requires mujoco>=4,<5; dropped requirements-lock-mujoco3.txt and MuJoCo 3 CI.
  • Tuned Lite 6 joint position actuator PD gains (J1–3 kv 200 -> 80, J4–6 kp 40/80/40 -> 160/320/160, kv 8/16/8 -> 6.4/12.8/6.4) to a uniform 0.04 s time constant. Task reports for xArm 5/6/7 and UF850 remain byte-identical to 0.1.4; Lite 6 simulation task reports reflect tighter Cartesian line tracking (<= 0.13 mm).
  • Updated xarm5, xarm7, and uf850 combination ready keyframes to exact Gripper G2 (300, 0, 300) mm downward IK poses (RPY = (180°, 0°, 0°)).
  • Consolidated resource_paths.py into model_paths.py and check_distribution.py into accept_installed.py --check-dist; moved asset conversion scripts into local dev/asset_tools/.
  • Updated root and examples/simulation English/Chinese READMEs with the Python 3.12–3.14 / MuJoCo 4.x support matrix, accurate model counts (44 total / 30 arm / 19 jaw-gripper), and grouped CLI option tables.

Removed

  • scripts/optimize_visual_objs.py, remaining RL-only scenes/interfaces (scene_reach.xml, ReachWorkspace, ScalarG2Controller, ufactory_mujoco._hashing), unreferenced Lite 6 collision STLs (finger1.stl, finger2.stl), models/gripper_g2/source/ snapshot, and historical comparison scripts.

Verified

  • Local py314 (Python 3.14.6, MuJoCo 4.0.1): ruff check ., 99 XML compilation (0 errors, 0 warnings), full pytest tests (330 passed, 2 skipped, 596 subtests passed), CI headless example smoke suite, twine check --strict, distribution verification (99 models, 444 meshes, 11 configs, 6 licenses), and clean-venv wheel acceptance (44 commands PASS).
  • GitHub Actions CI run #43855340170: all 8 jobs passed (lint, build, test and installed across Python 3.12, 3.13, 3.14 with MuJoCo 4).

SHA-256

488770e5070a46c15dd3ba1c3b94573f6d66ae7ae218cb7d4595a7f84155b77d  ufactory_mujoco-0.1.5-py3-none-any.whl
c4517d52bbc18aef4c50d39e7df3c5fc2333a8a43373e8e20deed3068214e3f5  ufactory_mujoco-0.1.5.tar.gz

v0.1.4 - Asset Sync, Cleanup and Governance

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 13 Nov 05:20

Asset synchronization with ufactory_genesis v0.3.6 (prepared as 0.1.3, first released here), plus cleanup and governance. Reinforcement learning is removed from the project. See CHANGELOG.md.

Install

pip install ufactory_mujoco-0.1.4-py3-none-any.whl     # attached below; Python 3.12–3.14
ufactory-mujoco pick-place --robot xarm6 --headless

The wheel is a 36 MiB download (102 MiB in 0.1.2) and accepts MuJoCo >=3.15,<5. A new environment gets MuJoCo 4.0.1; an environment that already has MuJoCo 3.15–3.17 keeps it.

Removed

  • Reinforcement learning: the ufactory_mujoco.rl package (reach and pick-and-place environments, checkpoint contracts), examples/rl/, the training scripts, the rl extra, the RL tests and the rl CI job. The scripted pick-and-place and box-packing tasks are not affected.
  • requirements.txt, requirements-rl.txt and requirements-assets.txt: dependencies are declared only in pyproject.toml. The two lock files remain.
  • scripts/build_model.py.

Added

  • xArm vacuum gripper (vacuum_gripper) and its combinations with xArm 5, xArm 6, xArm 7 and UF850.
  • Bio Gripper G2 combinations for xArm 5, xArm 7 and UF850, with a calibrated model and servo (71–150 mm gap, speed and force settings).
  • CONTRIBUTING.md, SECURITY.md and CODE_OF_CONDUCT.md.
  • "Commands by Model" and "Viewer Controls" sections in the simulation READMEs, in English and Chinese.

Changed

  • Arm collision geometry: 111 convex STL pieces replace one convex hull per link.
  • Gripper G2: the base collision shape is split into 10 convex pieces, which removes the overlap with the camera bracket.
  • Bio Gripper G2: calibrated 0.79 kg dynamics (was 0.4125 kg).
  • Lite 6 gripper: jaw gap 20–38 mm and a ±3 N drive. The Lite 6 tasks use a 30 mm, 17 g cube.
  • Visual meshes were decimated from 548.92 MB to 89.54 MB. Installed resources shrink from 566 MiB to 128 MiB.
  • Task reports differ from 0.1.2 because of these asset changes.

Fixed

  • 02_joint_control.py started combinations without their own preset from the bare arm's all-zero pose, with the tool inside the floor, and its UF850 demo pose pushed Gripper G2 47 mm into the floor.

Verified

  • Full test suite on MuJoCo 4.0.0 (Python 3.12 / 3.13 / 3.14), 4.0.1, 3.17.0, 3.16.0 and 3.15.0; headless example smoke tests on 4.0.0, 4.0.1 and 3.16.0.
  • Wheel installation acceptance in clean environments on Python 3.12 / 3.13 / 3.14 (44 command checks each, MuJoCo 4.0.1), and in an environment with MuJoCo 3.17.0 already installed.

SHA-256

a4de873f2cc1f10c4f7427bba2f7bf922506de8ddd2d77943ac6fb3bc245def7  ufactory_mujoco-0.1.4-py3-none-any.whl
46396d76c88ba931fa41d79808cc72f0c10f22778e0ae9de5c02a6b0cd29227b  ufactory_mujoco-0.1.4.tar.gz

v0.1.1 - MuJoCo 4.0 Support

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 11 Nov 07:21

MuJoCo 4.0 support. There are no new features and no change to the simulation code; on MuJoCo 3.15 and 3.16, task reports are byte-identical to 0.1.0. See CHANGELOG.md.

Install

pip install ufactory_mujoco-0.1.1-py3-none-any.whl     # attached below; Python 3.12–3.14
ufactory-mujoco pick-place --robot xarm6 --headless

The wheel accepts MuJoCo >=3.15,<5. A new environment gets MuJoCo 4.0.0; an environment that already has MuJoCo 3.15–3.17 keeps it.

Upgrading an existing environment from MuJoCo 3 to MuJoCo 4

MuJoCo 4 splits its Python package into mujoco-core, mujoco-studio and mujoco. Upgrading in place with pip install -U mujoco leaves a broken installation. Uninstall first:

pip uninstall -y mujoco && pip install "mujoco>=4,<5"

If the environment is already broken, repair it with pip install --force-reinstall --no-deps mujoco mujoco-core mujoco-studio.

Changed

  • The MuJoCo requirement is >=3.15,<5 (was >=3.15,<4).
  • requirements-lock.txt pins MuJoCo 4.0.0; requirements-lock-mujoco3.txt holds the MuJoCo 3.16.0 set. CI tests both.
  • RL benchmarks come from policies retrained on MuJoCo 4.0.0 with the published recipes: reach 97.1–100 % on two 512-target groups per arm, pick-and-place 1000 of 1000 held-out episodes.
  • Results on MuJoCo 4.0.0 differ numerically from 3.16.0 (scripted pick-and-place placement error by at most 1.0 mm). Exit codes and task outcomes are the same.

Fixed

  • provenance.json records the MuJoCo version when only mujoco-core is installed.
  • CI steps that pipe their output through tee now fail when the command fails.

Trained RL policies are not included

Neither the repository nor this release contains trained weights; train them locally as described in examples/rl/. Checkpoints trained on MuJoCo 3 load and keep their success rates on MuJoCo 4.0.0, so retraining is not required.

Verified

  • Full test suite on MuJoCo 4.0.0 (Python 3.12 / 3.13 / 3.14), 3.16.0 and 3.15.0; headless example smoke tests on 4.0.0 and 3.16.0.
  • Wheel installation acceptance in clean environments on Python 3.12 / 3.13 / 3.14 (44 command checks each, MuJoCo 4.0.0), and in an environment with MuJoCo 3.17.0 already installed.

v0.1.0 - Project Cleanup, English Errors & Documentation Refresh

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 10 Nov 03:16

Cleanup release that closes the 0.1 series. There are no new features; simulation behaviour, task reports and checkpoint hashes are unchanged. See CHANGELOG.md.

Install

pip install ufactory_mujoco-0.1.0-py3-none-any.whl     # attached below; Python 3.12–3.14
ufactory-mujoco pick-place --robot xarm6 --headless

The wheel contains all models, scenes, task configs and licenses. For development, clone the repository and run pip install -e ..

Trained RL policies are not included

Neither the repository nor this release contains trained weights. Train them locally (needs the rl extra):

python scripts/train_reach_rl.py --model xarm6 --total-steps 2000000 --net-arch 256,256,128 --ent-coef 0.001 --eval-episodes 200
python scripts/train_pick_place_rl.py --n-envs 128 --n-workers 24 --device cuda --seed 1

v1 pick-and-place checkpoints (46-dim observations) are rejected; retrain with the current recipe.

Removed

  • scripts/migrate_pick_place_checkpoint.py and the v1 checkpoint migration path.
  • scripts/seed_sensitivity_experiment.py.
  • Deprecated aliases and unused helpers: XArm6ReachEnv, XArm6PickPlaceEnv (use ReachEnv, PickPlaceEnv), rl.TARGET_LOW/TARGET_HIGH, ForceCurvePoint, gap_to_drive, calibration.sha256_file, gripper_g2_gap_m_to_sdk_pos_mm, GRIPPER_G2_JOINT_VELOCITY_RAD_S, rl.write_artifact_inventory.

Changed

  • RL evaluation helpers live in ufactory_mujoco.rl.evaluation; examples/rl/*/evaluate.py still re-export them.
  • Runtime error messages are in English.
  • ScalarG2Controller is exported from ufactory_mujoco.
  • Tests run with pytest (pip install -e ".[test]"); CI adds a ruff lint job.
  • RL benchmarks re-measured on MuJoCo 3.16.0 (same checkpoints; success rates moved by at most 0.2 percentage points).

Fixed

  • SimRobot() without a model path now works from an installed wheel and honours UFACTORY_MUJOCO_MODELS.
  • Several documentation errors (Gripper G2 defaults, --ip default, viewer shortcuts).

Verified

  • Full test suite and headless example smoke tests on MuJoCo 3.15.0 and 3.16.0; CI on Python 3.12 / 3.13 / 3.14.
  • Wheel installation acceptance in clean environments on Python 3.12 / 3.13 / 3.14 (44 command checks each, MuJoCo 3.17.0).
  • Task reports, evaluations and checkpoint hashes are identical to 0.0.9 apart from one English error message.

v0.0.9 - Calibrated Gripper G2 Dynamics, G2 v2 Assets & Pure-PPO RL Pick-and-Place v2

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 30 Oct 07:47

Release v0.0.9

Delivers calibrated Gripper G2 4-bar linkage kinematics and speed/force hybrid servo dynamics, synchronizes v2 Gripper G2 3D visual/collision assets across standalone and multi-arm models, upgrades RL tabletop pick-and-place to recursive model-hash contract v2 (70-dim observations, randomized spawns), and ships pure-PPO training from scratch achieving 100% (64/64) held-out evaluation success.


🚀 Key Features & Highlights

1. Calibrated Gripper G2 Dynamics, 4-Bar Linkage & Speed/Force Control (ufactory_mujoco/g2_model.py, g2_controller.py, grippers.py, sim_robot.py)

  • Non-Linear 4-Bar Linkage & Force Lookup (G2LinkageGeometry, ForceCurve, G2Model): Exact drive-angle to jaw-gap mapping (0.0572..0.8651 rad $\leftrightarrow$ 84..0 mm, -25.68 mm closed-finger inward offset, 99.80 mm/rad reference Jacobian at raw_position=230), empirical $7 \times 5$ speed-current static pinch-force lookup (15.86..70.20 N / 1.58..7.01 Nm), and SDK pulse/RPM conversion helpers.
  • Rate-Limited PI+PD Hybrid Servo (G2Controller): Pure-NumPy scalar and batched position-torque servo (kp=40, kv=5, ki=40, trajectory parity < 1e-10 against ufactory_genesis), integrated into SimRobot, XArmRobot, RobotInterface, and examples/simulation/04_gripper_control.py (--speed-percent, --force-percent).

2. Gripper G2 v2 3D Assets & Multi-Arm Synchronization (models/gripper_g2/, models/*_with_gripper/, scripts/build_all_mjcf.py)

  • SHA-256 Locked Source Snapshot (models/gripper_g2/source/): Preserves upstream 7-part Draco GLBs, 7 collision STLs, URDFs, and 85-pose SolidWorks reference table (snapshot.json).
  • Canonical Flange-Aligned Meshes & Combos: Updated visual OBJs, collision STLs, joint Z offsets (outer knuckle Z=0.0606 m, inner knuckle Z=0.075602 m), and TCP (Z=0.1735 m) across gripper_g2 and xarm5 / xarm6 / xarm7 / uf850 gripper combinations, verified to < 0.005 mm across all 85 CAD reference poses.

3. RL Pick-and-Place Model-Hash Contract v2 & Pure-PPO from Scratch (ufactory_mujoco/rl/, scripts/train_pick_place_rl.py, examples/rl/pick_place/)

  • Recursive Model-Hash Contract v2 (ufactory_mujoco/rl/model_hash.py, artifacts.py): Fingerprints the scene, recursively included MJCFs, and referenced mesh files (runtime_model_sha256: bfd917fb...35a8c, invariant to packaged wheel meshdir rewrites) and enforces contract matching during training, evaluation, and rollout; adds scripts/migrate_pick_place_checkpoint.py for evaluated legacy checkpoint migration/rejection.
  • Pure-PPO Pick-and-Place from Scratch (pick_place_env.py, ik.py): Fast inner-loop DLS IK (mj_kinematics + mj_comPos), 50 Hz calibrated G2Controller (50% speed / 50% force), 70-dim phase-free contact/clearance observation space, randomized spawn domain ($x \in [0.30, 0.50]\text{ m}$, $y \in [-0.20, 0.20]\text{ m} \to [0.30, 0.30]\text{ m}$), and GroupedSubprocVecEnv multi-worker pure-PPO training with zero expert demonstrations or behavior-cloning warmstart.
  • 64-Episode Held-Out Benchmark (--seed 18001): Both the pure-PPO v2 policy (9.0M steps) and PickPlaceExpert achieve 100.0% (64/64) success, with pure-PPO max touchdown press 0.124 mm (<= 1.0 mm), max release height 0.105 mm (<= 3.0 mm), mean placement error 4.71 mm (<= 20.0 mm), and 0% collision, drag, tilt, or high-release failures.

✅ Verification Summary

  • Python 3.12 / 3.13 / 3.14 Test Matrix: 280 core unit tests, 100 calibrated G2 / G2 v2 asset / model-contract pytest checks, 44 RL tests (test_reach_env.py + test_pick_place_rl.py), and 24 CI headless example smoke runs (+ 1 expected failure) all passing.
  • Self-Contained Packaging & Read-Only Wheel Acceptance: Rebuilt sdist & wheel (48 MJCF XMLs, 135 meshes, 11 YAML configs, 5 license texts) passing twine check, check_distribution.py, 44 checkout-free read-only CLI checks, and bundled runtime_model_sha256 verification across Python 3.12, 3.13, and 3.14.

v0.0.8 - Multi-Arm Manipulation, RL Suite, Self-Contained Packaging & Hardware Safety Gate

Choose a tag to compare

@DanielWang123321 DanielWang123321 released this 28 Oct 10:16

Release v0.0.8

Completes milestones 0.0.5–0.0.8 (Batches 1–9 aligned with ufactory_genesis 0.3.2), delivering multi-arm manipulation, obstacle avoidance, five-arm dynamics validation, self-contained wheel/sdist packaging, reinforcement learning (Reach + Pick-and-Place) with checkpoint contracts, and real-robot XArmRobot integration with a fail-closed hardware safety gate.


🚀 Key Features & Highlights

1. Multi-Arm Registry, Strict YAML Task Configs & Gripper Contact (ufactory_mujoco/robots.py, config.py, grippers.py)

  • Typed 5-Arm Registry: Unified robot profiles (lite6, xarm5, xarm6, xarm7, uf850), gripper compatibility (gripper_g2, bio_gripper_g2, lite6_gripper, lite6_vacuum_gripper), scene path resolution, and frozen Reach workspaces.
  • Strict YAML Task Configurations: Default and per-robot overlays (configs/) with unknown-key rejection, finite-number validation, and path-independent SHA-256 content hashes.
  • Physical Jaw Gap & Bilateral Contact: Millimeter jaw-gap mapping (gap_to_position / position_to_gap) and bilateral finger-pad contact verification (require_bilateral_contact) before lifting.

2. Multi-Arm Pick-and-Place, Box-Packing & Preflight (ufactory_mujoco/preflight.py, collision.py, path_planning.py, tasks/)

  • Five-Arm Pick-and-Place (05_pick_place.py / ufactory-mujoco pick-place): Supports all five arm+gripper combinations under servo_cartesian and servo_j (place_error < 50 mm, home_drift < 10 mm).
  • Five-Arm Box-Packing Showcase (10_box_pack.py / ufactory-mujoco box-pack): Multi-cycle free-fall release 50 mm above the box rim with speed scaling and 1 mm final collision-bound verification.
  • Trajectory Preflight & RRT-Connect (09_obstacle_avoidance.py): Joint-limit and collision preflight before execution, zero-step --dry-run reporting, and automatic RRT-Connect + path shortcutting around obstacles.

3. Five-Arm Dynamics Validation & Self-Contained Packaging (ufactory_mujoco/tasks/dynamics.py, pyproject.toml, .github/workflows/ci.yml)

  • Five-Arm Dynamics Suite (08_dynamics.py / ufactory-mujoco dynamics): Validates SPD mass matrices, gravity/Coriolis terms, ID/FD reciprocity, feedforward torque utilization, collision fixtures, and step-by-step monitored motion across all five bare arms (4201 steps/arm, zero penetration/limit violations), plus the xArm 6 3 kg payload baseline.
  • Self-Contained Wheel & sdist: Bundles all 48 MJCF XML models, 135 deduplicated meshes, 11 YAML configs, and 5 license notices into ufactory_mujoco, enabling source-free execution from any directory via ufactory-mujoco {pick-place,box-pack,dynamics}.
  • CI Matrix: Automated GitHub Actions workflow covering Python 3.12 / 3.13 / 3.14 editable tests, sdist -> wheel build & twine check, checkout-free read-only wheel acceptance (44 CLI checks), and CPU PyTorch RL tests.

4. Reinforcement Learning: Five-Arm Reach & Tabletop Pick-and-Place (ufactory_mujoco/rl/)

  • Declarative Recipes & Checkpoint Contracts (ufactory_mujoco/rl/artifacts.py): Strict recipe.yaml validation, canonical config.yaml SHA-256 hashing, .checkpoint_manifest.json verification (load_validated_ppo), and provenance.json tracking.
  • Five-Arm TCP Reaching (reach_env.py, examples/rl/reach/): Calibrated workspaces and lite-visual training (~0.3 GB RAM/env) achieving 96.3%–100% success at the strict < 5 mm threshold across lite6, xarm5, xarm6, xarm7, and uf850.
  • Tabletop Cube Pick-and-Place (pick_place_env.py, examples/rl/pick_place/): 4D Cartesian + Gripper G2 gap increment action space on xArm 6 + Gripper G2, independent PickPlaceMetrics & PickPlaceExpert, achieving 100% evaluation success with max touchdown press 0.115 mm (<= 1.0 mm) and mean placement error 3.86 mm (<= 20.0 mm).

5. Real-Robot XArmRobot, Kinematic Calibration & Safety Gate (ufactory_mujoco/xarm_robot.py, calibration.py, safety.py, kinematics_validation.py)

  • XArmRobot(RobotInterface): Read-only observation session by default (read_only=True); physical motion and gripper commands are locked until unlocked with an unforgeable MotionApproval token.
  • Per-Unit Kinematic Calibration & Controller FK/IK Validation: Extracts real controller joint offsets (scripts/gen_kinematics_params.py -> calibrations/xarm6_kinematics_L56A01.yaml), patches MuJoCo models, and cross-validates against firmware FK/IK (xArm 6 SN XI130505L56A01, v2.8.0: FK max error 0.0013 mm / 0.0002°, IK round-trip 0.1501 mm).
  • Controller Internal Simulation (sdk-sim) & Single-Cycle Safety Gate: Replays velocity-bounded trajectories on the controller's internal virtual robot (set_simulation_robot(True)) with automatic finally restoration and verified zero physical joint drift (0.002 mrad <= 1.0 mrad), while enforcing cycles == 1, calibration SHA-256 matching, and --confirm-real for hardware modes.

✅ Verification Summary

  • 276 automated unit & integration tests passing (16 optional-dependency skips in core-only env; 41 RL tests passing in CPU RL env).
  • 44 source-free installed-wheel CLI checks passing under read-only package permissions.
  • Live xArm 6 hardware acceptance (192.168.1.60) passing across FK/IK validation, read-only static/dynamics checks, and pick-place / box-pack / dynamics sdk-sim runs.