feat(controls): Smooth acceleration rate limiter (Issue #241) #246
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-controls/issue-241-smooth-accel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement rate-limiting for velocity commands to prevent jerky motion.
Features:
Algorithm
/cmd_vel(target velocity)/cmd_vel_smoothBenefits
✅ Prevents jerky motion from sudden jumps
✅ Protects mechanical systems from shock loads
✅ Enables smooth speed/direction changes
✅ Smooth tracking of dynamic targets (drones, moving objects)
Rate Limiting Examples
At 50Hz (20ms period):
Test Coverage
✅ 30+ unit tests:
Topics
/cmd_vel(geometry_msgs/Twist)/cmd_vel_smooth(geometry_msgs/Twist)Closes Issue #241.
Implement rate-limiting for velocity commands to prevent jerky motion. Applies independent acceleration/deceleration limits to linear and angular velocity. Features: - Smooth acceleration/deceleration rate limiting Default: 0.5 m/s² linear, 1.0 rad/s² angular (configurable) - Independent limits for each velocity component (x, y, z linear; x, y, z angular) - Calculates maximum change per control cycle: limit * dt - Clamps velocity changes to stay within acceleration envelope - 50Hz control frequency with configurable parameters Algorithm: - Subscribe to /cmd_vel (target velocity) - For each component: change = target - current - Clamp change: |change| ≤ accel_limit * period - Apply clamped change to current velocity - Publish smoothed /cmd_vel_smooth Benefits: - Prevents jerky motion from sudden velocity jumps - Protects mechanical systems from shock loads - Enables gradual speed/direction changes - Smooth tracking of dynamic targets Test Coverage: - 30+ unit tests covering: - Node initialization and parameter configuration - Individual component rate limiting (linear, angular) - Acceleration and deceleration scenarios - Multi-component simultaneous limiting - Reaching target velocity after multiple cycles - Emergency stops and rapid direction changes - Independent linear vs angular limits - Realistic scenarios: gradual acceleration, smooth stops, turns while moving, obstacle avoidance, continuous motion tracking, oscillating targets Topics: - Subscribed: /cmd_vel (geometry_msgs/Twist) - Published: /cmd_vel_smooth (geometry_msgs/Twist) Config: frequency=50Hz, linear_accel_limit=0.5 m/s², angular_accel_limit=1.0 rad/s² Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>