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

#include <offsettableControllerInput.hpp>

Inheritance diagram for okapi::OffsetableControllerInput:
okapi::ControllerInput< double >

Public Member Functions

 OffsetableControllerInput (const std::shared_ptr< ControllerInput< double > > &iinput)
 A ControllerInput which can be tared to change the zero position.
 
virtual ~OffsetableControllerInput ()
 
double controllerGet () override
 Get the sensor value for use in a control loop.
 
virtual void tarePosition ()
 Sets the "absolute" zero position of this controller input to its current position.
 

Protected Attributes

std::shared_ptr< ControllerInput< double > > input
 
double offset {0}
 

Detailed Description

Definition at line 12 of file offsettableControllerInput.hpp.

Constructor & Destructor Documentation

◆ OffsetableControllerInput()

okapi::OffsetableControllerInput::OffsetableControllerInput ( const std::shared_ptr< ControllerInput< double > > &  iinput)
explicit

A ControllerInput which can be tared to change the zero position.

Parameters
iinputThe ControllerInput to reference.

◆ ~OffsetableControllerInput()

virtual okapi::OffsetableControllerInput::~OffsetableControllerInput ( )
virtual

Member Function Documentation

◆ controllerGet()

double okapi::OffsetableControllerInput::controllerGet ( )
overridevirtual

Get the sensor value for use in a control loop.

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

Returns
the current sensor value, or PROS_ERR on a failure.

Implements okapi::ControllerInput< double >.

◆ tarePosition()

virtual void okapi::OffsetableControllerInput::tarePosition ( )
virtual

Sets the "absolute" zero position of this controller input to its current position.

This does nothing if the underlying controller input returns PROS_ERR.

Member Data Documentation

◆ input

std::shared_ptr<ControllerInput<double> > okapi::OffsetableControllerInput::input
protected

Definition at line 38 of file offsettableControllerInput.hpp.

◆ offset

double okapi::OffsetableControllerInput::offset {0}
protected

Definition at line 39 of file offsettableControllerInput.hpp.


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