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

Error regarding camera_meta.lens_pose_rotation #17

Open
seongminjung opened this issue Jul 19, 2023 · 2 comments
Open

Error regarding camera_meta.lens_pose_rotation #17

seongminjung opened this issue Jul 19, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@seongminjung
Copy link

seongminjung commented Jul 19, 2023

Hello,
I am currently trying to run visual-inertial SLAM using your app.
I successfully installed the app and recorded a video, but I cannot calibrate my camera.

When I try to run this code:

python data2kalibr.py /data --tag-size 0.11 --subsample 30

It gives me this error:

Traceback (most recent call last):
  File "data2kalibr.py", line 120, in <module>
    create_camera_yaml(proto, camera_yaml_path, args.matlab_calibration)
  File "data2kalibr.py", line 19, in create_camera_yaml
    q = Quaternion(c.lens_pose_rotation[3], *c.lens_pose_rotation[:3])
IndexError: list index (3) out of range

Apparently it is caused by this part of the file:

def create_camera_yaml(proto, camera_yaml_path, matlab_calibration=None):
    c = proto.camera_meta
    est_focal_length = proto.video_meta[0].est_focal_length_pix
    q = Quaternion(c.lens_pose_rotation[3], *c.lens_pose_rotation[:3])
    print('intrinsics: ', c.intrinsic_params)
    P = q.transformation_matrix
    print("Translation")
    print(c.lens_pose_translation)
...

I am struggling to find what caused this error. Is it because camera_meta variable has no attribute lens_pose_rotation?
I checked out issue #5 so I know that it is fine to not have intrinsic_param.

I would appreciate your suggestion or advice.

@seongminjung seongminjung added the question Further information is requested label Jul 19, 2023
@DavidGillsjo
Copy link
Owner

Hi,
It seems that I've assumed that there is a lens_pose_rotation value, but it is not present in your setup.
We have to adjust the code so that if no transform is available we set P=np.eye(4).
As a quick fix you could replace row 18-26 with this assignment instead. Please let me know if it works.

@DavidGillsjo
Copy link
Owner

I'll leave this open to track this bug.

@DavidGillsjo DavidGillsjo reopened this Jul 31, 2023
@DavidGillsjo DavidGillsjo added bug Something isn't working and removed question Further information is requested labels Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants