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

limit_jerk question in speed_limiter #503

Open
YuLin1226 opened this issue Mar 28, 2022 · 0 comments
Open

limit_jerk question in speed_limiter #503

YuLin1226 opened this issue Mar 28, 2022 · 0 comments

Comments

@YuLin1226
Copy link

Hi,

I'm now reading the controller source code and trying to customize my controller.

In the speed_limiter.cpp, I have a question about the dt2, i don't get that why it is 2*dt*dt?

why is it not just dt*dt by applying finite-difference methods?

Thanks.

double SpeedLimiter::limit_jerk(double& v, double v0, double v1, double dt)
    {
        const double tmp = v;
        if (has_jerk_limits)
        {
            const double dv  = v  - v0;
            const double dv0 = v0 - v1;
            const double dt2 = 2. * dt * dt; // why 2?
            const double da_min = min_jerk * dt2;
            const double da_max = max_jerk * dt2;
            const double da = clamp(dv - dv0, da_min, da_max);
            v = v0 + dv0 + da;
        }
        return tmp != 0.0 ? v / tmp : 1.0;
    }
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

No branches or pull requests

1 participant