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(),
)
| Field | Type | Default | Description |
|---|
fx, fy, fz | float | 0.0 | Force components (N) |
tx, ty, tz | float | 0.0 | Torque components (Nm) |
timestamp_ns | int | 0 | Timestamp in nanoseconds |
Static Methods:
| Method | Returns | Description |
|---|
WrenchStamped.force_only(force) | WrenchStamped | Create from a Vector3 force (zero torque) |
WrenchStamped.torque_only(torque) | WrenchStamped | Create from a Vector3 torque (zero force) |
Methods:
| Method | Returns | Description |
|---|
force_magnitude() | float | L2 norm of force vector |
torque_magnitude() | float | L2 norm of torque vector |
exceeds_limits(max_force, max_torque) | bool | True if force or torque exceeds limits |
filter(prev, alpha) | None | Low-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(),
)
| Field | Type | Default | Description |
|---|
fx, fy, fz | float | 0.0 | Force components (N) |
tx, ty, tz | float | 0.0 | Torque components (Nm) |
timeout_seconds | float | 0.0 | Command timeout (seconds). Constructor param: timeout |
timestamp_ns | int | 0 | Timestamp in nanoseconds |
Static Methods:
| Method | Returns | Description |
|---|
ForceCommand.force_only(target) | ForceCommand | Create from a Vector3 target force |
ForceCommand.surface_contact(normal_force, normal) | ForceCommand | Create a surface contact command |
Methods:
| Method | Returns | Description |
|---|
with_timeout(seconds) | ForceCommand | Return a copy with timeout set |
Contact state information.
# simplified
contact = horus.ContactInfo(state=1, contact_force=2.5, confidence=0.9, timestamp_ns=horus.timestamp_ns())
| Field | Type | Default | Description |
|---|
state | int | 0 | Contact state code |
contact_force | float | 0.0 | Contact force magnitude (N) |
confidence | float | 0.0 | Detection confidence |
stiffness | float | 0.0 | Contact stiffness |
damping | float | 0.0 | Contact damping |
timestamp_ns | int | 0 | Timestamp in nanoseconds |
| Method | Returns | Description |
|---|
is_in_contact() | bool | True if currently in contact |
contact_duration_seconds() | float | Duration 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
| Getter | Type | Description |
|---|
stiffness | list[float] | Stiffness values per axis |
damping | list[float] | Damping values per axis |
inertia | list[float] | Inertia values per axis |
force_limits | list[float] | Force limits per axis |
enabled | bool | Whether impedance control is enabled |
timestamp_ns | int | Timestamp in nanoseconds |
Static Methods:
| Method | Returns | Description |
|---|
ImpedanceParameters.compliant() | ImpedanceParameters | Create compliant (soft) parameters |
ImpedanceParameters.stiff() | ImpedanceParameters | Create stiff (rigid) parameters |
Methods:
| Method | Returns | Description |
|---|
enable() | None | Enable impedance control |
disable() | None | Disable 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,
)
| Field | Type | Default | Description |
|---|
vibration_intensity | float | 0.0 | Vibration intensity (0.0-1.0) |
vibration_frequency | float | 0.0 | Vibration frequency (Hz) |
duration_seconds | float | 0.0 | Duration in seconds |
pattern_type | int | 0 | Haptic pattern type |
enabled | bool | False | Whether haptic feedback is enabled |
timestamp_ns | int | 0 | Timestamp in nanoseconds |
Static Methods:
| Method | Returns | Description |
|---|
HapticFeedback.vibration(intensity, frequency, duration) | HapticFeedback | Create a vibration effect |
HapticFeedback.force(force, duration) | HapticFeedback | Create a force feedback effect (force is a Vector3) |
HapticFeedback.pulse(intensity, frequency, duration) | HapticFeedback | Create a pulsing vibration |
TactileArray
Tactile sensor array (e.g., fingertip pressure grid).
# simplified
tactile = horus.TactileArray(rows=4, cols=4)
| Field | Type | Default | Description |
|---|
rows | int | 0 | Number of rows |
cols | int | 0 | Number of columns |
forces | list[float] | — | Raw force values (rows * cols elements) |
total_force | list[float] | — | Total force vector (3 elements: x, y, z) |
center_of_pressure | list[float] | — | Center of pressure (2 elements: x, y) |
in_contact | bool | — | Whether any cell is in contact |
physical_size | list[float] | — | Physical dimensions (2 elements: width, height in meters) |
timestamp_ns | int | 0 | Timestamp in nanoseconds |
| Method | Returns | Description |
|---|
get_force(row, col) | float or None | Get force at a specific cell |
set_force(row, col, force) | None | Set force at a specific cell |
See Also