Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit > Class Template Reference

#include <smooth_pid.hpp>

Inheritance diagram for trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit >:

Public Types

using Config = tap::algorithms::SmoothPidConfig
 

Public Member Functions

 SmoothPid (const Config &config, ErrorType initialLastError=ErrorType{0.0})
 
ControlType runController (ErrorType error)
 
ControlType runController (const ErrorType &error, const TimeUnit &deltaTime)
 
ControlType runController (ErrorType error, double errorDerivative, TimeUnit deltaTime)
 

Detailed Description

template<typename ErrorType, typename ControlType, typename TimeUnit>
class trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit >

This will require the use of units::lenth::meters instead of units::length::meter_t The control unit is the unit that is used to change the system The error unit is the unit that the system takes as an input The time unit is unit for the passage of time

Member Typedef Documentation

◆ Config

template<typename ErrorType , typename ControlType , typename TimeUnit >
using trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit >::Config = tap::algorithms::SmoothPidConfig

Constructor & Destructor Documentation

◆ SmoothPid()

template<typename ErrorType , typename ControlType , typename TimeUnit >
trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit >::SmoothPid ( const Config config,
ErrorType  initialLastError = ErrorType{0.0} 
)
inline

Member Function Documentation

◆ runController() [1/3]

template<typename ErrorType , typename ControlType , typename TimeUnit >
ControlType trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit >::runController ( const ErrorType &  error,
const TimeUnit &  deltaTime 
)
inline

Manual delta time but with automatic derivative calculation

◆ runController() [2/3]

template<typename ErrorType , typename ControlType , typename TimeUnit >
ControlType trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit >::runController ( ErrorType  error)
inline

error - how much error This wrapper automatically calculates how much the error has changed and the amount of time which has passed between calls

◆ runController() [3/3]

template<typename ErrorType , typename ControlType , typename TimeUnit >
ControlType trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit >::runController ( ErrorType  error,
double  errorDerivative,
TimeUnit  deltaTime 
)
inline

Manually include delta time (this is for testing purposes but may bear use to future testers) For implementation purposes, the errorDerivative is stripped of any unit


The documentation for this class was generated from the following file: