More RPLidarA1 support

This commit is contained in:
Dr. Simon Levy
2018-06-29 17:48:45 -04:00
parent a42b615807
commit ad5cf6da69
2 changed files with 11 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ MAP_SIZE_METERS = 10
LIDAR_DEVICE = '/dev/ttyUSB0'
from breezyslam.algorithms import RMHC_SLAM
#from breezyslam.sensors import XVLidar as LaserModel
from breezyslam.sensors import RPLidarA1 as LaserModel
from rplidar import RPLidar as Lidar
@@ -36,10 +36,10 @@ if __name__ == '__main__':
lidar = Lidar(LIDAR_DEVICE)
# Create an RMHC SLAM object with a laser model and optional robot model
#slam = RMHC_SLAM(LaserModel(), MAP_SIZE_PIXELS, MAP_SIZE_METERS)
slam = RMHC_SLAM(LaserModel(), MAP_SIZE_PIXELS, MAP_SIZE_METERS)
# Set up a SLAM display
#display = SlamShow(MAP_SIZE_PIXELS, MAP_SIZE_METERS*1000/MAP_SIZE_PIXELS, 'SLAM')
display = SlamShow(MAP_SIZE_PIXELS, MAP_SIZE_METERS*1000/MAP_SIZE_PIXELS, 'SLAM')
# Initialize an empty trajectory
trajectory = []

View File

@@ -58,4 +58,12 @@ class XVLidar(Laser):
Laser.__init__(self, 360, 5.5, 360, 6000, detectionMargin, offsetMillimeters)
class RPLidarA1(Laser):
'''
A class for the SLAMTEC RPLidar A1
'''
def __init__(self, detectionMargin = 0, offsetMillimeters = 0):
Laser.__init__(self, 360, 5.5, 360, 12000, detectionMargin, offsetMillimeters)