Crates.io | s_curve |
lib.rs | s_curve |
version | 0.1.7 |
source | src |
created_at | 2020-10-07 14:15:55.112714 |
updated_at | 2023-05-02 09:17:13.430049 |
description | Package to generate S-Curve trajectories for robotics and similar applications |
homepage | |
repository | https://github.com/marcbone/s_curve |
max_upload_size | |
id | 296977 |
size | 59,638 |
A library to compute S-Curve trajectories. It can be used to generate motion profiles for robotics.
An S-Curve is a trajectory which is constrained to maximum jerk, acceleration and velocity. An S-Curve consists of 7 phases:
In the picture below you can see an S-Curve Profile which goes from Position 0 to position 10 within 5.5 seconds with a start and end velocity of 0 , a maximum jerk of 3, a maximum acceleration of 2 and a maximum velocity of 3.
use s_curve::*;
let constraints = SCurveConstraints {
max_jerk: 3.,
max_acceleration: 2.0,
max_velocity: 3.};
let start_conditions = SCurveStartConditions {
q0: 0., // start position
q1: 10., // end position
v0: 0., // start velocity
v1: 0. // end velocity
};
let input = SCurveInput{constraints, start_conditions};
let (params,s_curve) = s_curve_generator( & input,Derivative::Velocity);
for i in 0..101 {
println!("{}", s_curve(i as f64 * params.time_intervals.total_duration() / 100.));
}
Copyright (c) 2020 Marco Boneberger Licensed under either of Apache License, Version 2.0 or MIT license at your option.