Skip to main content

am-sdk for Python

The Python side of the Artificial Motion host SDK. Same calls as the C library, same simulator.

pip install -e ".[dev]"            # from this folder
pip install -e ".[can]"            # CAN-FD through python-can
pip install -e ".[ecat]"           # EtherCAT through pysoem
pip install -e ".[mujoco]"         # MuJoCo coupling
pip install -e ".[batch]"          # numpy, for the batched actuator model
pip install -e ".[pinn]"           # numpy, for the optional PINN residual
import math
import am_sdk as am

s = am.am_init(am.AmSessionConfig(interface="sim:M"))
joint = am.am_open_joint(s, 0)
am.am_start(s)
am.am_set_mode(joint, am.AmMode.IMPEDANCE)
am.am_enable(joint, timeout_ms=1000)

for k in range(3000):
    q_ref = 0.5 * math.sin(2 * math.pi * 0.5 * k * 1e-3)
    am.am_set_impedance(joint, am.AmImpedance(q_ref_rad=q_ref, kp_Nm_per_rad=150.0, kd_Nm_s_per_rad=6.0))
    am.am_cycle(s)
    t = am.am_read_telemetry(joint)

am.am_deinit(s)

A negative C status becomes an AmError with the status in .status.

Interfaces:

interface Backend
sim, sim:M,H-F built-in simulator, one joint per unit
ecat:<nic> EtherCAT (pysoem); set bus=AmBus.ETHERCAT
can:<python-can interface>:<channel>[@nominal/data] CAN-FD (python-can); set bus=AmBus.CANFD

Your own master: implement am_sdk.Transport (process-data exchange plus object read and write) and pass AmSessionConfig(backend=am_sdk.TransportBackend(your_transport)). am_sdk.SimWireTransport is the simulator behind that same interface, byte for byte.

Torque estimation and collision detection (simulated, pre-hardware): am_sdk.estimation, see docs/ESTIMATION.md and examples/05_torque_estimation_collision.py.

Examples are in examples/, tests in tests/ (python -m pytest). The tests include a cross-check against the C library when it is built (see the top-level README).

Python runs the cycle with the host clock. Use it for development, commissioning and identification. Run 1 kHz control on hardware from C.

Apache-2.0 for the code, the unit data and the specs (LICENSE, NOTICE). See the top-level README for the full picture.

Actuator model for any actuator (MuJoCo, Isaac Lab, your own simulator): am_sdk.actuator_model, documented in docs/ACTUATOR_MODEL.md.

The API reference is docs/API.md. The joints are not built yet: every unit value in this package is a simulated typical design value, not a measurement.

Metadata

Release files for am-sdk 0.2.0

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

Source distribution (sdist)

Source distribution for am-sdk 0.2.0
File Size Uploaded
am_sdk-0.2.0.tar.gz 135.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for am-sdk 0.2.0
File Interpreter ABI Platform
am_sdk-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 291.2 kB

Release files / am_sdk-0.2.0.tar.gz

Download URL am_sdk-0.2.0.tar.gz
Size 135.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e2ba855720e956e8647e6a4dbdee32c8c14838cfb2b09389fb97d6ca3a970086
BLAKE2b-256 checksum
How to use checksums
644734172a907c4befd268598e07ffbd4f0cf536907aaccc0df71411414bcb49
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 Oct 12, 2026.

Transparency log

Release files / am_sdk-0.2.0-py3-none-any.whl

Download URL am_sdk-0.2.0-py3-none-any.whl
Size 155.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55f9b17211b31fc0b1d69d766cdae31f33f9d632a1bef2a436098a89683b3d9a
BLAKE2b-256 checksum
How to use checksums
8910a7565ef40fb81f664b29c728e71badc8f84d66f70c9a6039b6c4cd0cacd7
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 Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

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