Skip to content

Pulsar SDK

Virtual actuators

PulsarActuatorVirtual runs a validated AUGUR Digital Twin actuator model inside a deterministic VirtualWorld (fixed 20,000 Hz / 50 µs internal timestep).

Install assets

Install pulsar-assets alongside either SDK using Pixi:

pixi workspace channel add --prepend https://prefix.dev/pulsarhri/pulsar-forge
pixi add pulsar-sdk pulsar-assets
pixi run pulsar-cli vscan
pixi workspace channel add --prepend https://prefix.dev/pulsarhri/pulsar-forge
pixi add pulsar-rs-sdk pulsar-assets
pixi run pulsar-rs-cli vscan

Supported models:

  • P90
  • P100
  • PULSE98-30G
  • PULSE98-55G
  • PULSE115-60G
  • PULSE115-110G

Create, configure, and step

from pulsar_sdk import (
    ControlConfiguration,
    Mode,
    PulsarActuatorVirtual,
    TelemetryItems,
    VirtualWorld,
)

world = VirtualWorld()
actuator = PulsarActuatorVirtual(world, model="PULSE115-60G", address=1)

with actuator:
    actuator.configure(
        ControlConfiguration(
            Mode.POSITION,
            (TelemetryItems.POSITION, TelemetryItems.VELOCITY),
            telemetry_rate_hz=500,
        )
    )
    actuator.enable()
    actuator.set_command(0.5)

    for _ in range(100):
        world.step()

    actuator.disable()
use pulsar_rs_sdk::{
    ControlConfiguration, Mode, PulsarActuatorVirtual, TelemetryItem,
    VirtualWorld,
};

let world = VirtualWorld::new()?;
let actuator = PulsarActuatorVirtual::new(&world, "PULSE115-60G", Some(1))?;

actuator.connect()?;
actuator.configure(&ControlConfiguration::new(
    Mode::Position,
    [TelemetryItem::Position, TelemetryItem::Velocity],
    500.0,
)?)?;
actuator.enable()?;
actuator.set_command(0.5)?;

for _ in 0..100 {
    world.step()?;
}

actuator.disable()?;
actuator.disconnect()?;

Without an explicit asset path, VirtualWorld automatically locates pulsar-assets from PULSAR_ASSETS_PATH, the active Pixi/Conda prefix, or an adjacent share/pulsar-assets directory.

How VirtualWorld.step() advances time

  1. Finds the earliest next periodic telemetry event among connected virtual actuators (or advances one 50 µs tick if periodic telemetry is disabled).
  2. Applies supplied external shaft loads across those internal model ticks.
  3. Advances connected models in registration order.
  4. Delivers due telemetry and waits for due actuator/group callbacks to complete.
  5. Returns after callback commands are stored for the next step.

Disconnected actuators do not participate in stepping.

External shaft loads

Pass finite external output-shaft torques in N·m keyed by actuator address or unique group member name. Positive load opposes positive output motion:

# By virtual address:
world.step(loads_by_address={1: 0.25})

# Or by group member name (when unique in the world):
world.step(loads_by_name={"shoulder": 0.25})
use std::collections::BTreeMap;

// By virtual address:
let by_addr = BTreeMap::from([(1_u16, 0.25_f64)]);
world.step_with_loads(&by_addr)?;

// Or by address and/or unique group member name (Rust 1.1.0):
let by_name = BTreeMap::from([("shoulder".to_string(), 0.25_f64)]);
world.step_with_loads_and_names(&BTreeMap::new(), &by_name)?;

Passive states and isolation

  • In INIT_CONFIG and CONFIG_AND_TELEM, virtual actuators remain mechanically movable under external load with passive zero torque. Telemetry is unavailable in INIT_CONFIG, matching physical hardware.
  • Telemetry staleness uses deterministic simulation time, so pausing in a debugger never triggers spurious timeouts.
  • Virtual BUS_VOLTAGE reports the model's fixed 48 V supply.
  • Each actuator instance loads an isolated copy of its generated model library.
  • zero_position() resets the model on one world-owned 50 µs tick.

For coupling virtual actuators to MuJoCo or other multibody simulators, read Co-simulation coupling.