simondlevy / BreezySLAM

Simple, efficient, open-source package for Simultaneous Localization and Mapping
GNU Lesser General Public License v3.0
758 stars 251 forks source link

About setmap() function error #23

Closed lihp6207 closed 6 years ago

lihp6207 commented 6 years ago

Hi, Simon : I have the same issue with "https://github.com/simondlevy/BreezySLAM/issues/17". But when I use the function setmap(). ex: slam.setmap(mapbytes) The following error appeared:


File "/usr/local/lib/python2.7/dist-packages/breezyslam/algorithms.py", line 130, in setmap self.map.set(mapbytes) AttributeError: 'pybreezyslam.Map' object has no attribute 'set'

It seems cannot find pybreezyslam.Map.set(). Did I have a wrong usage? Thank you!

andrewda commented 6 years ago

Running into the same issue. Any updates?

simondlevy commented 6 years ago

Make sure you've downloaded the latest version of BreezySLAM and are running Python 3. I've stopped supporting Python 2.

andrewda commented 6 years ago

Ah gotcha, that'd be the problem. I was using Python 2.

On Wed, Jul 25, 2018, 2:04 PM Simon D. Levy notifications@github.com wrote:

Make sure you've downloaded the latest version of BreezySLAM and are running Python 3. I've stopped supporting Python 2.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/simondlevy/BreezySLAM/issues/23#issuecomment-407894993, or mute the thread https://github.com/notifications/unsubscribe-auth/AJuA7HrQ--BXhnFoC6VnhnKzROqj7q8Hks5uKN1VgaJpZM4TXkEm .

simondlevy commented 6 years ago

There could still be a problem -- if so, I'll be happy to look into it.

andrewda commented 6 years ago

Just got home and was able to test it with Python 3 -- seems the issue is still present, same error as before.

Traceback (most recent call last):
  File "logmovie.py", line 146, in <module>
    main()
  File "logmovie.py", line 123, in main
    slam.setmap(b)
  File "/usr/local/lib/python3.5/dist-packages/breezyslam/algorithms.py", line 128, in setmap
    self.map.set(mapbytes)
AttributeError: 'pybreezyslam.Map' object has no attribute 'set'
lihp6207 commented 6 years ago

Hi, simondlevy and andrewda! I have solved the problem not long ago by using slam.map.__init__ function instead of slam.setmap. EX:

    slam = breezyslam.algorithms.RMHC_SLAM(lidar, MAP_SIZE_PIXELS, MAP_SIZE_METERS)
    slam.map.__init__(MAP_SIZE_PIXELS, MAP_SIZE_METERS, mapbytes)

You can try it ! Thanks!

andrewda commented 6 years ago

Thank you, @lihp6207, slam.map.__init__() worked! Definitely still a plus to get the set() method working properly, but thanks again for the fix in the meantime!

lihp6207 commented 6 years ago

It's my pleasure! BTW, I am still using it in python2.7

simondlevy commented 6 years ago

Thanks for figuring this out, lihp6207! I've fixed slam.setmap() and tested it, but I'd appreciate it if you guys would give it a try and let me know if it's still not working.

andrewda commented 6 years ago

Works like a charm, appreciate it!