valgur / velodyne_decoder

Fully-featured C++/Python Velodyne packet decoder
BSD 3-Clause "New" or "Revised" License
39 stars 12 forks source link

RuntimeError: Unable to cast Python instance to C++ type (compile in debug mode for details) #1

Closed mickah closed 2 years ago

mickah commented 3 years ago

Environment:

Issue The default example in the README cause the following error:

    cloud_arrays.append(decoder.decode_message(scan_msg))
RuntimeError: Unable to cast Python instance to C++ type (compile in debug mode for details)

After installing the package in debug, I got

    cloud_arrays.append(decoder.decode_message(scan_msg))
RuntimeError: Unable to cast Python instance of type <type 'str'> to C++ type 'std::array<unsigned char, 1206ul>'

Workaround To make the demo work (without changing the package), I had to convert each packet's data from a str type to a bytearray type

for packet in scan_msg.packets:
  packet.data = bytearray(packet.data)

By the way, thanks for sharing this package! Very usefull :)

valgur commented 2 years ago

This is now fixed in v2.0.0. Thanks for the bug report and debugging!