Skip to main content

Reforge SDK (reforge-core)

Reforge SDK is the independently built Python package that powers Reforge calibration and model-based vibration control.

This README is intended for PyPI distribution of reforge-core.

What This Package Provides

Calibration module (reforge_core.calibration)

The calibration module provides the cloud interface used after a robot calibration run:

  • Uploads calibration data artifacts
  • Triggers identification or fine-tuning jobs in Reforge Cloud API
  • Polls job status and downloads generated model artifacts
  • Extracts returned model files for control use

Primary entry point:

  • reforge_core.calibration.api.ReforgeAPIManager

Control module (reforge_core.control)

The control module provides vibration-aware command shaping and model-based joint tracking for robot trajectories:

  • Loads per-axis model files generated by calibration/identification
  • Computes shaping parameters from current robot state
  • Shapes single commands or full trajectories
  • Applies native C++ Joint Tracker compensation to complete trajectories and appendable streams
  • Returns shaped positions, velocities, and accelerations for execution

Primary entry points:

  • reforge_core.control.python.covalent_wrapper.ShaperInterface
  • reforge_core.control.python.covalent_wrapper.RobotState
  • reforge_core.control.joint_tracker.JointTrackerInterface
  • reforge_core.control.joint_tracker.JointCalibrationCompensator

Interface with reforge-interface (src/robot)

Reforge SDK is designed to be consumed by the reforge-interface repository, where robot-specific integration lives.

Expected responsibilities in reforge-interface/src/robot:

  • Robot transport and SDK communication loop
  • Sensor acquisition (joint encoders, TCP accelerometer)
  • Calibration routine execution and local data storage
  • Invocation of Reforge SDK calibration + control APIs

Typical artifact flow:

  1. src/robot/run.py runs calibration and stores local data (for example under src/robot/data/<date>).
  2. ReforgeAPIManager uploads the data and requests model generation.
  3. Returned model artifacts are saved for runtime control (commonly under src/robot/models/current).
  4. ShaperInterface loads those models and the robot URDF to shape outgoing joint commands before they are sent through the robot driver in src/robot.

In this architecture, reforge-interface/src/robot owns robot I/O and execution, while reforge-core owns calibration-cloud orchestration and shaping logic.

Usage

  1. Ensure you have the requirements:
  • An accelerometer/IMU located at the tool center point (TCP) that can measure data in the x-, y-, and z-coordinates of the end-effector’s inertial frame of reference (or the robot base’s inertial frame).
  • Encoders in each joint that can accurately measure the current joint position of the robot at a rate of 200 Hz or higher.
  • A real-time SDK to access data from IMU and encoders and to command the joint motors with time-domain angular motor positions.
  • A Universal Robot Description File (URDF) that describes the robot’s kinematics and dynamics (dynamics optional but preferred).
  1. Integrate the robot’s SDK/URDF and build the project.
  • Pull the Reforge repository from Github and add your robot's SDK to requirements.txt
git clone https://github.com/reforge-robotics/reforge-interface.git
cd reforge-interface
  • Add the robot's URDF to src/robot/urdf
  • Build the project
python3.11 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install --no-cache-dir .
  1. Integrate your robot's SDK in src/robot/robot_interface.py

  2. Test robot connection

python3 -m robot.run connect_test <robot_ip> --local_ip <local_ip> --sdk_token <robot_sdk_token>
  1. Run the calibration and identification of models
  • Run with automatic identification
python3 -m robot.run calibrate <robot_ip> --local_ip <local_ip> --sdk_token <robot_sdk_token> --robot_id <reforge_robot_id> --freq 250 --identify <reforge_api_token>
  • Run joint-tracker calibration and save joint models
python3 -m robot.run calibrate <robot_ip> --type joint_tracker --local_ip <local_ip> --sdk_token <robot_sdk_token> --robot_id <reforge_robot_id> --identify <reforge_api_token>
  • Run shaper calibration with an compensated joint-tracker prepass, then stop before shaper identification
python3 -m robot.run calibrate <robot_ip> --type shaper --with_joint_tracker_mpc --local_ip <local_ip> --sdk_token <robot_sdk_token> --robot_id <reforge_robot_id> --joint_tracker_api_token <joint_tracker_api_token>
  • Run shaper calibration with an MPC-compensated joint-tracker prepass, then run shaper identification with the same API token
python3 -m robot.run calibrate <robot_ip> --type shaper --with_joint_tracker_mpc --local_ip <local_ip> --sdk_token <robot_sdk_token> --robot_id <reforge_robot_id> --identify <shared_api_token>
  • Run shaper calibration with an MPC-compensated joint-tracker prepass, then run shaper identification with separate API tokens
python3 -m robot.run calibrate <robot_ip> --type shaper --with_joint_tracker_mpc --local_ip <local_ip> --sdk_token <robot_sdk_token> --robot_id <reforge_robot_id> --joint_tracker_api_token <joint_tracker_api_token> --identify <shaper_api_token>
  • Run calibration first, then run identification
python3 -m robot.run calibrate <robot_ip> --local_ip <local_ip> --sdk_token <robot_sdk_token>
python3 -m robot.run identify <reforge_api_token> <reforge_robot_id> <local_data_location>
  1. Run test to verify the calibration
python3 -m robot.run vibration_test <robot_ip> <local_data_location> --local_ip <local_ip> --sdk_token <robot_sdk_token>

The robot will go through a random series of motion pairs, one uncompensated and one compensated, store the accelerometer data from the motion tests, and print out a log with the test results.

Shaper Calibration Rollout Notes

Shaper calibration records base-joint grid sweeps by default. Existing six-DOF robots still use --base_joints=1 unless a different value is passed, but that one-base default now records j0 base-angle coverage in addition to the normal full-axis shaper sweeps.

For multi-base robots, pass --base_joints <count> to configure the number of consecutive base joints starting at joint index 0. Base-joint limits are read from the URDF when available. If a requested base joint has no URDF limit, pass one --base_joint_limits LOWER,UPPER value for that joint. Calibration setup fails if the requested base-joint axes do not match the expected world-z-parallel base-joint definition.

Use --test-mode to traverse the planned calibration poses without running sine sweeps or writing acquisition artifacts. The CLI prints the planned run count before motion; review it because calibration duration grows quickly as --base_joints increases. Data recorded above 500 Hz is saved to calibration CSV artifacts downsampled to 500 Hz.

New shaper datasets and model bundles are schema-versioned. New one-base models use the runtime feature schema j0_rad;v_deg;r_mm;inertia; multi-base models add one base-angle feature per consecutive base joint before v_deg, r_mm, and inertia. Older model bundles without feature metadata continue to load through the legacy [v_deg, r_mm, inertia] fallback.

When resuming calibration from a later pose, preserve the earlier pose artifacts in the same data folder. Existing prior-pose CSV artifacts are treated as completed run data during rollout validation, even if the resumed manifest only marks later runs as completed.

Minimal Usage Sketch

from reforge_core.calibration.api import ReforgeAPIManager
from reforge_core.control.python.covalent_wrapper import ShaperInterface, RobotState
from reforge_core.control.joint_tracker import (
    JointTrackerConfig,
    JointTrackerInterface,
    JointTrackerOptimizerOptions,
)

# Calibration/model generation
api = ReforgeAPIManager(reforge_api_token="<token>", robot_id="<robot_id>")
api.run_cloud_model_generation(data_folder="src/robot/data/<YYYY-MM-DD>")

# Runtime shaping
shaper = ShaperInterface(
    sample_time=0.005,
    model_directory="src/robot/models/current",
    urdf_filepath="src/robot/urdf/<robot>.urdf",
    num_axes=3,
    num_joints=6,
    tcp_payload_mass_kg=2.4,  # Attached tool/workpiece mass [kg].
)

state = RobotState(joint_angles=...)  # numpy array
shaped = shaper.shape_sample(..., state)

# Update the existing Shaper before inference after a payload change.
shaper.set_tcp_payload_mass_kg(1.1)

# Native-backed Joint Tracker compensation
tracker = JointTrackerInterface(
    JointTrackerConfig(
        sample_time_s=0.004,
        num_joints=6,
        modeled_axis_indices=[0, 1, 2, 3, 4, 5],
        model_directory="src/robot/models/current",
        optimizer_options=JointTrackerOptimizerOptions(lam_u=0.01),
    )
)

tracked = tracker.process_trajectory(command=positions_rad)

The payload must be finite and nonnegative. A numeric process_trajectory(..., tcp_payload_mass_kg=...) override is applied before that trajectory and persists for later calls; omitting it preserves the current payload.

Installation

pip install reforge-core

For supported PyPI wheels, public Joint Tracker usage is C++ native-backed by default through reforge_core.control.joint_tracker.JointTrackerInterface. Wheel users do not need Rust, CMake, pybind11, nlohmann, compilers, or other runtime build tools to import or run the native Joint Tracker path. Unsupported platform or Python combinations must not silently fall back to the internal pure-Python reference implementation.

The public native-backed Joint Tracker path is configured with JointTrackerConfig and JointTrackerOptimizerOptions, including optimizer settings such as lam_u. The internal pure-Python reference/oracle path is kept at 1:1 feature and controller-output parity for the supported API. JointCalibrationCompensator remains a public calibration API and is backed by native C++ compensation in the default product wheel. Backend selection and direct NativeJointTrackerInterface usage are internal implementation details.

Joint Tracker deliberately diverges from the Shaper backend naming and fallback model in this first native PyPI release. Shaper exposes backend-specific public names for historical compatibility. Joint Tracker's public facade is native by default and fails closed when the required native extension is missing or incompatible.

Build From Source With the Complete Native Shaper Backend

Use this path when developing reforge-core locally or when ShaperInterface should default to the complete native backend. The complete backend is only available when the installed _native_shaper extension was built with the native solver/backend targets enabled.

Run these commands from the repository root, not from src/core_sdk:

Use Python 3.11 for this repository. Do not uninstall or modify an Ubuntu-owned system Python 3.12 installation; create the repository .venv from Python 3.11 instead. Native source builds also require CMake 3.25 or newer. The local source-build path below gets Eigen through cmeel-eigen==3.4.1; CI and Debian packaging workflows install Eigen through libeigen3-dev.

python3.11 -m venv .venv
source .venv/bin/activate

python -m pip install --upgrade pip setuptools wheel
python -m pip install \
  --index-url https://download.pytorch.org/whl/cpu \
  --extra-index-url https://pypi.org/simple \
  torch==2.3.1+cpu
python -m pip install \
  scikit-build-core \
  cmeel-eigen==3.4.1 \
  cmeel-urdfdom-headers==3.0.0 \
  pybind11 \
  nlohmann-json==3.12.0 \
  pin==4.0.0

The CPU Torch wheel is intentional. A CUDA Torch wheel can make native CMake Torch discovery fail on machines that do not have the matching CUDA libraries.

Install rustup if it is not already on PATH, then install the exact Rust toolchain required by the locked Clarabel native solver wrapper:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup toolchain install 1.84.1

Force a clean editable rebuild of the SDK package. The -e src/core_sdk argument is intentional; installing from the repository root does not build the reforge-core package.

RUSTUP_TOOLCHAIN=1.84.1 \
python -m pip install \
  --no-cache-dir \
  --force-reinstall \
  --no-build-isolation \
  --no-deps \
  --config-settings=build-dir=/tmp/reforge-core-sdk-native-build \
  -e src/core_sdk

Use a fresh build directory if you repeat the build after changing native sources or CMake options.

Verify that the installed extension exposes the complete backend:

python - <<'PY'
from reforge_core.control import _native_shaper

print("complete_backend_available:", _native_shaper.complete_backend_available)
print("has NativeShaper:", hasattr(_native_shaper, "NativeShaper"))
PY

The expected output is:

complete_backend_available: True
has NativeShaper: True

If complete_backend_available is False, the active environment is still using a partial _native_shaper build. Re-run the editable install with a fresh --config-settings=build-dir=... value and confirm that rustc +1.84.1 --version reports Rust 1.84.1.

Optional Extras

reforge-core keeps the base install focused on the shared calibration and control stack. Optional feature dependencies are exposed through extras:

  • pip install reforge-core[kinecal] installs the additional packages required for the reforge_core.kinecal package.
  • pip install reforge-core[joint_tracker] is a compatibility no-op for the public native-backed reforge_core.control.joint_tracker package.
  • pip install reforge-core[joint_tracker_reference] installs the Python reference/oracle Joint Tracker packages used for internal parity tests and fixture regeneration.
  • pip install reforge-core[all] installs all optional runtime feature dependencies currently defined by this package.
  • pip install reforge-core[dev] installs development tooling plus the same optional runtime dependencies included by all, plus internal oracle dependencies needed by the repository test suite.

Release files for reforge-core 2.0.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reforge-core 2.0.20
File Size Uploaded
reforge_core-2.0.20.tar.gz 1.8 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for reforge-core 2.0.20
File Interpreter ABI Platform
reforge_core-2.0.20-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
reforge_core-2.0.20-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details

Total release size: 26.1 MB

Release files / reforge_core-2.0.20.tar.gz

Download URL reforge_core-2.0.20.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
323a1d8d643781dafa3a2be30efe412b3788957bc11c4b008bb97efce24070ae
BLAKE2b-256 checksum
How to use checksums
928499709f7d381a90263511dcaf5a4d495ed9d19c0f8c6c9be74b2a9f90a391
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release files / reforge_core-2.0.20-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL reforge_core-2.0.20-cp311-cp311-manylinux_2_28_x86_64.whl
Size 14.4 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5b10bc39900f7e48a1c4f960d90f609d98e79f6653d9fdfc4d5de785b5cf375d
BLAKE2b-256 checksum
How to use checksums
9b4cec2a55d90dd85ecbc85761e17facfc0a9f2b42d8ef0c9ca6984b514d0626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release files / reforge_core-2.0.20-cp311-cp311-macosx_14_0_arm64.whl

Download URL reforge_core-2.0.20-cp311-cp311-macosx_14_0_arm64.whl
Size 9.9 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
1f353a6e13374d141cc2aa4eb1b927d9be592215ed4a9c742d2565d32f575200
BLAKE2b-256 checksum
How to use checksums
786a6da64343f7878445bf04cc5e40b47ec6adc9fe0f009f45c6b6d62d7e2ca6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.23

3 release files

2.0.22

3 release files

2.0.21

3 release files

This release

2.0.20 This release

3 release files

2.0.19

3 release files

2.0.18

3 release files

2.0.17

3 release files

2.0.15

2 release files

2.0.11

3 release files

2.0.10

3 release files

2.0.9

3 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page