Sylib
A C++ Library For V5
Loading...
Searching...
No Matches
sylib::TakeBackHalfController Class Reference

TBH Controller. More...

#include <math.hpp>

Public Member Functions

 TakeBackHalfController (double kH, std::shared_ptr< double > error)
 Creates an Take Back Half controller for a V5 motor. More...
 
double update ()
 Calculates controller output based on the current error value. More...
 
double getOutput () const
 Gets the current stored output value without calculating a new value. More...
 
double getkH () const
 Gets the kH constant. More...
 
double getTBH () const
 Gets the current stored TBH value. More...
 
void setkH (double gain)
 Sets the kH constant. More...
 
double getCurrentTime () const
 Gets the current time the controller is using. More...
 
double operator* () const
 Operator overload for getting the current filter ouput. More...
 

Detailed Description

TBH Controller.

Constructor & Destructor Documentation

◆ TakeBackHalfController()

sylib::TakeBackHalfController::TakeBackHalfController ( double  kH,
std::shared_ptr< double >  error 
)

Creates an Take Back Half controller for a V5 motor.

Parameters
kHTBH gain
errorA pointer to a double containing the error value to use for calculations

Member Function Documentation

◆ getCurrentTime()

double sylib::TakeBackHalfController::getCurrentTime ( ) const

Gets the current time the controller is using.

Returns
Time in milliseconds

◆ getkH()

double sylib::TakeBackHalfController::getkH ( ) const

Gets the kH constant.

Returns
kH value

◆ getOutput()

double sylib::TakeBackHalfController::getOutput ( ) const

Gets the current stored output value without calculating a new value.

Returns
Controller output

◆ getTBH()

double sylib::TakeBackHalfController::getTBH ( ) const

Gets the current stored TBH value.

Returns
TBH value

◆ operator*()

double sylib::TakeBackHalfController::operator* ( ) const

Operator overload for getting the current filter ouput.

Returns
Controller output

◆ setkH()

void sylib::TakeBackHalfController::setkH ( double  gain)

Sets the kH constant.

Parameters
gainTBH gain

◆ update()

double sylib::TakeBackHalfController::update ( )

Calculates controller output based on the current error value.

Returns
Controller output