Skip to content
New issue

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

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

Already on GitHub? # to your account

Get Jerk at time t for a Piece of a Trajectory #8

Open
MasonJohnHawver42 opened this issue Apr 17, 2024 · 0 comments
Open

Get Jerk at time t for a Piece of a Trajectory #8

MasonJohnHawver42 opened this issue Apr 17, 2024 · 0 comments

Comments

@MasonJohnHawver42
Copy link

Is this how you would find the jerk at time t for a piece of a trajectory?

// Get the jerk at time t in this piece
inline Eigen::Vector3d getJerk(double t)
{
    // Normalize the time
    t /= duration;
    Eigen::Vector3d jerk(0.0, 0.0, 0.0);
    double tn = 1.0;
    int l = 1;
    int m = 2;
    int n = 3;
    for (int i = TrajOrder - 3; i >= 0; i--)
    {
        jerk += l * m * n * tn * normalizedCoeffMat().col(i);
        tn *= t;
        l++;
        m++;
        n++;
    }
    // Recover the actual jerk
    jerk /= (duration * duration * duration);
    return jerk;
}

This is for min snap but it could be applied to min jerk too. If this seems correct to you I'll happily send a pull request.

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

No branches or pull requests

1 participant