Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError > Class Template Reference

#include <modded_cascade_motor.hpp>

Inheritance diagram for fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >:
Collaboration diagram for fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >:

Public Types

using ControlledMotor = IOutputMotor< Output >
 
using ControlTelemetry = telemetry::ITelemetry< Control >
 
using IntermediateTelemetry = telemetry::ITelemetry< Intermediate >
 
using Pid = trap::algorithms::DualModdedPid< Control, Intermediate, Output, Time, MainError, IntermediateError >
 
using Config = Pid::Config
 
using MainModder = Pid::MainModder
 
using IntermediateModder = Pid::IntermediateModder
 

Public Member Functions

 ModdedCascadeMotor (const Config &config, std::unique_ptr< ControlledMotor > motor, std::unique_ptr< ControlTelemetry > controlTelemetry, std::unique_ptr< IntermediateTelemetry > intermediateTelemetry, std::unique_ptr< MainModder > mainModder=std::make_unique< trap::algorithms::NullPidModder< Intermediate > >(), std::unique_ptr< IntermediateModder > intermediateModder=std::make_unique< trap::algorithms::NullPidModder< Output > >())
 
void initialize () override
 
void update () override
 
void update (const Time &delta)
 
void setTarget (const Control &control)
 

Detailed Description

template<typename Output, typename Control, typename Intermediate, typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
class fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >

This functions exactly as DualCascadeMotor (taking an output motor and applying PID based on the telemetry it recieves)

This has an optional modders for the PID for feedForward.

For example, the output can be modded or the intermediate pid (target speed in most cases) can be given an additoinal speed target ahead of time

Template parameters: Output - the output motor it accepts Control - the type used for controlling and intermediate calculations of Pid Intermediate - the type used in between controlling and outputting (2nd pid)

Member Typedef Documentation

◆ Config

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
using fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::Config = Pid::Config

◆ ControlledMotor

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
using fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::ControlledMotor = IOutputMotor<Output>

◆ ControlTelemetry

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
using fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::ControlTelemetry = telemetry::ITelemetry<Control>

◆ IntermediateModder

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
using fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::IntermediateModder = Pid::IntermediateModder

◆ IntermediateTelemetry

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
using fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::IntermediateTelemetry = telemetry::ITelemetry<Intermediate>

◆ MainModder

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
using fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::MainModder = Pid::MainModder

◆ Pid

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
using fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::Pid = trap::algorithms::DualModdedPid < Control, Intermediate, Output, Time, MainError, IntermediateError >

Constructor & Destructor Documentation

◆ ModdedCascadeMotor()

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::ModdedCascadeMotor ( const Config config,
std::unique_ptr< ControlledMotor motor,
std::unique_ptr< ControlTelemetry controlTelemetry,
std::unique_ptr< IntermediateTelemetry intermediateTelemetry,
std::unique_ptr< MainModder mainModder = std::make_unique<trap::algorithms::NullPidModder<Intermediate>>(),
std::unique_ptr< IntermediateModder intermediateModder = std::make_unique<trap::algorithms::NullPidModder<Output>>() 
)
inline

Member Function Documentation

◆ initialize()

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
void fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::initialize ( )
inlineoverride

◆ setTarget()

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
void fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::setTarget ( const Control &  control)
inline

◆ update() [1/2]

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
void fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::update ( )
inlineoverride

◆ update() [2/2]

template<typename Output , typename Control , typename Intermediate , typename Time = Seconds, typename MainError = Control, typename IntermediateError = Intermediate>
void fang::motor::ModdedCascadeMotor< Output, Control, Intermediate, Time, MainError, IntermediateError >::update ( const Time &  delta)
inline

Back door function used for testing until we DI chrono based classes, too.


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