LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::FilteredControllerInput< InputType, FilterType > Class Template Reference

A ControllerInput with a filter built in. More...

#include <filteredControllerInput.hpp>

Inheritance diagram for okapi::FilteredControllerInput< InputType, FilterType >:
okapi::ControllerInput< double >

Public Member Functions

 FilteredControllerInput (std::unique_ptr< ControllerInput< InputType > > iinput, std::unique_ptr< FilterType > ifilter)
 A filtered controller input.
 
double controllerGet () override
 Gets the sensor value for use in a control loop.
 

Protected Attributes

std::unique_ptr< ControllerInput< InputType > > input
 
std::unique_ptr< FilterType > filter
 

Detailed Description

template<typename InputType, typename FilterType>
class okapi::FilteredControllerInput< InputType, FilterType >

A ControllerInput with a filter built in.

Template Parameters
InputTypethe type of the ControllerInput
FilterTypethe type of the Filter

Definition at line 20 of file filteredControllerInput.hpp.

Constructor & Destructor Documentation

◆ FilteredControllerInput()

template<typename InputType , typename FilterType >
okapi::FilteredControllerInput< InputType, FilterType >::FilteredControllerInput ( std::unique_ptr< ControllerInput< InputType > >  iinput,
std::unique_ptr< FilterType >  ifilter 
)
inline

A filtered controller input.

Applies a filter to the controller input. Useful if you want to place a filter between a control input and a control loop.

Parameters
iinputControllerInput type
ifilterFilter type

Definition at line 29 of file filteredControllerInput.hpp.

Member Function Documentation

◆ controllerGet()

template<typename InputType , typename FilterType >
double okapi::FilteredControllerInput< InputType, FilterType >::controllerGet ( )
inlineoverridevirtual

Gets the sensor value for use in a control loop.

This method might be automatically called in another thread by the controller.

Returns
the current filtered sensor value.

Implements okapi::ControllerInput< double >.

Definition at line 40 of file filteredControllerInput.hpp.

Member Data Documentation

◆ filter

template<typename InputType , typename FilterType >
std::unique_ptr<FilterType> okapi::FilteredControllerInput< InputType, FilterType >::filter
protected

Definition at line 46 of file filteredControllerInput.hpp.

◆ input

template<typename InputType , typename FilterType >
std::unique_ptr<ControllerInput<InputType> > okapi::FilteredControllerInput< InputType, FilterType >::input
protected

Definition at line 45 of file filteredControllerInput.hpp.


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