From f1c6ebc19fbd33cf78733f8f66a0eff25dfe56c4 Mon Sep 17 00:00:00 2001
From: lm <pixhawk@switched.com>
Date: Mon, 29 Nov 2010 12:20:54 +0100
Subject: [PATCH 1/3] Fixed mac header inclusion

---
 src/ui/map3D/Q3DWidget.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/ui/map3D/Q3DWidget.cc b/src/ui/map3D/Q3DWidget.cc
index 0e08d85..2130045 100644
--- a/src/ui/map3D/Q3DWidget.cc
+++ b/src/ui/map3D/Q3DWidget.cc
@@ -34,7 +34,9 @@ This file is part of the QGROUNDCONTROL project
 #include <osg/Geometry>
 #include <osg/LineWidth>
 #include <osg/MatrixTransform>
+#ifdef Q_OS_MACX
 #include <Carbon/Carbon.h>
+#endif
 
 Q3DWidget::Q3DWidget(QWidget* parent)
     : QGLWidget(parent)

From aef052a012dbda166b6edce9a0660ae1a52cc2eb Mon Sep 17 00:00:00 2001
From: pixhawk <mavteam@student.ethz.ch>
Date: Tue, 30 Nov 2010 12:27:57 +0100
Subject: [PATCH 2/3] corrected a compile warning in Wayppoint.cc, made
 adaptions to Freenect for the current revision of the code (update
 libfreenect repository!), commented out pixhawk poi mavlink code - needs
 fixing

---
 src/Waypoint.cc       |  6 +++---
 src/input/Freenect.cc | 12 +++++++++---
 src/input/Freenect.h  |  4 ++--
 src/uas/UAS.cc        | 32 ++++++++++++++++----------------
 4 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/src/Waypoint.cc b/src/Waypoint.cc
index d84b76e..7a1c295 100644
--- a/src/Waypoint.cc
+++ b/src/Waypoint.cc
@@ -40,12 +40,12 @@ Waypoint::Waypoint(quint16 _id, float _x, float _y, float _z, float _yaw, bool _
   y(_y),
   z(_z),
   yaw(_yaw),
+  frame(_frame),
+  action(_action),
   autocontinue(_autocontinue),
   current(_current),
   orbit(_orbit),
-  holdTime(_holdTime),
-  frame(_frame),
-  action(_action)
+  holdTime(_holdTime)
 {
 }
 
diff --git a/src/input/Freenect.cc b/src/input/Freenect.cc
index a60f094..defce4b 100644
--- a/src/input/Freenect.cc
+++ b/src/input/Freenect.cc
@@ -98,8 +98,14 @@ Freenect::process(void)
         return false;
     }
 
-    freenect_get_raw_accel(device, &ax, &ay, &az);
-    freenect_get_mks_accel(device, &dx, &dy, &dz);
+    //libfreenect changed some access functions in one of the new revisions
+    freenect_raw_device_state state;
+    freenect_get_mks_accel(state, &ax, &ay, &az);
+    //tiltAngle = freenect_get_tilt_degs(&state);
+
+    //these are the old access functions
+    //freenect_get_raw_accel(device, &ax, &ay, &az);
+    //freenect_get_mks_accel(device, &dx, &dy, &dz);
 
     return true;
 }
@@ -183,7 +189,7 @@ Freenect::rgbCallback(freenect_device* device, freenect_pixel* rgb, uint32_t tim
 }
 
 void
-Freenect::depthCallback(freenect_device* device, freenect_depth* depth, uint32_t timestamp)
+Freenect::depthCallback(freenect_device* device, void* depth, uint32_t timestamp)
 {
     Freenect* freenect = static_cast<Freenect *>(freenect_get_user(device));
     freenect_depth* data = reinterpret_cast<freenect_depth *>(depth);
diff --git a/src/input/Freenect.h b/src/input/Freenect.h
index e3e3925..1f5fd90 100644
--- a/src/input/Freenect.h
+++ b/src/input/Freenect.h
@@ -1,7 +1,7 @@
 #ifndef FREENECT_H
 #define FREENECT_H
 
-#include <libfreenect.h>
+#include <libfreenect/libfreenect.h>
 #include <QMutex>
 #include <QScopedPointer>
 #include <QSharedPointer>
@@ -26,7 +26,7 @@ public:
 
 private:
     static void rgbCallback(freenect_device* device, freenect_pixel* rgb, uint32_t timestamp);
-    static void depthCallback(freenect_device* device, freenect_depth* depth, uint32_t timestamp);
+    static void depthCallback(freenect_device* device, void* depth, uint32_t timestamp);
 
     freenect_context* context;
     freenect_device* device;
diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc
index 30ce495..3ca6c54 100644
--- a/src/uas/UAS.cc
+++ b/src/uas/UAS.cc
@@ -559,22 +559,22 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
                 emit textMessageReceived(uasId, message.compid, severity, text);
             }
             break;
-#ifdef MAVLINK_ENABLED_PIXHAWK
-            case MAVLINK_MSG_ID_POINT_OF_INTEREST:
-            {
-                mavlink_point_of_interest_t poi;
-                mavlink_msg_point_of_interest_decode(&message, &poi);
-                emit poiFound(this, poi.type, poi.color, QString((QChar*)poi.name, MAVLINK_MSG_POINT_OF_INTEREST_FIELD_NAME_LEN), poi.x, poi.y, poi.z);
-            }
-            break;
-            case MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION:
-            {
-                mavlink_point_of_interest_connection_t poi;
-                mavlink_msg_point_of_interest_connection_decode(&message, &poi);
-                emit poiConnectionFound(this, poi.type, poi.color, QString((QChar*)poi.name, MAVLINK_MSG_POINT_OF_INTEREST_CONNECTION_FIELD_NAME_LEN), poi.x1, poi.y1, poi.z1, poi.x2, poi.y2, poi.z2);
-            }
-            break;
-#endif
+//#ifdef MAVLINK_ENABLED_PIXHAWK
+//            case MAVLINK_MSG_ID_POINT_OF_INTEREST:
+//            {
+//                mavlink_point_of_interest_t poi;
+//                mavlink_msg_point_of_interest_decode(&message, &poi);
+//                emit poiFound(this, poi.type, poi.color, QString((QChar*)poi.name, MAVLINK_MSG_POINT_OF_INTEREST_FIELD_NAME_LEN), poi.x, poi.y, poi.z);
+//            }
+//            break;
+//            case MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION:
+//            {
+//                mavlink_point_of_interest_connection_t poi;
+//                mavlink_msg_point_of_interest_connection_decode(&message, &poi);
+//                emit poiConnectionFound(this, poi.type, poi.color, QString((QChar*)poi.name, MAVLINK_MSG_POINT_OF_INTEREST_CONNECTION_FIELD_NAME_LEN), poi.x1, poi.y1, poi.z1, poi.x2, poi.y2, poi.z2);
+//            }
+//            break;
+//#endif
 #ifdef MAVLINK_ENABLED_UALBERTA
         case MAVLINK_MSG_ID_NAV_FILTER_BIAS:
             {

From 2caee818447cea24001eaf16d3de0ce2144afbbc Mon Sep 17 00:00:00 2001
From: pixhawk <mavteam@student.ethz.ch>
Date: Tue, 30 Nov 2010 12:46:48 +0100
Subject: [PATCH 3/3] changed short int to double

---
 src/input/Freenect.cc | 2 +-
 src/input/Freenect.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/input/Freenect.cc b/src/input/Freenect.cc
index defce4b..f2e6ab0 100644
--- a/src/input/Freenect.cc
+++ b/src/input/Freenect.cc
@@ -100,7 +100,7 @@ Freenect::process(void)
 
     //libfreenect changed some access functions in one of the new revisions
     freenect_raw_device_state state;
-    freenect_get_mks_accel(state, &ax, &ay, &az);
+    freenect_get_mks_accel(&state, &ax, &ay, &az);
     //tiltAngle = freenect_get_tilt_degs(&state);
 
     //these are the old access functions
diff --git a/src/input/Freenect.h b/src/input/Freenect.h
index 1f5fd90..50fc6f9 100644
--- a/src/input/Freenect.h
+++ b/src/input/Freenect.h
@@ -60,7 +60,7 @@ private:
     QMutex coloredDepthMutex;
 
     // accelerometer data
-    short ax, ay, az;
+    double ax, ay, az;
     double dx, dy, dz;
 
     // gamma map