Use meters instead of millimeters for PyRoboViz

This commit is contained in:
simondlevy
2019-01-03 18:20:12 -05:00
parent 2677ee3333
commit e2e6ce53a1
6 changed files with 16 additions and 14 deletions

View File

@@ -30,8 +30,6 @@ from xvlidar import XVLidar as Lidar
from roboviz import Visualizer
from sys import stdout
if __name__ == '__main__':
# Connect to Lidar unit
@@ -41,7 +39,7 @@ if __name__ == '__main__':
slam = RMHC_SLAM(LaserModel(), MAP_SIZE_PIXELS, MAP_SIZE_METERS)
# Set up a SLAM display
display = Visualizer(MAP_SIZE_PIXELS, MAP_SIZE_METERS*1000/MAP_SIZE_PIXELS, 'SLAM')
display = Visualizer(MAP_SIZE_PIXELS, MAP_SIZE_METERS, 'SLAM')
# Initialize an empty trajectory
trajectory = []
@@ -60,9 +58,11 @@ if __name__ == '__main__':
# Get current map bytes as grayscale
slam.getmap(mapbytes)
# Display map
display.displayMap(mapbytes)
display.setPose(x, y, theta)
# Display pose after converting from mm to meters
display.setPose(x/1000., y/1000., theta)
# Exit on window close
if not display.refresh():