Developmental Flight Test Instrumentation
|
Serial driver to acquire data from a MAVLink-based autopilot. More...
#include <autopilot.hh>
Public Slots | |
void | readData (void) |
Slot to read in data over serial and parse complete packets. | |
![]() | |
virtual void | readData (void)=0 |
Slot to read in data over serial and parse complete packets. | |
Signals | |
void | measurementUpdate (APData data) |
Emitted to share new APData. | |
Public Member Functions | |
Autopilot (Settings *_settings, QObject *_parent=nullptr) | |
Constructor. More... | |
void | open (void) |
Opens the serial port. More... | |
void | requestStream (quint8 streamId, quint16 streamRate, quint8 enabled) |
Request a MAVLink message at a given rate. More... | |
void | getDataRate (quint16 msgId) |
Request current MAVLink message data rate. More... | |
void | setDataRate (quint8 msgId, float msgRate) |
Request a MAVLink message at a given rate. More... | |
![]() | |
SerialSensor (Settings *_settings, QObject *_parent=nullptr) | |
Constructor. More... | |
~SerialSensor () | |
Destructor. | |
void | configureSerial (QString _portName) |
Set the serial port parameters. More... | |
void | init () |
Initialize the serial port. | |
bool | isOpen (void) |
Returns true if the serial port is open. More... | |
void | setBaudRate (quint32 rate) |
Set the serial port baud rate. More... | |
void | threadStart (void) |
Start the sensor in a thread. | |
Additional Inherited Members | |
![]() | |
Settings * | settings = nullptr |
Settings object. | |
QString | portName {""} |
Serial port name. | |
QSerialPort::BaudRate | baudRate {QSerialPort::Baud115200} |
Serial port baud rate. | |
bool | _valid_serial = false |
Indicates if serial port passed validation. | |
QSerialPort * | _port = nullptr |
Serial port object. | |
Serial driver to acquire data from a MAVLink-based autopilot.
|
explicit |
Constructor.
_settings | Pointer to Settings object. |
_parent | Pointer to parent QObject. |
void dfti::Autopilot::getDataRate | ( | quint16 | msgId | ) |
Request current MAVLink message data rate.
msgId | The MAVLink message ID. |
|
virtual |
Opens the serial port.
Overrides the SerialSensor::open method to open the serial port as R/W.
Reimplemented from dfti::SerialSensor.
void dfti::Autopilot::requestStream | ( | quint8 | streamId, |
quint16 | streamRate, | ||
quint8 | enabled | ||
) |
Request a MAVLink message at a given rate.
streamId | The MAVLink stream ID. |
streamRate | Requested rate of the stream in Hz. |
enabled | Use 1 to enable the stream and 0 to disabled. |
void dfti::Autopilot::setDataRate | ( | quint8 | msgId, |
float | msgRate | ||
) |
Request a MAVLink message at a given rate.
msgId | The MAVLink message ID. |
msgRate | Requested rate of the message in microseconds. To disable output, use -1, and to reset to the default rate, use 0. |