Library containing Crazyflie 2.0 sensors drivers: - LPS25H (barometer) - MPU9250 (IMU) - PMW3901 (optical flow) - VL53L0X (range)

Dependents:   Drones-Controlador controladoatitude_cteste Drone_Controlador_Atitude optical_test

Files at this revision

API Documentation at this revision

Comitter:
fbob
Date:
Wed Oct 17 13:26:29 2018 +0000
Parent:
14:e4d638ac83af
Commit message:
Changed range and optical flow parameters names

Changed in this revision

PMW3901/PMW3901.cpp Show annotated file Show diff for this revision Revisions of this file
PMW3901/PMW3901.h Show annotated file Show diff for this revision Revisions of this file
VL53L0X/VL53L0X.cpp Show annotated file Show diff for this revision Revisions of this file
VL53L0X/VL53L0X.h Show annotated file Show diff for this revision Revisions of this file
--- a/PMW3901/PMW3901.cpp	Thu Sep 27 17:57:28 2018 +0000
+++ b/PMW3901/PMW3901.cpp	Wed Oct 17 13:26:29 2018 +0000
@@ -176,11 +176,11 @@
     spi.write(DELTA_Y_H & 0b01111111); data[3] = spi.write(0x00); 
 
     // Reassemble the data (two 8 bit data into one 16 bit data)
-    int16_t x_raw = (data[1] << 8 ) | data[0];
-    int16_t y_raw = (data[3] << 8 ) | data[2];
+    int16_t px_raw = (data[1] << 8 ) | data[0];
+    int16_t py_raw = (data[3] << 8 ) | data[2];
     // Convert to SI units [px]
-    x = -y_raw * 1.0f;
-    y = -x_raw * 1.0f; 
+    px = -py_raw * 1.0f;
+    py = -px_raw * 1.0f; 
     
     // Deselect the device by seting chip select high
     cs = 1;   
--- a/PMW3901/PMW3901.h	Thu Sep 27 17:57:28 2018 +0000
+++ b/PMW3901/PMW3901.h	Wed Oct 17 13:26:29 2018 +0000
@@ -49,9 +49,9 @@
         void read();
         
         /** Optical flow data in x-axis (px) **/
-        float x;
+        float px;
         /** Optical flow data in y-axis (px) **/
-        float y;
+        float py;
     private:
         /** SPI bus */
         SPI spi;
--- a/VL53L0X/VL53L0X.cpp	Thu Sep 27 17:57:28 2018 +0000
+++ b/VL53L0X/VL53L0X.cpp	Wed Oct 17 13:26:29 2018 +0000
@@ -1041,6 +1041,6 @@
 
 void VL53L0X::read()
 {
-    z = readRangeContinuousMillimeters()/1000.0f;    
+    d = readRangeContinuousMillimeters()/1000.0f;    
 }
 
--- a/VL53L0X/VL53L0X.h	Thu Sep 27 17:57:28 2018 +0000
+++ b/VL53L0X/VL53L0X.h	Wed Oct 17 13:26:29 2018 +0000
@@ -153,7 +153,7 @@
     void read();
         
     /** Range data [m] */
-    float z;
+    float d;
 
   private:
     // TCC: Target CentreCheck