Skip to main content

Python bindings for moteus brushless controller

These bindings permit communication and control of moteus brushless controllers.

To use

pip3 install moteus  # or 'moteus-pi3hat' on a pi3hat

See a simple example of the API in use at: simple.py

Theory

Interactions with a controller are mediated through the moteus.Controller object. When constructed with the constructor argument transport=None (the default) it attempts to find some suitable link on your host system, typically the first fdcanusb or socketcan bus it locates.

Single controller imperative operation can be conducted by using await Controller.set_stop(), await Controller.set_position(), and await Controller.query().

Bus-optimized usage

To optimize bus usage, it is possible to command multiple controllers simultaneously. In this mode, a "transport" must be manually constructed.

import asyncio
import math
import moteus

async def main():
    transport = moteus.Fdcanusb()
    c1 = moteus.Controller(id = 1)
    c2 = moteus.Controller(id = 2)

    while True:
        print(await transport.cycle([
          c1.make_position(position=math.nan, query=True),
          c2.make_position(position=math.nan, query=True),
        ]))

asyncio.run(main())

All of the "set_" methods have a "make_" variant which is suitable to pass to a Transport's cycle method.

This mechanism only improves performance for non-fdcanusb links, such as a pi3hat.

An example use of this mechanism can be found at: pi3hat_multiservo.py

Position mode commands

Controller.set_position and Controller.make_position have arguments which exactly mirror the fields documented in docs/reference.md. Omitting them (or specifying None), results in them being omitted from the resulting register based command.

  • position
  • velocity
  • feedforward_torque
  • kp_scale
  • maximum_torque
  • stop_position
  • watchdog_timeout

Finally, the query argument controls whether information is queried from the controller or not.

Controlling resolution

The resolution of commands, and of returned query data, is controlled by optional constructor arguments to Controller. By default, the commands are all F32, and the query requests a subset of fields as INT16. Here is an example of setting those.

pr = moteus.PositionResolution()
pr.position = moteus.INT16
pr.velocity = moteus.INT16
pr.kp_scale = moteus.F32
pr.kd_scale = moteus.F32

qr = moteus.QueryResolution()
qr.mode = moteus.INT8
qr.position = moteus.F32
qr.velocity = moteus.F32
qr.torque = moteus.F32

c = moteus.Controller(position_resolution=pr, query_resolution=qr)

Release files for moteus 1.1.1

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

Source distribution (sdist)

Source distribution for moteus 1.1.1
File Size Uploaded
moteus-1.1.1.tar.gz 96.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moteus 1.1.1
File Interpreter ABI Platform
moteus-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 208.9 kB

Release files / moteus-1.1.1.tar.gz

Download URL moteus-1.1.1.tar.gz
Size 96.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a10a097100984ec16dfed7848bae1ee83e29cc00cd0bb3138cb599b697315820
BLAKE2b-256 checksum
How to use checksums
930b781299a5d3aec5e56cb79eabc03f72a8635a58643930df4c1b2e5ffa83b8
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 Aug 4, 2026.

Transparency log

Release files / moteus-1.1.1-py3-none-any.whl

Download URL moteus-1.1.1-py3-none-any.whl
Size 112.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c870833c43c8c04453b46447818a3543f4f46a444f7be93ecd96fe7f2e6d8dc4
BLAKE2b-256 checksum
How to use checksums
5724d9d22343143807ea345eaa620da87e05667e47fe42587c627c6f2de13239
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 Aug 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.0.0

2 release files

0.3.99

2 release files

0.3.98

2 release files

0.3.97

2 release files

0.3.96

2 release files

0.3.95

2 release files

0.3.94

2 release files

0.3.93

2 release files

0.3.92

2 release files

0.3.91

2 release files

0.3.90

2 release files

0.3.89

2 release files

0.3.88

2 release files

0.3.87

2 release files

0.3.86

2 release files

0.3.85

2 release files

0.3.82

2 release files

0.3.81

2 release files

0.3.80

2 release files

0.3.78

2 release files

0.3.77

2 release files

0.3.76

2 release files

0.3.75

1 release file

0.3.74

1 release file

0.3.73

1 release file

0.3.71

2 release files

0.3.70

2 release files

0.3.69

2 release files

0.3.68

2 release files

0.3.67

2 release files

0.3.64

1 release file

0.3.63

1 release file

0.3.62

1 release file

0.3.61

1 release file

0.3.60

1 release file

0.3.59

2 release files

0.3.58

2 release files

0.3.55

2 release files

0.3.54

2 release files

0.3.50

2 release files

0.3.49

2 release files

0.3.48

2 release files

0.3.47

2 release files

0.3.45

2 release files

0.3.43

2 release files

0.3.42

2 release files

0.3.41

2 release files

0.3.40

2 release files

0.3.39

2 release files

0.3.37

2 release files

0.3.36

2 release files

0.3.35

2 release files

0.3.32

2 release files

0.3.31

2 release files

0.3.30

2 release files

0.3.29

2 release files

0.3.28

2 release files

0.3.27

2 release files

0.3.26

2 release files

0.3.25

2 release files

0.3.24

2 release files

0.3.23

1 release file

0.3.22

1 release file

0.3.21

1 release file

0.3.20

2 release files

0.3.19

2 release files

0.3.18

2 release files

0.3.17

2 release files

0.3.16

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

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