sl-controls created pull request seb/saltylab-firmware#266

sl-controls
Mon, 02 Mar 2026 13:29:02 -0500

266#feat(controls): Wheel slip detector (Issue #262)#

Summary

Detect wheel slip by comparing commanded velocity vs actual wheel encoder velocity.

Features:

Compare /cmd_vel (commanded) vs /odom (actual velocity)

0.1 m/s threshold for slip detection

0.5s persistence to debounce transients

Publishes Bool on /saltybot/wheel_slip_detected

10Hz monitoring, fully configurable

Algorithm

1. Compute linear speed magnitude from x,y components

2. Calculate |commanded - actual| velocity difference

3. If exceeds threshold:

Increment slip duration counter

If duration > timeout: declare slip (True)

4. If below threshold:

Reset slip duration

Publish not detected (False)

Benefits

✅ Detects environmental slip (ice, mud, wet surfaces)
✅ Triggers speed reduction for loss of traction
✅ Prevents wheel spinning/rut creation
✅ Safety response for grip loss

Use Cases

Auto-detect slippery conditions

Trigger reduced speed mode

Safety fallback for wheeled robots

Environmental condition detection

Topics

Subscribed: /cmd_vel (Twist), /odom (Odometry)

Published: /saltybot/wheel_slip_detected (Bool)

Configuration

frequency: 10 Hz

slip_threshold: 0.1 m/s

slip_timeout: 0.5 s

Closes Issue #262.