Fix: Passing sensor_t into sensor_from_rig#12
Conversation
lamaria/structs/trajectory.py
Outdated
| # left camera poses are provided | ||
| # sensor_from_rig == cam0_from_imu | ||
| transform = rig.sensor_from_rig(sensor_id=2) | ||
| left_camera = reconstruction.cameras[2] |
There was a problem hiding this comment.
Why 2? Try to avoid magic numbers or at least document them properly using a variable with unambiguous name.
There was a problem hiding this comment.
I updating the naming for better clarity, the 2 for left camera comes from this function here where we build an initial reconstruction from a device calibration (for evaluation of each sequence).
Lines 31 to 74 in 6e45892
lamaria/structs/trajectory.py
Outdated
| # left camera poses are provided | ||
| # sensor_from_rig == cam0_from_imu | ||
| left_camera = reconstruction.cameras[2] | ||
| left_camera_id = 2 |
There was a problem hiding this comment.
This information is duplicated with a few lines below
[
(LEFT_CAMERA_STREAM_LABEL, 2),
(RIGHT_CAMERA_STREAM_LABEL, 3),
]| @@ -244,14 +244,17 @@ def _add_images_to_reconstruction( | |||
|
|
|||
| image_id = 1 | |||
There was a problem hiding this comment.
This won't work if the reconstruction already has images, cameras, or rigs, should we assert this? or make this code more generic?
There was a problem hiding this comment.
It is a hidden function that we don't want to expose. We only use it to add estimate poses to an already initialized reconstruction:
lamaria/lamaria/structs/trajectory.py
Lines 78 to 91 in c3d467b
There was a problem hiding this comment.
Whereas the more general function is to initialize the reconstruction with a calibration file (pinhole/Aria camera):
Line 31 in c3d467b
No description provided.