FlightGear next
FGXMLAutopilot::PIDController Class Reference

Roy Ovesen's PID controller. More...

#include <pidcontroller.hxx>

Inherits FGXMLAutopilot::AnalogComponent.

Public Member Functions

 PIDController ()
 
 ~PIDController ()
 
void update (bool firstTime, double dt) override
 pure virtual function to be implemented by the derived classes.
 
- Public Member Functions inherited from FGXMLAutopilot::AnalogComponent
const simgear::PeriodicalValue_ptr getPeriodicalValue () const
 
void collectDependentProperties (std::set< const SGPropertyNode * > &props) const
 Add to <props> all properties that are used by this component.
 
- Public Member Functions inherited from FGXMLAutopilot::Component
 Component ()
 A constructor for an empty Component.
 
virtual ~Component ()
 virtual destructor to clean up resources
 
void update (double dt) override
 
virtual bool configure (SGPropertyNode &prop_root, SGPropertyNode &cfg)
 configure this component from a property node.
 
bool isPropertyEnabled ()
 check if this component is enabled as configured in the <enable> section
 

Static Public Member Functions

static const char * staticSubsystemClassId ()
 

Protected Member Functions

virtual bool configure (SGPropertyNode &cfg_node, const std::string &cfg_name, SGPropertyNode &prop_root)
 This method configures this analog component from a property node.
 
- Protected Member Functions inherited from FGXMLAutopilot::AnalogComponent
 AnalogComponent ()
 A constructor for an analog component.
 
double clamp (double value) const
 clamp the given value if <min> and/or <max> inputs were given
 
void disabled (double dt) override
 overideable method being called from the update() method if this component is disabled.
 
double get_output_value () const
 return the current double value of the output property
 
void set_output_value (double value)
 

Additional Inherited Members

- Protected Attributes inherited from FGXMLAutopilot::AnalogComponent
simgear::ValueList _valueInput
 the value input
 
simgear::ValueList _referenceInput
 the reference input
 
simgear::ValueList _minInput
 the minimum output clamp input
 
simgear::ValueList _maxInput
 the maximum output clamp input
 
simgear::PeriodicalValue_ptr _periodical
 the configuration for periodical outputs
 
simgear::PropertyList _output_list
 
SGPropertyNode_ptr _passive_mode
 
- Protected Attributes inherited from FGXMLAutopilot::Component
bool _debug
 debug flag, true if this component should generate some useful output on every iteration
 
bool _honor_passive
 a (historic) flag signalling the derived class that it should compute it's internal state but shall not set the output properties if /autopilot/locks/passive-mode is true.
 

Detailed Description

Roy Ovesen's PID controller.

Definition at line 40 of file pidcontroller.hxx.

Constructor & Destructor Documentation

◆ PIDController()

PIDController::PIDController ( )

Definition at line 31 of file pidcontroller.cxx.

◆ ~PIDController()

FGXMLAutopilot::PIDController::~PIDController ( )
inline

Definition at line 84 of file pidcontroller.hxx.

Member Function Documentation

◆ configure()

bool PIDController::configure ( SGPropertyNode & cfg_node,
const std::string & cfg_name,
SGPropertyNode & prop_root )
protectedvirtual

This method configures this analog component from a property node.

Gets called multiple times from the base class configure method for every configuration node.

Parameters
cfg_nameName of the configuration node provided in cfg_node
cfg_nodeConfiguration node itself
prop_rootProperty root for all relative paths
Returns
true if the node was handled, false otherwise.

Reimplemented from FGXMLAutopilot::AnalogComponent.

Definition at line 239 of file pidcontroller.cxx.

◆ staticSubsystemClassId()

static const char * FGXMLAutopilot::PIDController::staticSubsystemClassId ( )
inlinestatic

Definition at line 87 of file pidcontroller.hxx.

◆ update()

void PIDController::update ( bool firstTime,
double dt )
overridevirtual

pure virtual function to be implemented by the derived classes.

Gets called from the update method if it's not disabled with the firstTime parameter set to true if this is the first call after being enabled

Parameters
firstTimeset to true if this is the first update call since this component has been enabled. Set to false for every subsequent call.
dtthe elapsed time since the last call

Implements FGXMLAutopilot::Component.

Definition at line 99 of file pidcontroller.cxx.


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