Browse Source

Cleaned up pattern recognition UI element

QGC4.4
pixhawk 15 years ago
parent
commit
ee0616c920
  1. BIN
      media/face2.png
  2. BIN
      media/face3.png
  3. BIN
      media/face4.png
  4. BIN
      media/face5.png
  5. BIN
      media/letterB.png
  6. BIN
      media/letterD.png
  7. BIN
      media/letterP.png
  8. BIN
      media/letterR.png
  9. BIN
      media/letterS.png
  10. BIN
      patterns/a.bmp
  11. BIN
      patterns/board-center.png
  12. BIN
      patterns/board-left.png
  13. BIN
      patterns/board-right.png
  14. BIN
      patterns/einstein.bmp
  15. 0
      patterns/face1.png
  16. BIN
      patterns/face1_fisheye.png
  17. BIN
      patterns/face1_light.png
  18. BIN
      patterns/face1_noise.png
  19. BIN
      patterns/face1_noise_fisheye.png
  20. BIN
      patterns/face1_noise_light.png
  21. BIN
      patterns/face1_noise_light_fisheye.png
  22. 0
      patterns/face2.png
  23. 0
      patterns/face3.png
  24. BIN
      patterns/face3_perspect1.png
  25. BIN
      patterns/face3_perspect2.png
  26. BIN
      patterns/face3_perspect3.png
  27. 0
      patterns/face4.png
  28. BIN
      patterns/face4_treshold1.png
  29. BIN
      patterns/face4_treshold2.png
  30. 0
      patterns/face5.png
  31. BIN
      patterns/face5_perspect1.png
  32. BIN
      patterns/face5_threshold.png
  33. BIN
      patterns/floors1.png
  34. BIN
      patterns/floors2.png
  35. BIN
      patterns/floors5.png
  36. BIN
      patterns/floors6.png
  37. BIN
      patterns/frame_2010-03-17_2_rect.bmp
  38. BIN
      patterns/frame_2010-03-17_3_rect.bmp
  39. BIN
      patterns/frog.bmp
  40. 0
      patterns/letterB.png
  41. 0
      patterns/letterD.png
  42. 0
      patterns/letterP.png
  43. BIN
      patterns/letterP_light.png
  44. BIN
      patterns/letterP_noise.png
  45. 0
      patterns/letterR.png
  46. BIN
      patterns/letterR_strongnoise.png
  47. 0
      patterns/letterS.png
  48. BIN
      patterns/santa-delft.png
  49. BIN
      patterns/stereo_left01.png
  50. BIN
      patterns/stereo_right01.png
  51. BIN
      patterns/white.png
  52. 12
      src/ui/ObjectDetectionView.cc
  53. 2
      src/ui/ObjectDetectionView.h
  54. 56
      test/generated/mavlink_message_attitude.h
  55. 89
      test/generated/mavlink_message_attitude2.h
  56. 32
      test/generated/mavlink_message_boot.h
  57. 46
      test/generated/mavlink_message_boot2.h
  58. 32
      test/generated/mavlink_message_heartbeat.h
  59. 46
      test/generated/mavlink_message_heartbeat2.h
  60. 164
      test/generated/mavlink_message_sensraw.h
  61. 200
      test/generated/mavlink_message_sensraw2.h
  62. 19
      test/mavlink.h
  63. 37
      test/mavlink.lcm
  64. 36
      test/mavlink.xml
  65. BIN
      test/media/face1.png

BIN
media/face2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

BIN
media/face3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

BIN
media/face4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

BIN
media/face5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

BIN
media/letterB.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

BIN
media/letterD.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

BIN
media/letterP.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

BIN
media/letterR.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

BIN
media/letterS.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
patterns/a.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

BIN
patterns/board-center.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 KiB

BIN
patterns/board-left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

BIN
patterns/board-right.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 KiB

BIN
patterns/einstein.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

0
media/face1.png → patterns/face1.png

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 184 KiB

BIN
patterns/face1_fisheye.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

BIN
patterns/face1_light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

BIN
patterns/face1_noise.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

BIN
patterns/face1_noise_fisheye.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

BIN
patterns/face1_noise_light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 KiB

BIN
patterns/face1_noise_light_fisheye.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

0
test/media/face2.png → patterns/face2.png

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 178 KiB

0
test/media/face3.png → patterns/face3.png

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 232 KiB

BIN
patterns/face3_perspect1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
patterns/face3_perspect2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

BIN
patterns/face3_perspect3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

0
test/media/face4.png → patterns/face4.png

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 280 KiB

BIN
patterns/face4_treshold1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
patterns/face4_treshold2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

0
test/media/face5.png → patterns/face5.png

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 278 KiB

BIN
patterns/face5_perspect1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

BIN
patterns/face5_threshold.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
patterns/floors1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 KiB

BIN
patterns/floors2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 KiB

BIN
patterns/floors5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 KiB

BIN
patterns/floors6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

BIN
patterns/frame_2010-03-17_2_rect.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

BIN
patterns/frame_2010-03-17_3_rect.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

BIN
patterns/frog.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

0
test/media/letterB.png → patterns/letterB.png

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

0
test/media/letterD.png → patterns/letterD.png

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

0
test/media/letterP.png → patterns/letterP.png

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
patterns/letterP_light.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
patterns/letterP_noise.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

0
test/media/letterR.png → patterns/letterR.png

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
patterns/letterR_strongnoise.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 KiB

0
test/media/letterS.png → patterns/letterS.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
patterns/santa-delft.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 KiB

BIN
patterns/stereo_left01.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
patterns/stereo_right01.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
patterns/white.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

12
src/ui/ObjectDetectionView.cc

@ -38,6 +38,8 @@ This file is part of the PIXHAWK project @@ -38,6 +38,8 @@ This file is part of the PIXHAWK project
#include <QDebug>
#include "MG.h"
ObjectDetectionView::ObjectDetectionView(QString folder, QWidget *parent) :
QWidget(parent),
patternList(),
@ -90,8 +92,9 @@ void ObjectDetectionView::newDetection(int uasId, QString patternPath, int x1, i @@ -90,8 +92,9 @@ void ObjectDetectionView::newDetection(int uasId, QString patternPath, int x1, i
{
if (patternList.contains(patternPath))
{
qDebug() << "REDETECTED";
//qDebug() << "REDETECTED";
/*
QList<QAction*> actions = m_ui->listWidget->actions();
// Find action and update it
foreach (QAction* act, actions)
@ -112,6 +115,7 @@ void ObjectDetectionView::newDetection(int uasId, QString patternPath, int x1, i @@ -112,6 +115,7 @@ void ObjectDetectionView::newDetection(int uasId, QString patternPath, int x1, i
// Set name and label
m_ui->nameLabel->setText(patternName);
*/
}
else
{
@ -120,7 +124,11 @@ void ObjectDetectionView::newDetection(int uasId, QString patternPath, int x1, i @@ -120,7 +124,11 @@ void ObjectDetectionView::newDetection(int uasId, QString patternPath, int x1, i
patternList.insert(patternPath, confidence);
patternCount.insert(patternPath, 1);
QPixmap image = QPixmap(patternFolder + "/" + patternPath);
QString filePath = MG::DIR::getSupportFilesDirectory() + "/" + patternFolder + "/" + patternPath.split("/").last();
qDebug() << "Loading:" << filePath;
QPixmap image = QPixmap(filePath);
QIcon ico(image);
QAction* act = new QAction(ico, patternPath + separator + "(#" + QString::number(1) + ")" + separator + QString::number(confidence), this);
connect(act, SIGNAL(triggered()), this, SLOT(takeAction()));

2
src/ui/ObjectDetectionView.h

@ -48,7 +48,7 @@ class ObjectDetectionView : public QWidget { @@ -48,7 +48,7 @@ class ObjectDetectionView : public QWidget {
Q_OBJECT
Q_DISABLE_COPY(ObjectDetectionView)
public:
explicit ObjectDetectionView(QString folder="test", QWidget *parent = 0);
explicit ObjectDetectionView(QString folder="patterns", QWidget *parent = 0);
virtual ~ObjectDetectionView();
/** @brief Resize widget contents */

56
test/generated/mavlink_message_attitude.h

@ -1,56 +0,0 @@ @@ -1,56 +0,0 @@
// MESSAGE ATTITUDE PACKING
#define MESSAGE_ID_ATTITUDE 90
/**
* @brief Send a attitude message
*
* @param roll Roll angle (rad)
* @param pitch Pitch angle (rad)
* @param yaw Yaw angle (rad)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t message_attitude_pack(uint8_t system_id, CommMessage_t* msg, float roll, float pitch, float yaw)
{
msg->msgid = MESSAGE_ID_ATTITUDE;
uint16_t i = 0;
i += put_float_by_index(roll, i, msg->payload); //Roll angle (rad)
i += put_float_by_index(pitch, i, msg->payload); //Pitch angle (rad)
i += put_float_by_index(yaw, i, msg->payload); //Yaw angle (rad)
return finalize_message(msg, system_id, i);
}
// MESSAGE ATTITUDE UNPACKING
/**
* @brief Get field roll from attitude message
*
* @return Roll angle (rad)
*/
static inline float message_attitude_get_roll(CommMessage_t* msg)
{
return *((float*) (void*)msg->payload);
}
/**
* @brief Get field pitch from attitude message
*
* @return Pitch angle (rad)
*/
static inline float message_attitude_get_pitch(CommMessage_t* msg)
{
return *((float*) (void*)msg->payload+sizeof(float));
}
/**
* @brief Get field yaw from attitude message
*
* @return Yaw angle (rad)
*/
static inline float message_attitude_get_yaw(CommMessage_t* msg)
{
return *((float*) (void*)msg->payload+sizeof(float)+sizeof(float));
}

89
test/generated/mavlink_message_attitude2.h

@ -1,89 +0,0 @@ @@ -1,89 +0,0 @@
// MESSAGE ATTITUDE2 PACKING
#define MESSAGE_ID_ATTITUDE2 90
typedef struct __attitude2_t
{
float roll; ///< Roll angle (rad)
float pitch; ///< Pitch angle (rad)
float yaw; ///< Yaw angle (rad)
} attitude2_t;
/**
* @brief Send a attitude2 message
*
* @param roll Roll angle (rad)
* @param pitch Pitch angle (rad)
* @param yaw Yaw angle (rad)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t message_attitude2_pack(uint8_t system_id, CommMessage_t* msg, float roll, float pitch, float yaw)
{
msg->msgid = MESSAGE_ID_ATTITUDE2;
uint16_t i = 0;
i += put_float_by_index(roll, i, msg->payload); //Roll angle (rad)
i += put_float_by_index(pitch, i, msg->payload); //Pitch angle (rad)
i += put_float_by_index(yaw, i, msg->payload); //Yaw angle (rad)
return finalize_message(msg, system_id, i);
}
static inline uint16_t message_attitude2_encode(uint8_t system_id, CommMessage_t* msg, const attitude2_t* attitude2)
{
message_attitude2_pack(system_id, msg, attitude2->roll, attitude2->pitch, attitude2->yaw);
}
// MESSAGE ATTITUDE2 UNPACKING
/**
* @brief Get field roll from attitude2 message
*
* @return Roll angle (rad)
*/
static inline float message_attitude2_get_roll(CommMessage_t* msg)
{
generic_32bit r;
r.b[3] = (msg->payload)[0];
r.b[2] = (msg->payload)[1];
r.b[1] = (msg->payload)[2];
r.b[0] = (msg->payload)[3];
return (float)r.f;
}
/**
* @brief Get field pitch from attitude2 message
*
* @return Pitch angle (rad)
*/
static inline float message_attitude2_get_pitch(CommMessage_t* msg)
{
generic_32bit r;
r.b[3] = (msg->payload+sizeof(float))[0];
r.b[2] = (msg->payload+sizeof(float))[1];
r.b[1] = (msg->payload+sizeof(float))[2];
r.b[0] = (msg->payload+sizeof(float))[3];
return (float)r.f;
}
/**
* @brief Get field yaw from attitude2 message
*
* @return Yaw angle (rad)
*/
static inline float message_attitude2_get_yaw(CommMessage_t* msg)
{
generic_32bit r;
r.b[3] = (msg->payload+sizeof(float)+sizeof(float))[0];
r.b[2] = (msg->payload+sizeof(float)+sizeof(float))[1];
r.b[1] = (msg->payload+sizeof(float)+sizeof(float))[2];
r.b[0] = (msg->payload+sizeof(float)+sizeof(float))[3];
return (float)r.f;
}
static inline void message_attitude2_decode(CommMessage_t* msg, attitude2_t* attitude2)
{
attitude2->roll = message_attitude2_get_roll(msg);
attitude2->pitch = message_attitude2_get_pitch(msg);
attitude2->yaw = message_attitude2_get_yaw(msg);
}

32
test/generated/mavlink_message_boot.h

@ -1,32 +0,0 @@ @@ -1,32 +0,0 @@
// MESSAGE BOOT PACKING
#define MESSAGE_ID_BOOT 1
/**
* @brief Send a boot message
*
* @param version The onboard software version
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t message_boot_pack(uint8_t system_id, CommMessage_t* msg, uint32 version)
{
msg->msgid = MESSAGE_ID_BOOT;
uint16_t i = 0;
i += put_uint32_by_index(version, i, msg->payload); //The onboard software version
return finalize_message(msg, system_id, i);
}
// MESSAGE BOOT UNPACKING
/**
* @brief Get field version from boot message
*
* @return The onboard software version
*/
static inline uint32 message_boot_get_version(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload);
}

46
test/generated/mavlink_message_boot2.h

@ -1,46 +0,0 @@ @@ -1,46 +0,0 @@
// MESSAGE BOOT2 PACKING
#define MESSAGE_ID_BOOT2 1
typedef struct __boot2_t
{
uint32 version; ///< The onboard software version
} boot2_t;
/**
* @brief Send a boot2 message
*
* @param version The onboard software version
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t message_boot2_pack(uint8_t system_id, CommMessage_t* msg, uint32 version)
{
msg->msgid = MESSAGE_ID_BOOT2;
uint16_t i = 0;
i += put_uint32_by_index(version, i, msg->payload); //The onboard software version
return finalize_message(msg, system_id, i);
}
static inline uint16_t message_boot2_encode(uint8_t system_id, CommMessage_t* msg, const boot2_t* boot2)
{
message_boot2_pack(system_id, msg, boot2->version);
}
// MESSAGE BOOT2 UNPACKING
/**
* @brief Get field version from boot2 message
*
* @return The onboard software version
*/
static inline uint32 message_boot2_get_version(CommMessage_t* msg)
{
}
static inline void message_boot2_decode(CommMessage_t* msg, boot2_t* boot2)
{
boot2->version = message_boot2_get_version(msg);
}

32
test/generated/mavlink_message_heartbeat.h

@ -1,32 +0,0 @@ @@ -1,32 +0,0 @@
// MESSAGE HEARTBEAT PACKING
#define MESSAGE_ID_HEARTBEAT 0
/**
* @brief Send a heartbeat message
*
* @param type Type of the MAV (quadrotor, helicopter, etc.)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t message_heartbeat_pack(uint8_t system_id, CommMessage_t* msg, uint8 type)
{
msg->msgid = MESSAGE_ID_HEARTBEAT;
uint16_t i = 0;
i += put_uint8_by_index(type, i, msg->payload); //Type of the MAV (quadrotor, helicopter, etc.)
return finalize_message(msg, system_id, i);
}
// MESSAGE HEARTBEAT UNPACKING
/**
* @brief Get field type from heartbeat message
*
* @return Type of the MAV (quadrotor, helicopter, etc.)
*/
static inline uint8 message_heartbeat_get_type(CommMessage_t* msg)
{
return *((uint8*) (void*)msg->payload);
}

46
test/generated/mavlink_message_heartbeat2.h

@ -1,46 +0,0 @@ @@ -1,46 +0,0 @@
// MESSAGE HEARTBEAT2 PACKING
#define MESSAGE_ID_HEARTBEAT2 0
typedef struct __heartbeat2_t
{
uint8 type; ///< Type of the MAV (quadrotor, helicopter, etc.)
} heartbeat2_t;
/**
* @brief Send a heartbeat2 message
*
* @param type Type of the MAV (quadrotor, helicopter, etc.)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t message_heartbeat2_pack(uint8_t system_id, CommMessage_t* msg, uint8 type)
{
msg->msgid = MESSAGE_ID_HEARTBEAT2;
uint16_t i = 0;
i += put_uint8_by_index(type, i, msg->payload); //Type of the MAV (quadrotor, helicopter, etc.)
return finalize_message(msg, system_id, i);
}
static inline uint16_t message_heartbeat2_encode(uint8_t system_id, CommMessage_t* msg, const heartbeat2_t* heartbeat2)
{
message_heartbeat2_pack(system_id, msg, heartbeat2->type);
}
// MESSAGE HEARTBEAT2 UNPACKING
/**
* @brief Get field type from heartbeat2 message
*
* @return Type of the MAV (quadrotor, helicopter, etc.)
*/
static inline uint8 message_heartbeat2_get_type(CommMessage_t* msg)
{
}
static inline void message_heartbeat2_decode(CommMessage_t* msg, heartbeat2_t* heartbeat2)
{
heartbeat2->type = message_heartbeat2_get_type(msg);
}

164
test/generated/mavlink_message_sensraw.h

@ -1,164 +0,0 @@ @@ -1,164 +0,0 @@
// MESSAGE SENSRAW PACKING
#define MESSAGE_ID_SENSRAW 100
/**
* @brief Send a sensraw message
*
* @param xacc X acceleration (mg raw)
* @param yacc Y acceleration (mg raw)
* @param zacc Z acceleration (mg raw)
* @param xgyro Angular speed around X axis (adc units)
* @param ygyro Angular speed around Y axis (adc units)
* @param zgyro Angular speed around Z axis (adc units)
* @param xmag
* @param ymag
* @param zmag
* @param baro
* @param gdist
* @param temp
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t message_sensraw_pack(uint8_t system_id, CommMessage_t* msg, uint32 xacc, uint32 yacc, uint32 zacc, uint32 xgyro, uint32 ygyro, uint32 zgyro, uint32 xmag, uint32 ymag, uint32 zmag, int32 baro, uint32 gdist, int32 temp)
{
msg->msgid = MESSAGE_ID_SENSRAW;
uint16_t i = 0;
i += put_uint32_by_index(xacc, i, msg->payload); //X acceleration (mg raw)
i += put_uint32_by_index(yacc, i, msg->payload); //Y acceleration (mg raw)
i += put_uint32_by_index(zacc, i, msg->payload); //Z acceleration (mg raw)
i += put_uint32_by_index(xgyro, i, msg->payload); //Angular speed around X axis (adc units)
i += put_uint32_by_index(ygyro, i, msg->payload); //Angular speed around Y axis (adc units)
i += put_uint32_by_index(zgyro, i, msg->payload); //Angular speed around Z axis (adc units)
i += put_uint32_by_index(xmag, i, msg->payload); //
i += put_uint32_by_index(ymag, i, msg->payload); //
i += put_uint32_by_index(zmag, i, msg->payload); //
i += put_int32_by_index(baro, i, msg->payload); //
i += put_uint32_by_index(gdist, i, msg->payload); //
i += put_int32_by_index(temp, i, msg->payload); //
return finalize_message(msg, system_id, i);
}
// MESSAGE SENSRAW UNPACKING
/**
* @brief Get field xacc from sensraw message
*
* @return X acceleration (mg raw)
*/
static inline uint32 message_sensraw_get_xacc(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload);
}
/**
* @brief Get field yacc from sensraw message
*
* @return Y acceleration (mg raw)
*/
static inline uint32 message_sensraw_get_yacc(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload+sizeof(uint32));
}
/**
* @brief Get field zacc from sensraw message
*
* @return Z acceleration (mg raw)
*/
static inline uint32 message_sensraw_get_zacc(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32));
}
/**
* @brief Get field xgyro from sensraw message
*
* @return Angular speed around X axis (adc units)
*/
static inline uint32 message_sensraw_get_xgyro(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32));
}
/**
* @brief Get field ygyro from sensraw message
*
* @return Angular speed around Y axis (adc units)
*/
static inline uint32 message_sensraw_get_ygyro(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32));
}
/**
* @brief Get field zgyro from sensraw message
*
* @return Angular speed around Z axis (adc units)
*/
static inline uint32 message_sensraw_get_zgyro(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32));
}
/**
* @brief Get field xmag from sensraw message
*
* @return
*/
static inline uint32 message_sensraw_get_xmag(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32));
}
/**
* @brief Get field ymag from sensraw message
*
* @return
*/
static inline uint32 message_sensraw_get_ymag(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32));
}
/**
* @brief Get field zmag from sensraw message
*
* @return
*/
static inline uint32 message_sensraw_get_zmag(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32));
}
/**
* @brief Get field baro from sensraw message
*
* @return
*/
static inline int32 message_sensraw_get_baro(CommMessage_t* msg)
{
return *((int32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32));
}
/**
* @brief Get field gdist from sensraw message
*
* @return
*/
static inline uint32 message_sensraw_get_gdist(CommMessage_t* msg)
{
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(int32));
}
/**
* @brief Get field temp from sensraw message
*
* @return
*/
static inline int32 message_sensraw_get_temp(CommMessage_t* msg)
{
return *((int32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(int32)+sizeof(uint32));
}

200
test/generated/mavlink_message_sensraw2.h

@ -1,200 +0,0 @@ @@ -1,200 +0,0 @@
// MESSAGE SENSRAW2 PACKING
#define MESSAGE_ID_SENSRAW2 100
typedef struct __sensraw2_t
{
uint32 xacc; ///< X acceleration (mg raw)
uint32 yacc; ///< Y acceleration (mg raw)
uint32 zacc; ///< Z acceleration (mg raw)
uint32 xgyro; ///< Angular speed around X axis (adc units)
uint32 ygyro; ///< Angular speed around Y axis (adc units)
uint32 zgyro; ///< Angular speed around Z axis (adc units)
uint32 xmag; ///<
uint32 ymag; ///<
uint32 zmag; ///<
int32 baro; ///<
uint32 gdist; ///<
int32 temp; ///<
} sensraw2_t;
/**
* @brief Send a sensraw2 message
*
* @param xacc X acceleration (mg raw)
* @param yacc Y acceleration (mg raw)
* @param zacc Z acceleration (mg raw)
* @param xgyro Angular speed around X axis (adc units)
* @param ygyro Angular speed around Y axis (adc units)
* @param zgyro Angular speed around Z axis (adc units)
* @param xmag
* @param ymag
* @param zmag
* @param baro
* @param gdist
* @param temp
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t message_sensraw2_pack(uint8_t system_id, CommMessage_t* msg, uint32 xacc, uint32 yacc, uint32 zacc, uint32 xgyro, uint32 ygyro, uint32 zgyro, uint32 xmag, uint32 ymag, uint32 zmag, int32 baro, uint32 gdist, int32 temp)
{
msg->msgid = MESSAGE_ID_SENSRAW2;
uint16_t i = 0;
i += put_uint32_by_index(xacc, i, msg->payload); //X acceleration (mg raw)
i += put_uint32_by_index(yacc, i, msg->payload); //Y acceleration (mg raw)
i += put_uint32_by_index(zacc, i, msg->payload); //Z acceleration (mg raw)
i += put_uint32_by_index(xgyro, i, msg->payload); //Angular speed around X axis (adc units)
i += put_uint32_by_index(ygyro, i, msg->payload); //Angular speed around Y axis (adc units)
i += put_uint32_by_index(zgyro, i, msg->payload); //Angular speed around Z axis (adc units)
i += put_uint32_by_index(xmag, i, msg->payload); //
i += put_uint32_by_index(ymag, i, msg->payload); //
i += put_uint32_by_index(zmag, i, msg->payload); //
i += put_int32_by_index(baro, i, msg->payload); //
i += put_uint32_by_index(gdist, i, msg->payload); //
i += put_int32_by_index(temp, i, msg->payload); //
return finalize_message(msg, system_id, i);
}
static inline uint16_t message_sensraw2_encode(uint8_t system_id, CommMessage_t* msg, const sensraw2_t* sensraw2)
{
message_sensraw2_pack(system_id, msg, sensraw2->xacc, sensraw2->yacc, sensraw2->zacc, sensraw2->xgyro, sensraw2->ygyro, sensraw2->zgyro, sensraw2->xmag, sensraw2->ymag, sensraw2->zmag, sensraw2->baro, sensraw2->gdist, sensraw2->temp);
}
// MESSAGE SENSRAW2 UNPACKING
/**
* @brief Get field xacc from sensraw2 message
*
* @return X acceleration (mg raw)
*/
static inline uint32 message_sensraw2_get_xacc(CommMessage_t* msg)
{
}
/**
* @brief Get field yacc from sensraw2 message
*
* @return Y acceleration (mg raw)
*/
static inline uint32 message_sensraw2_get_yacc(CommMessage_t* msg)
{
}
/**
* @brief Get field zacc from sensraw2 message
*
* @return Z acceleration (mg raw)
*/
static inline uint32 message_sensraw2_get_zacc(CommMessage_t* msg)
{
}
/**
* @brief Get field xgyro from sensraw2 message
*
* @return Angular speed around X axis (adc units)
*/
static inline uint32 message_sensraw2_get_xgyro(CommMessage_t* msg)
{
}
/**
* @brief Get field ygyro from sensraw2 message
*
* @return Angular speed around Y axis (adc units)
*/
static inline uint32 message_sensraw2_get_ygyro(CommMessage_t* msg)
{
}
/**
* @brief Get field zgyro from sensraw2 message
*
* @return Angular speed around Z axis (adc units)
*/
static inline uint32 message_sensraw2_get_zgyro(CommMessage_t* msg)
{
}
/**
* @brief Get field xmag from sensraw2 message
*
* @return
*/
static inline uint32 message_sensraw2_get_xmag(CommMessage_t* msg)
{
}
/**
* @brief Get field ymag from sensraw2 message
*
* @return
*/
static inline uint32 message_sensraw2_get_ymag(CommMessage_t* msg)
{
}
/**
* @brief Get field zmag from sensraw2 message
*
* @return
*/
static inline uint32 message_sensraw2_get_zmag(CommMessage_t* msg)
{
}
/**
* @brief Get field baro from sensraw2 message
*
* @return
*/
static inline int32 message_sensraw2_get_baro(CommMessage_t* msg)
{
}
/**
* @brief Get field gdist from sensraw2 message
*
* @return
*/
static inline uint32 message_sensraw2_get_gdist(CommMessage_t* msg)
{
}
/**
* @brief Get field temp from sensraw2 message
*
* @return
*/
static inline int32 message_sensraw2_get_temp(CommMessage_t* msg)
{
}
static inline void message_sensraw2_decode(CommMessage_t* msg, sensraw2_t* sensraw2)
{
sensraw2->xacc = message_sensraw2_get_xacc(msg);
sensraw2->yacc = message_sensraw2_get_yacc(msg);
sensraw2->zacc = message_sensraw2_get_zacc(msg);
sensraw2->xgyro = message_sensraw2_get_xgyro(msg);
sensraw2->ygyro = message_sensraw2_get_ygyro(msg);
sensraw2->zgyro = message_sensraw2_get_zgyro(msg);
sensraw2->xmag = message_sensraw2_get_xmag(msg);
sensraw2->ymag = message_sensraw2_get_ymag(msg);
sensraw2->zmag = message_sensraw2_get_zmag(msg);
sensraw2->baro = message_sensraw2_get_baro(msg);
sensraw2->gdist = message_sensraw2_get_gdist(msg);
sensraw2->temp = message_sensraw2_get_temp(msg);
}

19
test/mavlink.h

@ -1,19 +0,0 @@ @@ -1,19 +0,0 @@
/** @file
* @brief MAVLink comm protocol.
* @see http://pixhawk.ethz.ch/software/mavlink
* Generated on Sonntag, März 21 2010, 14:05 UTC
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#include "protocol.h"
// TO BE REMOVED:
#include "generated/messages.h"
#include "generated/mavlink_message_heartbeat2.h"
#include "generated/mavlink_message_boot2.h"
#include "generated/mavlink_message_sensraw2.h"
#include "generated/mavlink_message_attitude2.h"
#endif

37
test/mavlink.lcm

@ -1,37 +0,0 @@ @@ -1,37 +0,0 @@
typedef struct __heartbeat2_t
{
uint8 type; ///< Type of the MAV (quadrotor, helicopter, etc.)
} heartbeat2_t;
typedef struct __boot2_t
{
uint32 version; ///< The onboard software version
} boot2_t;
typedef struct __sensraw2_t
{
uint32 xacc; ///< X acceleration (mg raw)
uint32 yacc; ///< Y acceleration (mg raw)
uint32 zacc; ///< Z acceleration (mg raw)
uint32 xgyro; ///< Angular speed around X axis (adc units)
uint32 ygyro; ///< Angular speed around Y axis (adc units)
uint32 zgyro; ///< Angular speed around Z axis (adc units)
uint32 xmag; ///<
uint32 ymag; ///<
uint32 zmag; ///<
int32 baro; ///<
uint32 gdist; ///<
int32 temp; ///<
} sensraw2_t;
typedef struct __attitude2_t
{
float roll; ///< Roll angle (rad)
float pitch; ///< Pitch angle (rad)
float yaw; ///< Yaw angle (rad)
} attitude2_t;

36
test/mavlink.xml

@ -1,36 +0,0 @@ @@ -1,36 +0,0 @@
<?xml version="1.0"?>
<messages>
<message name="HEARTBEAT" id="0">
<field name="type" type="uint8">Type of the MAV (quadrotor, helicopter, etc.)</field>
</message>
<message name="BOOT" id="1">
<field name="version" type="uint32">The onboard software version</field>
</message>
<message name="RAW_SENSOR" id="100">
<field name="xacc" type="uint32">X acceleration (mg raw)</field>
<field name="yacc" type="uint32">Y acceleration (mg raw)</field>
<field name="zacc" type="uint32">Z acceleration (mg raw)</field>
<field name="xgyro" type="uint32">Angular speed around X axis (adc units)</field>
<field name="ygyro" type="uint32">Angular speed around Y axis (adc units)</field>
<field name="zgyro" type="uint32">Angular speed around Z axis (adc units)</field>
<field name="xmag" type="uint32">X Magnetic field (milli tesla)</field>
<field name="ymag" type="uint32">Y Magnetic field (milli tesla)</field>
<field name="zmag" type="uint32">Z Magnetic field (milli tesla)</field>
<field name="baro" type="int32">Barometric pressure (hecto Pascal)</field>
<field name="gdist" type="uint32">Ground distance (meters)</field>
<field name="temp" type="int32">Temperature (degrees celcius)</field>
</message>
<message name="ATTITUDE" id="90">
<field name="roll" type="float">Roll angle (rad)</field>
<field name="pitch" type="float">Pitch angle (rad)</field>
<field name="yaw" type="float">Yaw angle (rad)</field>
<field name="rollspeed" type="float">Roll angular speed (rad/s)</field>
<field name="pitchspeed" type="float">Pitch angular speed (rad/s)</field>
<field name="yawspeed" type="float">Yaw angular speed (rad/s)</field>
</message>
</messages>

BIN
test/media/face1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 KiB

Loading…
Cancel
Save