Pulsar SDK
Lifecycle, safety, and recovery
Operating state, connection state, and health are distinct facts. Inspect Actuator.status and GroupStatus rather than relying on a single boolean.

Operating states
| State (Python / Rust) | Meaning |
|---|---|
UNKNOWN / State::Unknown |
disconnected or unobserved; cannot be requested |
INIT_CONFIG / State::InitConfig |
drive output and runtime telemetry inactive; configuration allowed |
CONFIG_AND_TELEM / State::ConfigAndTelem |
telemetry active; drive output inactive |
DRIVE_ACTIVE / State::DriveActive |
drive output active; commands affect output |
connect()ends inINIT_CONFIG.configure()andset_mode()are allowed inINIT_CONFIGorCONFIG_AND_TELEMand never enable output.enable()validates configuration and diagnostics, synchronizes the domain when needed, and entersDRIVE_ACTIVE.disable()quiesces active control callbacks cleanly and returns toCONFIG_AND_TELEM.zero_position()works inCONFIG_AND_TELEMorDRIVE_ACTIVE(and resets the primary command to0in position and impedance modes to avoid sudden motion).
Status model
ActuatorStatus reports:
operating_stateandlast_operating_state;connection_state;health(HEALTHY,HOST_FAULT, orACTUATOR_FAULT);diagnostic(ActuatorDiagnosticwith namedflags,raw_bits,unknown_bits,bit_numbers, anderror_bit_numbers);host_error,safety_attempt(with per-membermember_attempts),inhibited_by,recovery, and boundedcan_reset_events.

Firmware-offloaded safety and watchdog (>= 2.2.5)
In SDK 3.1.0 (Python) / 1.1.0 (Rust) on actuator firmware >= 2.2.5, active error safety actions (DampedRelease, HoldPosition, LimitTorque) and the command freshness watchdog are offloaded directly to actuator firmware. Safety behavior executes on the actuator itself and persists across host crashes, panics, or unexpected disconnects.
Safe defaults applied automatically on connect
Connecting to a physical actuator (>= 2.2.5) automatically applies:
- Error safety action:
DampedRelease(with default damping10.0whenControllerErrorPolicy.dampingisNone); - Command freshness timeout:
500 ms.
Sizing the command freshness watchdog (control_rate_hz)
During configure(), passing control_rate_hz automatically sizes the firmware command freshness timeout (ceil(4000 / control_rate_hz) ms, floor 50 ms):
- Closed-loop streaming (e.g.
control_rate_hz=200.0): firmware expects fresh commands regularly and latches safety if the host stalls. - One-shot / non-streaming commands: pass
control_rate_hz=0.0(orcommands_timeout_ms=0) to explicitly disable command-timeout latching.
Override per actuator at construction using commands_timeout_ms, commands_timeout_action, and auto_clear_faults (Python) or RealActuatorOptions (Rust):
from pulsar_sdk import (
ControlConfiguration,
ControllerErrorAction,
DiagnosticFlag,
Mode,
PcpOverCan,
PulsarActuatorReal,
)
can = PcpOverCan()
actuator = PulsarActuatorReal(
can,
address=16,
commands_timeout_ms=250,
commands_timeout_action=ControllerErrorAction.HOLD_POSITION,
auto_clear_faults=False,
)
# Or configure uniform / per-flag safety before connect() or while inactive:
actuator.set_error_action(ControllerErrorAction.DAMPED_RELEASE)
actuator.set_diagnostic_action(
DiagnosticFlag.OVERTEMPERATURE,
ControllerErrorAction.LIMIT_TORQUE,
)
use pulsar_rs_sdk::{
ControllerErrorAction, DiagnosticFlag, PcpOverCan, PulsarActuatorReal,
RealActuatorOptions,
};
let can = PcpOverCan::new()?;
let actuator = PulsarActuatorReal::on_can_with_options(
&can,
16,
RealActuatorOptions {
commands_timeout_ms: Some(250),
commands_timeout_action: Some(ControllerErrorAction::HoldPosition),
auto_clear_faults: false,
},
)?;
// Or configure uniform / per-flag safety before connect() or while inactive:
actuator.set_error_action(ControllerErrorAction::DampedRelease)?;
actuator.set_diagnostic_action(
DiagnosticFlag::Overtemperature,
ControllerErrorAction::LimitTorque,
)?;
set_error_action(...) and set_diagnostic_action(...) are also available on ActuatorGroup and Platform to configure all members consistently.
Default diagnostic behavior
Named DiagnosticFlag values cover warnings (bits 0–15, including CAN_RESET and COMMAND_TIMEOUT) and errors (bits 16–31, including CRITICAL_LATCHED). Unknown future firmware bits remain visible through raw_bits, unknown_bits, bit_numbers, and error_bit_numbers.
Default actions:
OVERTEMPERATURE→LIMIT_TORQUEINTERNAL_ENCODER_ERROR/EXTERNAL_ENCODER_ERROR→INIT_CONFIG- other error-level diagnostics (including unknown bits
16–31) → configured error action (defaultDampedRelease) - unmapped warning-level diagnostics → reported and logged without stopping motion
An unexpected state change or group fault preserves ControllerState.FAULTED across propagated platform safety reports and records per-actuator outcomes in SafetyAttempt.member_attempts.
Danger
ControllerErrorAction.DO_NOTHING and override_diagnostic_safety() suppress automatic safety behavior. Use them only in controlled, reviewed setups with an independent hardware safety plan.
Recovery workflows
After a latched firmware safety fault (DiagnosticFlag.CRITICAL_LATCHED / DiagnosticFlag::CriticalLatched), the actuator holds its firmware safety response until explicitly recovered — the SDK never replays pre-fault commands or automatically re-energizes output.
| Goal after fault | Required sequence |
|---|---|
| Resume normal control | Fix the cause → clear_faults() → resume() → send a fresh command |
| Disarm cleanly | clear_faults() → disable() |
| Connection lost | Reconnect (connect()) — previous physical state is reported as UNKNOWN |
from pulsar_sdk import DiagnosticFlag
status = actuator.status
if status.diagnostic and DiagnosticFlag.CRITICAL_LATCHED in status.diagnostic.flags:
# 1. Confirm physical cause is resolved, then clear latched fault:
if actuator.clear_faults():
# Option A: resume active control with a fresh safe command
actuator.resume()
actuator.set_command(0.0)
# Option B: disarm cleanly instead
# actuator.disable()
use pulsar_rs_sdk::DiagnosticFlag;
let status = actuator.status()?;
let latched = status
.diagnostic
.as_ref()
.is_some_and(|d| d.flags.contains_key(&DiagnosticFlag::CriticalLatched));
if latched && actuator.clear_faults()? {
// Option A: resume active control with a fresh safe command
actuator.resume()?;
actuator.set_command(0.0)?;
// Option B: disarm cleanly instead
// actuator.disable()?;
}
clear_faults() transmits CLEAR_ERRORS, verifies fresh diagnostics, and returns False (false) if an active error condition remains. recover() is kept as a compatibility alias for resume().
Disconnect and drop behavior
- Normal shutdown: call
disable(), thendisconnect()(or exit a Pythonwithblock cleanly). - Dropping a connected handle (or exiting a Python
withblock on an exception) without callingdisable()/disconnect()applies the configured firmware safety action while inDRIVE_ACTIVE(preserving any active safety latch) or transitions cleanly toINIT_CONFIGwhile inCONFIG_AND_TELEM. - After transport loss,
status.operating_statebecomesUNKNOWNwhilestatus.last_operating_statepreserves the last confirmed state.