GithubHelp home page GithubHelp logo

grotius-cnc / s-curve-motion-planning Goto Github PK

View Code? Open in Web Editor NEW
36.0 1.0 19.0 883 KB

constant jerk trajectory generator

Makefile 29.96% C++ 68.20% QMake 1.85%
scurve motion-planning path-planning velocity acceleration shared-library jerk trajectory velocity-profiles robot

s-curve-motion-planning's Introduction

S-curve-motion-planning.

grotius-cnc - s-curve-motion-planning stars - s-curve-motion-planning forks - s-curve-motion-planning

GitHub release License

The purpose of this material is to impart an understanding of polynomial transitions for a trajectory generator. The ideal constant jerk S-curve (jerk is the derivate of acceleration and a measure of impact) can be represented by a second-order polynomial in velocity (3rd in position). Its shape is governed by the motion conditions at the start and end of the transition.

An S-curve with an intermediate constant acceleration (lineair portion) is often used to reduce the time to make large speed changes. The jerk can be used to determine how much of the rise or fall period can be made under constant acceleration.

Implementation:

  • Velocity up s-curve [acc period].
  • Velocity down s-curve [dcc period].
  • Acceleration begin value.
  • Acceleration end value.
  • Velocity begin.
  • Velocity end.
  • Max acceleration.
  • Lineair stage.
  • Scientific papers included.

Functions:

    //! Inputs:
    //! at_time=request displacment at a certain time stamp.
    //! vs=velocity max.
    //! cs=curve displacement
    RESULT scurve_lineair(double at_time, double vs, double cs);

    //! Inputs:
    //! sct=scurve type [0=acc, 1=dcc]
    //! vo=velocity start
    //! vs=velocity max
    //! ve=velocity end
    //! am=acceleration max
    //! acs=acceleration start
    //! ace=acceleration end
    //! Results:
    //! at_time=request curve at [t]
    RESULT scurve_acc_dcc(int sct, double vo, double ve, double am, double acs, double ace, double at_time);

    //! Inputs:
    //! vs=velocity max.
    //! am=acceleration max.
    //! vo=velocity begin.
    //! acs=acceleration begin.
    //! ltot=pathlenght.
    //! ve=velocity end.
    //! ace=acceleration end.
    //! at_time=curve request at time [t]
    RESULT motion(double vs, double am, double vo, double acs, double ltot, double ve, double ace, double at_time);

Result:

    struct RESULT{
        //! Displacement result.
        double sr=0;
        //! Velocity result.
        double vr=0;
        //! Acceleration result.
        double ar=0;
        //! Curve time.
        double ct=0;
        //! Curve displacment.
        double cs=0;
        //! Error.
        bool error=0;
    };    

Build in Logic:

  • If maximum velocity can not be reached for a motion, curves are sampled to fit.
  • Debug information when input values are out of scope.
  • In the /gui_project is a simple path planner example.

Performance:

Time taken by function nanoseconds: ~1955 milliseconds: ~0.002

Graphics

~/gui_project/motion/

scurve_example2

To use the opencascade graphics along with the gui project, follow these instructions : https://github.com/grotius-cnc/oce/releases/tag/1.0.1

Summary

Constant jerk S-curves are used to transition robot moves. The S-curve is used to eliminate discontinuities in acceleration that are detrimental to robot performance.

License

Released under MIT by @grotius-cnc.

s-curve-motion-planning's People

Contributors

grotius-cnc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

s-curve-motion-planning's Issues

Motion planner for waypoints

Hello,

Very interesting and useful job!

Do you have a similar code for applying pn trajectory made of waypoints ?

I would like to use a motion controller for robots and compute robot dof values for each time step, and not having null speed at waypoints.

thank you!
Yvan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.