LRAUV  revA
AHRS_3DMGX3.h
Go to the documentation of this file.
1 
12 #ifndef AHRS_3DMGX3_H
13 #define AHRS_3DMGX3_H
14 
15 #include "component/FailureMode.h"
17 #include "io/LoadControl.h"
18 #include "io/UartStream.h"
19 #include "logger/Logger.h"
20 
23 
35 {
36 public:
37 
38  AHRS_3DMGX3( const Module* module );
39 
40  virtual ~AHRS_3DMGX3();
41 
42  virtual void run();
43 
46  virtual RunState start();
47 
49  virtual RunState starting();
50 
52  virtual RunState pause();
53 
55  virtual RunState paused();
56 
58  virtual RunState resume();
59 
61  virtual RunState resuming();
62 
64  virtual RunState runnable();
65 
67  virtual RunState resetting()
68  {
69  return stop();
70  }
71 
73  virtual RunState stop();
74 
75  virtual RunState stopping();
76 
78  virtual RunState stopped();
79 
80  void uninitialize();
81 
83  virtual ConfigURI getConfigURI( ConfigOption configOption ) const;
84 
85 private:
86  // Note that the copy constructor below is private and not given a body.
87  // Any attempt to call it will return a compiler error.
88  AHRS_3DMGX3( const AHRS_3DMGX3& old ); // disallow copy constructor
89 
90  // scen configuraiton settings
91  void readConfig();
92 
93  // Slate inputs
96 
97  // Slate outputs
104 
108 
112 
113  // returns true if data is requested from one of the readers
114  bool isDataRequested();
115 
116  // Debugging outputs
117  bool debug_;
118 
119  // Instance of load controller
121 
124 
125  // True if we have alerted user that we are using Simulator instead of hardware.
127 
133 
136  float rollOffset_;
137 
138  // Multipler for angular rate vectors
139  // Equals GyroGainScale from device (EEPROM address #130, nominally 8500) / 32768000
140  float gyroGain_;
141 
142  // Stores the current response from the modem
143  char deviceResponse_[96];
144 
145  // Holds the communications device
147 
148  // Current fault
150 
151  // Flips endian and converts 4 bytes to floating point
152  float extractFloat( char * convertFloat );
153 
154  FailureMode::FailType readTemperature( float &temperature );
155 
156  FailureMode::FailType readTransducers( float &roll, float &pitch, float &magHeading,
157  float &rollRate, float &pitchRate, float &yawRate );
158 
159 
160 };
161 
162 #endif /*AHRS_3DMGX3_H*/
LoadControl loadControl_
Definition: AHRS_3DMGX3.h:120
Contains the SyncComponent class definition.
Contains the LoadControl class declaration.
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: UniversalDataReader.h:26
virtual RunState runnable()
Should eventually follow a START request or RESETTING.
Definition: AHRS_3DMGX3.cpp:339
char deviceResponse_[96]
Definition: AHRS_3DMGX3.h:143
Abstract Base class for components that collect data for use later in the computation cycle...
Definition: SyncComponent.h:172
DataWriter * compassHeadingWriter_
Definition: AHRS_3DMGX3.h:98
ConfigReader * rollOffsetCfgReader_
Definition: AHRS_3DMGX3.h:111
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: UniversalDataWriter.h:24
virtual RunState pause()
Pause for a short period (indicated by pauseTime)
Definition: AHRS_3DMGX3.cpp:277
FailureMode::FailType fault_
Definition: AHRS_3DMGX3.h:149
void readConfig()
Definition: AHRS_3DMGX3.cpp:76
RunState
Definition: Component.h:115
Contains the UartStream class declaration.
void uninitialize()
Provide a space for uninitialization.
Definition: AHRS_3DMGX3.cpp:87
UniversalDataReader * longitudeReader_
Definition: AHRS_3DMGX3.h:95
virtual RunState start()
Do what needs to be done to run Similar to initialize, in old init/run/uninit sequence.
Definition: AHRS_3DMGX3.cpp:188
Timespan class, represents a delta of time.
Definition: Timestamp.h:248
bool usingSimWarned_
Definition: AHRS_3DMGX3.h:126
float gyroGain_
Definition: AHRS_3DMGX3.h:140
virtual RunState stopped()
Initial state – can be later followed by START.
Definition: AHRS_3DMGX3.cpp:478
Implements both InStream and OutStream for the LPC3XXX Standard UART.
Definition: UartStream.h:26
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
virtual RunState starting()
Might follow a STOP...START sequence.
Definition: AHRS_3DMGX3.cpp:226
Definition: ElementURI.h:166
float pitchOffset_
Offset for mounting. In degrees.
Definition: AHRS_3DMGX3.h:135
UniversalDataWriter * pitchWriter_
Definition: AHRS_3DMGX3.h:101
virtual RunState resuming()
Might follow a PAUSE...RESUME sequence.
Definition: AHRS_3DMGX3.cpp:332
virtual RunState stop()
Initial state – can be later followed by START.
Definition: AHRS_3DMGX3.cpp:452
FailType
Components can fail in a variety of ways.
Definition: FailureMode.h:19
UniversalDataReader * latitudeReader_
Definition: AHRS_3DMGX3.h:94
UniversalDataWriter * rollWriter_
Definition: AHRS_3DMGX3.h:102
Module is the abstract base class for a collection of Component objects that can be contained in a lo...
Definition: Module.h:45
float magVariation_
Definition: AHRS_3DMGX3.h:132
UniversalDataWriter * pitchRateWriter_
Definition: AHRS_3DMGX3.h:106
ConfigReader * magDeviationCfgReader_
Definition: AHRS_3DMGX3.h:109
ConfigReader * pitchOffsetCfgReader_
Definition: AHRS_3DMGX3.h:110
This class allows one to control loads on a load controller channel.
Definition: LoadControl.h:24
UniversalBlobWriter * rotationMatrixWriter_
Definition: AHRS_3DMGX3.h:103
Timespan ahrsTimeout_
Definition: AHRS_3DMGX3.h:122
FailureMode::FailType readTemperature(float &temperature)
Definition: AHRS_3DMGX3.cpp:118
Definition: UniversalDataWriter.h:55
Definition: ConfigReader.h:13
bool debug_
Definition: AHRS_3DMGX3.h:117
UniversalDataWriter * yawRateWriter_
Definition: AHRS_3DMGX3.h:107
Contains the Logger class definition.
float rollOffset_
Definition: AHRS_3DMGX3.h:136
Provides software interface to the Microstrain 3DMGX1 AHRS.
Definition: AHRS_3DMGX3.h:34
bool isDataRequested()
Definition: AHRS_3DMGX3.cpp:503
FailureMode::FailType readTransducers(float &roll, float &pitch, float &magHeading, float &rollRate, float &pitchRate, float &yawRate)
Definition: AHRS_3DMGX3.cpp:150
virtual ~AHRS_3DMGX3()
Definition: AHRS_3DMGX3.cpp:72
Timestamp startTime_
Definition: AHRS_3DMGX3.h:123
virtual RunState resetting()
Might occur in case of Error.
Definition: AHRS_3DMGX3.h:67
float magDeviation_
Deviation of this compass in the vehicle.
Definition: AHRS_3DMGX3.h:131
Contains the FailureMode class definition.
AHRS_3DMGX3(const Module *module)
Definition: AHRS_3DMGX3.cpp:33
UartStream uart_
Definition: AHRS_3DMGX3.h:146
virtual RunState resume()
Resume from PAUSE.
Definition: AHRS_3DMGX3.cpp:306
ConfigOption
Definition: Component.h:456
UniversalDataWriter * rollRateWriter_
Definition: AHRS_3DMGX3.h:105
UniversalDataWriter * trueHeadingWriter_
Definition: AHRS_3DMGX3.h:100
UniversalDataWriter * magneticHeadingWriter_
Definition: AHRS_3DMGX3.h:99
float extractFloat(char *convertFloat)
Definition: AHRS_3DMGX3.cpp:104
virtual RunState paused()
Should eventually follow a PAUSE request: should set continueTime.
Definition: AHRS_3DMGX3.cpp:295
Represents absolute times.
Definition: Timestamp.h:31
virtual RunState stopping()
Might follow a STOP request.
Definition: AHRS_3DMGX3.cpp:460
virtual void run()
The actual "payload" of the component.
Definition: AHRS_3DMGX3.cpp:83
virtual ConfigURI getConfigURI(ConfigOption configOption) const
Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc.
Definition: AHRS_3DMGX3.cpp:518