Skip to content
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

Break down when clcking the map #2

Open
TrayfourYu opened this issue Apr 21, 2021 · 2 comments
Open

Break down when clcking the map #2

TrayfourYu opened this issue Apr 21, 2021 · 2 comments

Comments

@TrayfourYu
Copy link

Hi,
I want to edit gmapping map and just cloned this project and run
python MapEditor.py map.pgm.
So, the UI came out, but it show the error below when I clicked the map.
Traceback (most recent call last): File "MapEditor.py", line 197, in mapClick self.im.putpixel((x,y), val) File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1507, in putpixel return self.im.putpixel(xy, value) TypeError: integer argument expected, got float

@TrayfourYu
Copy link
Author

When I switch to python3 and run, it shows that

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

I'm not familiar with QT, and can't get a solution from the web. So, how would I fix it?

@yinchuan
Copy link

@TrayfourYu TypeError: integer argument expected, got float can be fixed by adding int() to 3 lines of code in MapEditor.py.

L48 self.min_multiplier = int(math.ceil(view_width / self.map_width_cells))
L69 x = int(math.floor(x / self.pixels_per_cell))
L70 y = int(math.floor(y / self.pixels_per_cell))

The return value of math.ceil and math.floor was float in 2.7 while it's int in some later versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants