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

#include <modded_pid.hpp>

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

Public Types

using IModder = IPidModder< ControlType >
 
using BasePid = SmoothPid< ErrorType, ControlType, TimeUnit >
 
using Config = BasePid::Config
 
- Public Types inherited from trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit >
using Config = tap::algorithms::SmoothPidConfig
 

Public Member Functions

 ModdedPid (const Config &config, std::unique_ptr< IModder > modder=std::make_unique< NullPidModder< ControlType > >(), ErrorType initialLastError=ErrorType{0.0})
 
ControlType runController (ErrorType error)
 
ControlType runController (const ErrorType &error, const TimeUnit &deltaTime)
 
- Public Member Functions inherited from trap::algorithms::SmoothPid< ErrorType, ControlType, TimeUnit >
 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::ModdedPid< ErrorType, ControlType, TimeUnit >

This will require the use of units::lenth::meters instead of units::length::meter_t This allows different feedfoward "modders" to change the pid output in a bundle

Member Typedef Documentation

◆ BasePid

template<typename ErrorType , typename ControlType , typename TimeUnit >
using trap::algorithms::ModdedPid< ErrorType, ControlType, TimeUnit >::BasePid = SmoothPid<ErrorType, ControlType, TimeUnit>

◆ Config

template<typename ErrorType , typename ControlType , typename TimeUnit >
using trap::algorithms::ModdedPid< ErrorType, ControlType, TimeUnit >::Config = BasePid::Config

◆ IModder

template<typename ErrorType , typename ControlType , typename TimeUnit >
using trap::algorithms::ModdedPid< ErrorType, ControlType, TimeUnit >::IModder = IPidModder<ControlType>

Constructor & Destructor Documentation

◆ ModdedPid()

template<typename ErrorType , typename ControlType , typename TimeUnit >
trap::algorithms::ModdedPid< ErrorType, ControlType, TimeUnit >::ModdedPid ( const Config config,
std::unique_ptr< IModder modder = std::make_unique<NullPidModder<ControlType>>(),
ErrorType  initialLastError = ErrorType{0.0} 
)
inline

Member Function Documentation

◆ runController() [1/2]

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

Manual delta time but with automatic derivative calculation

◆ runController() [2/2]

template<typename ErrorType , typename ControlType , typename TimeUnit >
ControlType trap::algorithms::ModdedPid< 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


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