RPLidar A1 example working

This commit is contained in:
simondlevy
2018-06-30 22:53:23 -04:00
parent 9408fb89e8
commit 6616af3fcd
2 changed files with 13 additions and 4 deletions

View File

@@ -114,12 +114,20 @@ try the <b>urgslam.py</b> example in the examples folder.
<p><h3>Testing with the GetSurreal XV Lidar</h3>
BreezySLAM now includes Python support for the inexpensive
BreezySLAM includes Python support for the inexpensive
<a href="https://www.getsurreal.com/product/xv-lidar-sensor-mount-package">XV Lidar</a> from GetSurreal.
To try it out, you'll also need the <a href="https://github.com/simondlevy/xvlidar">xvlidar</a>
Python package. Once you've installed
both packages, you can run the <b>xvslam.py</b> example in the <b>BreezySLAM/examples</b> folder.
<p><h3>Testing with the SLAMTEC RPLidar A1</h3>
BreezySLAM also includes Python support for the inexpensive
<a href="http://www.slamtec.com/en/lidar/a1">RPLidar A1</a> from SLAMTECH.
To try it out, you'll also need the <a href="https://github.com/SkoltechRobotics/rplidar">rplidar</a>
Python package, as well as the popular <b>numpy</b> and <b>scipy</b> packages. Once you've installed
all packages, you can run the <b>rpslam.py</b> example in the <b>BreezySLAM/examples</b> folder.
</p><h3>Installing for Matlab</h3>
<p>

View File

@@ -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()