kekeblom / StrayVisualizer

Visualize Data From Stray Scanner https://keke.dev/blog/2021/03/10/Stray-Scanner.html
MIT License
70 stars 13 forks source link

ValueError: Expected `quat` to have shape (4,) or (N x 4), got (2,). #13

Closed daekyounglee closed 2 years ago

daekyounglee commented 2 years ago

Hi, I had a problem when I ran the code "python stray_visualize.py --point-clouds".

When I run the code with example datasets "ZB2", I got an error:

Traceback (most recent call last): File "/home/user/Desktop/new1/sv5/stray_visualize.py", line 206, in main() File "/home/user/Desktop/new1/sv5/stray_visualize.py", line 190, in main data = read_data(flags) File "/home/user/Desktop/new1/sv5/stray_visualize.py", line 53, in read_data T_WC[:3, :3] = Rotation.from_quat(quaternion).as_matrix() File "rotation.pyx", line 624, in scipy.spatial.transform.rotation.Rotation.from_quat File "rotation.pyx", line 513, in scipy.spatial.transform.rotation.Rotation.init ValueError: Expected quat to have shape (4,) or (N x 4), got (2,).

I have no idea why this error occurred. Thank you for reading my issues, hope you reply.

kekeblom commented 2 years ago

Would you mind sharing the scene you used as input? Did you run it as python stray_visualize.py <scene_directory> --point-clouds. I just ran tried the latest code with the latest version of the app and it seems to be working.

Would you mind sharing your scene and I could take a closer look?

daekyounglee commented 2 years ago

I understood the word "scene" as "dataset". Is it right? If so, um.... I didn't use my own dataset. I used your second example dataset (file name: ZB2) as input which you uploaded. If you want, I could share the dataset, but there will be no differences from the file you uploaded before. And yes, I ran it as " python stray_visualize.py --point-clouds " .

I wonder if I did something wrong in the process. At first, I downloaded datasets and Installed dependencies. Next, I created a video from the Depth Maps by "python make_video.py " . Then I ran the code " python stray_visualize.py --point-clouds " and I got the error. Is there anything I did wrong?

Thank you.

kekeblom commented 2 years ago

Ah, good point. Those are from an old version of the app. I forgot about those. I'll update those to some more recent ones. Thing is, I changed the data format slightly since I recorded those.

kekeblom commented 2 years ago

@daekyounglee updated the readme with a more recent scan. Let me know if that fixes your problem.

daekyounglee commented 2 years ago

Thanks for your quick update. I ran the code by the new dataset you uploaded and it worked successfully. Thanks!