Skip to content

limit_jerk question in speed_limiter #503

Description

@YuLin1226

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;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions