Force & Haptic Messages

Force/torque sensing and haptic feedback types for manipulation and human-robot interaction.

# simplified
from horus import WrenchStamped, ForceCommand, ContactInfo, HapticFeedback

WrenchStamped

6-DOF force/torque measurement with timestamp.

# simplified
wrench = horus.WrenchStamped(
    fx=0.5, fy=0.0, fz=-9.81,
    tx=0.0, ty=0.1, tz=0.0,
    timestamp_ns=horus.timestamp_ns(),
)
FieldTypeDefaultDescription
fx, fy, fzfloat0.0Force components (N)
tx, ty, tzfloat0.0Torque components (Nm)
timestamp_nsint0Timestamp in nanoseconds

Static Methods:

MethodReturnsDescription
WrenchStamped.force_only(force)WrenchStampedCreate from a Vector3 force (zero torque)
WrenchStamped.torque_only(torque)WrenchStampedCreate from a Vector3 torque (zero force)

Methods:

MethodReturnsDescription
force_magnitude()floatL2 norm of force vector
torque_magnitude()floatL2 norm of torque vector
exceeds_limits(max_force, max_torque)boolTrue if force or torque exceeds limits
filter(prev, alpha)NoneLow-pass filter with previous reading (mutates self)

ForceCommand

Force/torque command for impedance or force control.

# simplified
cmd = horus.ForceCommand(
    fx=0.0, fy=0.0, fz=-5.0,
    tx=0.0, ty=0.0, tz=0.0,
    timeout=1.0,
    timestamp_ns=horus.timestamp_ns(),
)
FieldTypeDefaultDescription
fx, fy, fzfloat0.0Force components (N)
tx, ty, tzfloat0.0Torque components (Nm)
timeout_secondsfloat0.0Command timeout (seconds). Constructor param: timeout
timestamp_nsint0Timestamp in nanoseconds

Static Methods:

MethodReturnsDescription
ForceCommand.force_only(target)ForceCommandCreate from a Vector3 target force
ForceCommand.surface_contact(normal_force, normal)ForceCommandCreate a surface contact command

Methods:

MethodReturnsDescription
with_timeout(seconds)ForceCommandReturn a copy with timeout set

ContactInfo

Contact state information.

# simplified
contact = horus.ContactInfo(state=1, contact_force=2.5, confidence=0.9, timestamp_ns=horus.timestamp_ns())
FieldTypeDefaultDescription
stateint0Contact state code
contact_forcefloat0.0Contact force magnitude (N)
confidencefloat0.0Detection confidence
stiffnessfloat0.0Contact stiffness
dampingfloat0.0Contact damping
timestamp_nsint0Timestamp in nanoseconds
MethodReturnsDescription
is_in_contact()boolTrue if currently in contact
contact_duration_seconds()floatDuration of current contact in seconds

ImpedanceParameters

Impedance control parameters (stiffness, damping). Created with no parameters — read via getters.

# simplified
imp = horus.ImpedanceParameters()

# Read-only getters
imp.stiffness     # list[float]
imp.damping       # list[float]
imp.inertia       # list[float]
imp.force_limits  # list[float]
imp.enabled       # bool
GetterTypeDescription
stiffnesslist[float]Stiffness values per axis
dampinglist[float]Damping values per axis
inertialist[float]Inertia values per axis
force_limitslist[float]Force limits per axis
enabledboolWhether impedance control is enabled
timestamp_nsintTimestamp in nanoseconds

Static Methods:

MethodReturnsDescription
ImpedanceParameters.compliant()ImpedanceParametersCreate compliant (soft) parameters
ImpedanceParameters.stiff()ImpedanceParametersCreate stiff (rigid) parameters

Methods:

MethodReturnsDescription
enable()NoneEnable impedance control
disable()NoneDisable impedance control

HapticFeedback

Haptic feedback command for teleoperation.

# simplified
haptic = horus.HapticFeedback(
    vibration_intensity=0.8,
    vibration_frequency=100.0,
    duration_seconds=0.05,
    pattern_type=0,
)
FieldTypeDefaultDescription
vibration_intensityfloat0.0Vibration intensity (0.0-1.0)
vibration_frequencyfloat0.0Vibration frequency (Hz)
duration_secondsfloat0.0Duration in seconds
pattern_typeint0Haptic pattern type
enabledboolFalseWhether haptic feedback is enabled
timestamp_nsint0Timestamp in nanoseconds

Static Methods:

MethodReturnsDescription
HapticFeedback.vibration(intensity, frequency, duration)HapticFeedbackCreate a vibration effect
HapticFeedback.force(force, duration)HapticFeedbackCreate a force feedback effect (force is a Vector3)
HapticFeedback.pulse(intensity, frequency, duration)HapticFeedbackCreate a pulsing vibration

TactileArray

Tactile sensor array (e.g., fingertip pressure grid).

# simplified
tactile = horus.TactileArray(rows=4, cols=4)
FieldTypeDefaultDescription
rowsint0Number of rows
colsint0Number of columns
forceslist[float]Raw force values (rows * cols elements)
total_forcelist[float]Total force vector (3 elements: x, y, z)
center_of_pressurelist[float]Center of pressure (2 elements: x, y)
in_contactboolWhether any cell is in contact
physical_sizelist[float]Physical dimensions (2 elements: width, height in meters)
timestamp_nsint0Timestamp in nanoseconds
MethodReturnsDescription
get_force(row, col)float or NoneGet force at a specific cell
set_force(row, col, force)NoneSet force at a specific cell

See Also