Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix jerk limiter in diff_drive_controller #1390

Conversation

tpoignonec
Copy link

There seem to be an error in the jerk limiter (speed_limiter.cpp#L117-L134) caused by the (as far as I can tell) incorrect factor 2 in the computation of the velocity limit resulting from jerk limits.

The consequence is an overshoot of the configured jerk limit.
To illustrate the effect of this factor, let us set the linear jerk limit as $J_{max} = 20 \text{ m.s}^{-3}$ such that

diffbot_base_controller:
  ros__parameters:
    type: diff_drive_controller/DiffDriveController
    ...

    # Velocity and acceleration limits
    # Whenever a min_* is unspecified, default to -max_*
    linear.x.has_velocity_limits: true
    linear.x.has_acceleration_limits: true
    linear.x.has_jerk_limits: true
    linear.x.max_velocity: 1.0
    linear.x.min_velocity: -1.0
    linear.x.max_acceleration: 2.0
    linear.x.min_acceleration: -5.0
    linear.x.max_jerk: 20.0
    linear.x.min_jerk: -20.0

    ...

Before this PR, the jerk reaches $40 \text{ m.s}^{-3}$:
diif_drive_current

After this PR:
diif_drive_new

@tpoignonec tpoignonec marked this pull request as ready for review November 25, 2024 15:45
@christophfroehlich
Copy link
Contributor

Thanks for reporting.

There is an ongoing process in moving this to control_toolbox
#1315
Could you please adding your PR there?

@tpoignonec tpoignonec closed this Nov 25, 2024
@tpoignonec
Copy link
Author

tpoignonec commented Nov 25, 2024

Was moved to control_toolbox (#240).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants