Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
fang::turret::TiltPidModder< Output > Class Template Reference

#include <tilt_pid_modder.hpp>

Inheritance diagram for fang::turret::TiltPidModder< Output >:
Collaboration diagram for fang::turret::TiltPidModder< Output >:

Classes

struct  Config
 

Public Member Functions

 TiltPidModder (std::unique_ptr< telemetry::IAngularPosition > fieldPitchSensor, const Config &config)
 
Output getModdedOutput (const Output &output) override
 
- Public Member Functions inherited from trap::algorithms::IPidModder< Output >
virtual ~IPidModder ()=default
 

Detailed Description

template<typename Output>
class fang::turret::TiltPidModder< Output >

This assumes the head is somewhat balanced.

sine is zero

If the robot's head is tilted backwards, it needs a forward force if the robot's head is tilted forwards, it needs a backwards force

If you do the math it's related to trigonometry

Output needs to be an arithmetic type

WARNING: This assumes that zero is level (no compensation needed)

Constructor & Destructor Documentation

◆ TiltPidModder()

template<typename Output >
fang::turret::TiltPidModder< Output >::TiltPidModder ( std::unique_ptr< telemetry::IAngularPosition fieldPitchSensor,
const Config config 
)
inline

This needs to provide the angular position relative to gravity.

fieldPitchSensor should be zero when the turret head or balanced object is level.

Tilted down should be a negative angle (if need be, the scalingConstant)

Member Function Documentation

◆ getModdedOutput()

template<typename Output >
Output fang::turret::TiltPidModder< Output >::getModdedOutput ( const Output &  output)
inlineoverridevirtual

Note that this strips the unit protection of the fieldPitchSensor. The scaling constant is coupled to the raw value.

Implements trap::algorithms::IPidModder< Output >.


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