From 6616af3fcd2c4e6d358e0d2096bdcc64f650243d Mon Sep 17 00:00:00 2001
From: simondlevy Testing with the GetSurreal XV Lidar
-BreezySLAM now includes Python support for the inexpensive
+BreezySLAM includes Python support for the inexpensive
XV Lidar from GetSurreal.
To try it out, you'll also need the xvlidar
Python package. Once you've installed
both packages, you can run the xvslam.py example in the BreezySLAM/examples folder.
+Testing with the SLAMTEC RPLidar A1
+
+BreezySLAM also includes Python support for the inexpensive
+RPLidar A1 from SLAMTECH.
+To try it out, you'll also need the rplidar
+Python package, as well as the popular numpy and scipy packages. Once you've installed
+all packages, you can run the rpslam.py example in the BreezySLAM/examples folder.
+
diff --git a/examples/rpslam.py b/examples/rpslam.py index f1099ed..7524088 100755 --- a/examples/rpslam.py +++ b/examples/rpslam.py @@ -64,7 +64,7 @@ if __name__ == '__main__': # Interpolate to get 360 angles from 0 through 359, and corresponding distances f = interp1d(angles, distances, fill_value='extrapolate') - distances = list(f(np.arange(360))) + distances = list(f(np.arange(360))) # slam.update wants a list # Update SLAM with current Lidar scan, using third element of (quality, angle, distance) triples slam.update(distances) @@ -79,9 +79,10 @@ if __name__ == '__main__': display.setPose(x, y, theta) - # Exit on window close + # Break on window close if not display.refresh(): - exit(0) + break + # Shut down the lidar connection lidar.stop() lidar.disconnect()