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

TypeError in blensor.tof.scan_advanced #30

Open
aoikaneko opened this issue Jan 24, 2019 · 1 comment
Open

TypeError in blensor.tof.scan_advanced #30

aoikaneko opened this issue Jan 24, 2019 · 1 comment

Comments

@aoikaneko
Copy link

Issue description:

Hi, I get TypeError: unsupported operand type(s) for <<: 'tuple' and 'int' when I run blensor.tof.scan_advanced from script in Blensor 1.0.18 RC 10 Windows.
Here is a simple script producing the error:

import bpy
import blensor

camera = bpy.data.objects['Camera']

camera.select = True
blensor.tof.scan_advanced(camera, evd_file='cube.pcd')  # TypeError
camera.select = False

and I get:

Traceback (most recent call last):
  File "Blensor-1.0.18-Blender-2.79-Winx64\2.79\scripts\addons\blensor\evd.py", line 225, in writePCLFile
    self.write_point(pcl, pcl_noisy, INVALID_POINT, self.output_labels)
  File "Blensor-1.0.18-Blender-2.79-Winx64\2.79\scripts\addons\blensor\evd.py", line 190, in write_point
    color_uint32 = (e[12]<<16) | (e[13]<<8) | (e[14])
TypeError: unsupported operand type(s) for <<: 'tuple' and 'int'

Solution:

The following quick fix solved the issue:
modifying the line 42-44 in evd.py

INVALID_POINT = [0.0, 0.0, 0.0, float('NaN'), float('NaN'),
                 float('NaN'),float('NaN'),float('NaN'),float('NaN'),
                 float('NaN'),float('NaN'),-1,(0,0,0),-1]

to

INVALID_POINT = [0.0, 0.0, 0.0, float('NaN'), float('NaN'),
                 float('NaN'),float('NaN'),float('NaN'),float('NaN'),
                 float('NaN'),float('NaN'),-1,0,0,0,-1]

snapshot

Hope this helps!

@ErlerPhilipp
Copy link

Thank you aoikaneko. Your comment saved me a lot of time bugfixing. I hope, this will be fixed in the next release.

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