Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
control::PIDController< dim > Class Template Reference

A PID controller for multiple independent dimensions. More...

#include <PIDControl.h>

Public Types

template<int d>
using Arrayd = Eigen::Array<double, d, 1>
 

Public Member Functions

 PIDController (const std::array< PIDGains, dim > &gains)
 Construct a new PIDController.
 
void setGains (const std::array< PIDGains, dim > &gains)
 Set the gains of the PID controller.
 
bool hasTarget ()
 Check if a target is currently set.
 
void setTarget (const Arrayd< dim > &setPoint)
 Set the target of the controller.
 
Arrayd< dim > getOutput (robot::types::datatime_t currTime, const Arrayd< dim > &currValue)
 Get the output from the controller.
 
void reset ()
 Reset the controller.
 

Detailed Description

template<int dim>
class control::PIDController< dim >

A PID controller for multiple independent dimensions.

Template Parameters
dimThe number of dimensions to control.
See also
https://en.wikipedia.org/wiki/PID_controller

Constructor & Destructor Documentation

◆ PIDController()

template<int dim>
control::PIDController< dim >::PIDController ( const std::array< PIDGains, dim > & gains)
inline

Construct a new PIDController.

Parameters
gainsThe gains to use for the controller.

Member Function Documentation

◆ getOutput()

template<int dim>
Arrayd< dim > control::PIDController< dim >::getOutput ( robot::types::datatime_t currTime,
const Arrayd< dim > & currValue )
inline

Get the output from the controller.

Parameters
currTimeThe current timestamp.
currValueThe current values of the controlled signals.
Returns
Arrayd<dim> Targets for each dimension if target is set, else zeros.

◆ hasTarget()

template<int dim>
bool control::PIDController< dim >::hasTarget ( )
inline

Check if a target is currently set.

Returns
bool True iff the controller currently has a target.

◆ setGains()

template<int dim>
void control::PIDController< dim >::setGains ( const std::array< PIDGains, dim > & gains)
inline

Set the gains of the PID controller.

Parameters
gainsThe new gains to set.

◆ setTarget()

template<int dim>
void control::PIDController< dim >::setTarget ( const Arrayd< dim > & setPoint)
inline

Set the target of the controller.

Parameters
setPointAn array of setpoints, one for each dimension.

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