-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mapbytes makes no sense although lidar scan is very reasonable #72
Comments
Have you tried the sketch I already wrote for RPLidar A1? |
here are the prints after running python3 rpslam.py (rpslam.py:20166): Gdk-CRITICAL **: 21:57:03.273: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed |
I am ssh'ing from the terminal into the robot so display is unavailable. |
I got a scan plotted running the sketch in jupyter notebook. after replacing viz.display with matplotlib.pyplot - import matplotlib.pyplot as plt thanks :) |
Nice work, sorry for the trouble! |
no trouble. thanks again for this great repo and your timely support :) |
Hi, Do you have any idea to solve this? |
have you resolve this questions? |
hi,

I am getting a nice scan from my Slamtec RPLIDAR A1 (see image)
LIDAR_DEVICE = '/dev/ttyUSB0'
dists[:10] = [-0.0, -0.0, -0.0, -640.6713808877225, -616.3971794359838, -605.3760240984459, -588.6830172771465, -573.8061655912974, -584.4876481055396, -581.9273308674532]
angles[:10] = [-0.0, -0.0, -0.0, -109.72776180811681, -97.11084997755711, -89.79905036668178, -79.29883460350986, -69.50168580266731, -64.17311907687618, -59.87972603044943]
I am initializing objects as follows -
LaserModel = RPLidar
slam = RMHC_SLAM(LaserModel(), MAP_SIZE_PIXELS, MAP_SIZE_METERS, max_search_iter=5)
viz = MapVisualizer(MAP_SIZE_PIXELS, MAP_SIZE_METERS, 'SLAM')
mapbytes = bytearray(MAP_SIZE_PIXELS * MAP_SIZE_PIXELS)
running this simple loop to update my map -
for i in range(5):
time.sleep(0.1)
scan_dict = simple_express_scan(ret_points=NUM_POINTS)
dists ,angles = get_raw_data(scan_dict, ang_off=4)
time.sleep(0.1)
slam.update(dists, scan_angles_degrees=angles)
time.sleep(0.1)
x, y, theta = slam.getpos()
print(x, y, theta)
slam.getmap(mapbytes)
print(x, y, theta) always outputs: 5000.0 5000.0 0.0 even when I move my robot around (with the lidar on top)
this is the image I get -

any advice? what am I doing wrong?
The text was updated successfully, but these errors were encountered: