diff --git a/README.md b/README.md index 3453bf1..59d1689 100644 --- a/README.md +++ b/README.md @@ -114,12 +114,20 @@ try the urgslam.py example in the 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()