1#ifndef FANG_ROBOTICS_MCB_TRAP_ALGORITHMS_RAMP_HPP
2#define FANG_ROBOTICS_MCB_TRAP_ALGORITHMS_RAMP_HPP
12 template <
typename ValueUnit,
typename TimeUnit>
19 Ramp(ValueUnit initialValue,
double rampSpeed)
20 : m_ramp{static_cast<float>(initialValue)},
27 m_ramp.
setTarget(
static_cast<float>(target));
50 const double rawDeltaTime{
static_cast<double>(deltaTime)};
51 const double increment{m_speed * rawDeltaTime};
Definition simple_timer.hpp:12
Microseconds getDurationAndReset()
Definition simple_timer.cpp:20
void setTarget(float target)
Sets a new target ramp value.
Definition ramp.cpp:43
float getValue() const
Returns the current value being generated by the ramp.
Definition ramp.cpp:62
float getTarget() const
Returns the target value (where the ramp generator will head torwards).
Definition ramp.cpp:66
bool isTargetReached() const
Returns true if the value == target.
Definition ramp.cpp:64
void update(float increment)
Definition ramp.cpp:54
mockable ValueUnit getValue() const
Definition ramp.hpp:56
mockable bool isTargetReached() const
Definition ramp.hpp:61
mockable ValueUnit getTarget() const
Definition ramp.hpp:30
Ramp(ValueUnit initialValue, double rampSpeed)
Definition ramp.hpp:19
mockable void setTarget(ValueUnit target)
Definition ramp.hpp:25
mockable void update()
Definition ramp.hpp:47
mockable void setSpeed(double speed)
Definition ramp.hpp:42
Definition dimensional_smooth_pid.hpp:10
#define mockable
Wrap class functions that are not already virtual in this function if you wish to mock them.
Definition util_macros.hpp:38