#include <mavSensors.h>
Public Member Functions | |
void | activelySend () |
Implement the messages actively sending function. | |
MavSensors (MavHandler &handler, std::string name, uint16_t gcsNum,...) | |
Constructor for Sensor Module. Recv buf size 1024. | |
void | passivelyReceive (mavlink_message_t &msg) |
Implement the messages passively handling function. | |
void | reactToSensors (uint16_t gcsIdx, mavlink_message_t &msg) |
React to sensor data from specific GCS and execute rsp. | |
bool | sendSensorsDataToAll () |
Send sensors data to all GCS. | |
bool | sendSensorsDataToGcs (uint16_t gcsIdx) |
Send sensors data to specific GCS. Compid is set to IMU. | |
void | setAttitudeQuaternion (const int32_t *ts, const float *q0, const float *q1, const float *q2, const float *q3, const float *wx, const float *wy, const float *wz) |
Update the velocity data. | |
void | setGlobalPosition (const int32_t *ts, const double *lat, const double *lon, const float *alt, const float *height) |
void | setLocalPosition (const int32_t *ts, const float *x, const float *y, const float *z) |
Update the local position data. | |
void | setSensorsHook (void(*func)()) |
Set the responser function pointer for the sensors. | |
void | setVelocity (const int32_t *ts, const float *vx, const float *vy, const float *vz) |
Update the velocity data. | |
~MavSensors () | |
Private Attributes | |
SensorAtt | m_att |
SensorGloPosInt | m_gloPos |
void(* | m_hook )() |
SensorLocPosNed | m_locPos |
mavlink_message_t | m_sendAttMsg |
mavlink_message_t | m_sendGloPosMsg |
mavlink_message_t | m_sendLocPosMsg |
Definition at line 26 of file mavSensors.h.
dji2mav::MavSensors::MavSensors | ( | MavHandler & | handler, |
std::string | name, | ||
uint16_t | gcsNum, | ||
... | |||
) | [inline] |
Constructor for Sensor Module. Recv buf size 1024.
handler | : The reference of MavHandler Object |
name | : The name of this module |
gcsNum | : The number of GCS that the module employs |
... | : The indexes of GCS list, should be uint16_t |
Definition at line 35 of file mavSensors.h.
dji2mav::MavSensors::~MavSensors | ( | ) | [inline] |
Definition at line 61 of file mavSensors.h.
void dji2mav::MavSensors::activelySend | ( | ) | [inline, virtual] |
Implement the messages actively sending function.
Implements dji2mav::MavModule.
Definition at line 244 of file mavSensors.h.
void dji2mav::MavSensors::passivelyReceive | ( | mavlink_message_t & | msg | ) | [inline, virtual] |
Implement the messages passively handling function.
msg | : The reference of received message |
Implements dji2mav::MavModule.
Definition at line 237 of file mavSensors.h.
void dji2mav::MavSensors::reactToSensors | ( | uint16_t | gcsIdx, |
mavlink_message_t & | msg | ||
) | [inline] |
React to sensor data from specific GCS and execute rsp.
gcsIdx | : Get the index of GCS |
msg | : Get the received message |
Definition at line 217 of file mavSensors.h.
bool dji2mav::MavSensors::sendSensorsDataToAll | ( | ) | [inline] |
Send sensors data to all GCS.
Definition at line 180 of file mavSensors.h.
bool dji2mav::MavSensors::sendSensorsDataToGcs | ( | uint16_t | gcsIdx | ) | [inline] |
Send sensors data to specific GCS. Compid is set to IMU.
gcsIdx | : The index of GCS |
Definition at line 144 of file mavSensors.h.
void dji2mav::MavSensors::setAttitudeQuaternion | ( | const int32_t * | ts, |
const float * | q0, | ||
const float * | q1, | ||
const float * | q2, | ||
const float * | q3, | ||
const float * | wx, | ||
const float * | wy, | ||
const float * | wz | ||
) | [inline] |
Update the velocity data.
ts | : Pointer of timestamp from boot |
vx | : Pointer of x axis velocity value |
vy | : Pointer of y axis velocity value |
vz | : Pointer of z axis velocity value |
Definition at line 110 of file mavSensors.h.
void dji2mav::MavSensors::setGlobalPosition | ( | const int32_t * | ts, |
const double * | lat, | ||
const double * | lon, | ||
const float * | alt, | ||
const float * | height | ||
) | [inline] |
Definition at line 127 of file mavSensors.h.
void dji2mav::MavSensors::setLocalPosition | ( | const int32_t * | ts, |
const float * | x, | ||
const float * | y, | ||
const float * | z | ||
) | [inline] |
Update the local position data.
ts | : Pointer of timestamp from boot |
x | : Pointer of local position x value |
y | : Pointer of local position y value |
z | : Pointer of local position z value |
Definition at line 74 of file mavSensors.h.
void dji2mav::MavSensors::setSensorsHook | ( | void(*)() | func | ) | [inline] |
Set the responser function pointer for the sensors.
The | function pointer that is to be set |
Definition at line 228 of file mavSensors.h.
void dji2mav::MavSensors::setVelocity | ( | const int32_t * | ts, |
const float * | vx, | ||
const float * | vy, | ||
const float * | vz | ||
) | [inline] |
Update the velocity data.
ts | : Pointer of timestamp from boot |
vx | : Pointer of x axis velocity value |
vy | : Pointer of y axis velocity value |
vz | : Pointer of z axis velocity value |
Definition at line 92 of file mavSensors.h.
SensorAtt dji2mav::MavSensors::m_att [private] |
Definition at line 256 of file mavSensors.h.
SensorGloPosInt dji2mav::MavSensors::m_gloPos [private] |
Definition at line 257 of file mavSensors.h.
void(* dji2mav::MavSensors::m_hook)() [private] |
Definition at line 259 of file mavSensors.h.
SensorLocPosNed dji2mav::MavSensors::m_locPos [private] |
Definition at line 255 of file mavSensors.h.
Definition at line 252 of file mavSensors.h.
Definition at line 253 of file mavSensors.h.
Definition at line 251 of file mavSensors.h.