31 #ifndef TRAJECTORY_TRACKER_BASIC_CONTROL_H 32 #define TRAJECTORY_TRACKER_BASIC_CONTROL_H 40 return -std::copysign(1.0, angle) * std::sqrt(std::abs(2 * angle * acc));
43 inline float clip(
const float v,
const float max)
73 const float v,
const float vel,
const float acc,
const float dt)
75 return set(val_prev_ + v, vel, acc, dt);
78 float v,
const float vel,
const float acc,
const float dt)
82 if (v > val_prev_ + dt * acc)
83 v = val_prev_ + dt * acc;
84 else if (v < val_prev_ - dt * acc)
85 v = val_prev_ - dt * acc;
87 if (!std::isfinite(v))
93 inline float get()
const 104 #endif // TRAJECTORY_TRACKER_BASIC_CONTROL_H
float increment(const float v, const float vel, const float acc, const float dt)
float angleNormalized(float ang)
float timeOptimalControl(const float angle, const float acc)
float clip(const float v, const float max)