FlightGear next
attitude_indicator.hxx
Go to the documentation of this file.
1/*
2 * SPDX-FileName: attitude_indicator.hxx
3 * SPDX-FileComment: a vacuum-powered attitude indicator.
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 * SPDX-FileContributor: Written by David Megginson, started 2002.
6 */
7
8#pragma once
9
10#include <simgear/props/props.hxx>
11#include <simgear/structure/subsystem_mgr.hxx>
12
13#include "gyro.hxx"
14
15
43class AttitudeIndicator : public SGSubsystem
44{
45public:
46 AttitudeIndicator ( SGPropertyNode *node );
47 virtual ~AttitudeIndicator ();
48
49 // Subsystem API.
50 void bind() override;
51 void init() override;
52 void reinit() override;
53 void unbind() override;
54 void update(double dt) override;
55
56 // Subsystem identification.
57 static const char* staticSubsystemClassId() { return "attitude-indicator"; }
58
59private:
60 std::string _name;
61 int _num;
62 std::string _suction;
63
64 Gyro _gyro;
65 double _gyro_spin_up, _gyro_spin_down;
66 double _minVacuum;
67 SGPropertyNode_ptr _minVacuum_node;
68
69 SGPropertyNode_ptr _tumble_flag_node;
70 SGPropertyNode_ptr _caged_node;
71 SGPropertyNode_ptr _tumble_node;
72 SGPropertyNode_ptr _pitch_in_node;
73 SGPropertyNode_ptr _roll_in_node;
74 SGPropertyNode_ptr _suction_node;
75 SGPropertyNode_ptr _pitch_int_node;
76 SGPropertyNode_ptr _roll_int_node;
77 SGPropertyNode_ptr _pitch_out_node;
78 SGPropertyNode_ptr _roll_out_node;
79 SGPropertyNode_ptr _spin_node, _gyro_spin_up_node, _gyro_spin_down_node;
80
81 double spin_thresh;
82 double max_roll_error;
83 double max_pitch_error;
84};
void update(double dt) override
static const char * staticSubsystemClassId()
AttitudeIndicator(SGPropertyNode *node)
Simple model of a spinning gyro.
Definition gyro.hxx:12