RPLidar A1 example working
This commit is contained in:
10
README.md
10
README.md
@@ -114,12 +114,20 @@ try the <b>urgslam.py</b> example in the examples folder.
|
|||||||
|
|
||||||
<p><h3>Testing with the GetSurreal XV Lidar</h3>
|
<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.
|
<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>
|
To try it out, you'll also need the <a href="https://github.com/simondlevy/xvlidar">xvlidar</a>
|
||||||
Python package. Once you've installed
|
Python package. Once you've installed
|
||||||
both packages, you can run the <b>xvslam.py</b> example in the <b>BreezySLAM/examples</b> folder.
|
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><h3>Installing for Matlab</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# Interpolate to get 360 angles from 0 through 359, and corresponding distances
|
# Interpolate to get 360 angles from 0 through 359, and corresponding distances
|
||||||
f = interp1d(angles, distances, fill_value='extrapolate')
|
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
|
# Update SLAM with current Lidar scan, using third element of (quality, angle, distance) triples
|
||||||
slam.update(distances)
|
slam.update(distances)
|
||||||
@@ -79,9 +79,10 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
display.setPose(x, y, theta)
|
display.setPose(x, y, theta)
|
||||||
|
|
||||||
# Exit on window close
|
# Break on window close
|
||||||
if not display.refresh():
|
if not display.refresh():
|
||||||
exit(0)
|
break
|
||||||
|
|
||||||
|
# Shut down the lidar connection
|
||||||
lidar.stop()
|
lidar.stop()
|
||||||
lidar.disconnect()
|
lidar.disconnect()
|
||||||
|
|||||||
Reference in New Issue
Block a user