Skip to content

Quickstart

Physical actuator over direct USB with Pulsar Python SDK

Control one physical actuator connected directly by USB.

Prerequisites

  • the actuator is securely mounted and powered;
  • it is connected directly to the computer by USB;
  • its firmware is 2.0.4 or newer;
  • Python 3.10–3.13 is available on Linux or Windows.

Read Safety and prerequisites before sending a command.

Install with Pixi

Pixi creates a reproducible project environment and uses the same project commands on Linux and Windows.

pixi init pulsar-quickstart
cd pulsar-quickstart
pixi workspace channel add --prepend https://prefix.dev/pulsarhri/pulsar-forge
pixi add pulsar-sdk

Run a short velocity command

Create quickstart.py:

from time import sleep

from pulsar_sdk import (
    ControlConfiguration,
    Mode,
    PulsarActuatorReal,
    TelemetryItems,
    PcpOverUsb,
)

usb = PcpOverUsb()
actuator = PulsarActuatorReal(usb, address=0)

with actuator:
    actuator.configure(
        ControlConfiguration(
            mode=Mode.VELOCITY,
            telemetry_items=(
                TelemetryItems.POSITION,
                TelemetryItems.VELOCITY,
            ),
            telemetry_rate_hz=100,
        )
    )
    actuator.enable()
    actuator.set_command(1.0)  # rad/s

    sleep(2)

    print(actuator.read_telemetry((
        TelemetryItems.POSITION,
        TelemetryItems.VELOCITY,
    )))
    actuator.disable()

Run it inside the project environment:

pixi run python quickstart.py

The context manager connects before the body and disconnects when the body exits. disable() turns drive output off while keeping runtime telemetry available until disconnect.

Danger

Do not rely on Python object destruction to stop hardware. Use disable() and disconnect(), preferably through a context manager as shown above.

Next steps