Restored OpenCV version

This commit is contained in:
Matt Lubas
2016-08-15 15:11:09 -04:00
parent 25cb93d805
commit 58ee03f1c1
4 changed files with 142 additions and 11 deletions

View File

@@ -36,13 +36,14 @@ along with this code. If not, see <http://www.gnu.org/licenses/>.
# Map size, scale
MAP_SIZE_PIXELS = 800
MAP_SIZE_METERS = 32
MAP_SIZE_METERS = 32
from breezyslam.algorithms import Deterministic_SLAM, RMHC_SLAM
from mines import MinesLaser, Rover, load_data
from pltslamshow import SlamShow
from sys import argv, exit
from time import time
def main():
@@ -76,11 +77,12 @@ def main():
# Set up a SLAM display
display = SlamShow(MAP_SIZE_PIXELS, MAP_SIZE_METERS*1000/MAP_SIZE_PIXELS, 'SLAM')
start_time = time()
# Loop over scans
for scanno in range(nscans):
if use_odometry:
# Convert odometry to velocities
@@ -98,17 +100,20 @@ def main():
x_mm, y_mm, theta_degrees = slam.getpos()
# Get new map
slam.getmap(mapbytes)
#slam.getmap(mapbytes)
# Display map and robot pose
display.displayMap(mapbytes)
#display.displayMap(mapbytes)
display.setPose(x_mm, y_mm, theta_degrees)
#display.setPose(x_mm, y_mm, theta_degrees)
# Exit gracefully if user closes display
if not display.refresh():
exit(0)
curr_time = time()
print(curr_time - start_time)
start_time = curr_time
# XXX Add delay for real-time plot