before test

Dependencies:   BEAR_Protocol_Edited BufferedSerial Debug MaxSonar PID Process QEI UI iSerial mbed

Fork of clean_V1 by Betago

Revision:
4:de5a65c17664
Parent:
2:f873deba2305
Child:
5:fe76f3dae81e
--- a/rplidar/RPlidar.cpp	Tue May 24 10:33:21 2016 +0000
+++ b/rplidar/RPlidar.cpp	Sun Jun 05 09:43:40 2016 +0000
@@ -269,6 +269,12 @@
               _currentMeasurement.angle = (node.angle_q6_checkbit >> RPLIDAR_RESP_MEASUREMENT_ANGLE_SHIFT)/64.0f;
               _currentMeasurement.quality = (node.sync_quality>>RPLIDAR_RESP_MEASUREMENT_QUALITY_SHIFT);
               _currentMeasurement.startBit = (node.sync_quality & RPLIDAR_RESP_MEASUREMENT_SYNCBIT);
+                ang = _currentMeasurement.angle;
+              dis = _currentMeasurement.distance;
+
+
+              if(ang>=angMin&&ang<=angMax)Data[ang] = dis;
+
               return RESULT_OK;
           }
 
@@ -279,7 +285,10 @@
 }
 
 
-
+void RPLidar::setAngle(int min,int max){
+  angMin = min;
+  angMax = max;
+}
 u_result RPLidar::_sendCommand(_u8 cmd, const void * payload, size_t payloadsize)
 {