From f8d0b85defe20a819fa3b630db82f10e117573d5 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Sat, 6 Dec 2025 14:48:08 -0500 Subject: [PATCH] added "methods" to header --- robot_controller/trapezoidal.h | 8 ++++++++ robot_controller/trapezoidal.ino | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/robot_controller/trapezoidal.h b/robot_controller/trapezoidal.h index 78dcaa8..a991f67 100644 --- a/robot_controller/trapezoidal.h +++ b/robot_controller/trapezoidal.h @@ -12,3 +12,11 @@ struct Setpoint { float position; // unitless bool complete; // the setpoint will no longer change }; + +// returns the position and velocity at the given time on a trapezoidal motion plan +// this could be baked if too computationally expensive +// not fully fuzzed +struct Setpoint trapezoidal_planner(struct Trapezoidal* trapezoidal, float time); + +// returns the time a given plan will take +float trapezoidal_time(struct Trapezoidal* trapezoidal); diff --git a/robot_controller/trapezoidal.ino b/robot_controller/trapezoidal.ino index e0ab6e5..9da6772 100644 --- a/robot_controller/trapezoidal.ino +++ b/robot_controller/trapezoidal.ino @@ -1,9 +1,6 @@ #include "trapezoidal.h" // trapezoidal impl, not fuzzed -// returns the position and velocity at the given time on a trapezoidal motion plan -// this could be baked if too computationally expensive -// not fully fuzzed struct Setpoint trapezoidal_planner(struct Trapezoidal* trapezoidal, float time) { float max_vel = trapezoidal->max_vel; float max_acc = trapezoidal->max_acc;