NVlabs / geomapnet

Geometry-Aware Learning of Maps for Camera Localization (CVPR2018)
https://goo.gl/mRB3Au.
Other
348 stars 79 forks source link

Question about interpolate poses #45

Closed LZL-CS closed 2 years ago

LZL-CS commented 2 years ago

Hi, in your code from Oxford RobotCar SDK: https://github.com/samarth-robo/robotcar-dataset-sdk/blob/86b251284b5583182bcd9584952d5421cdfb0040/python/interpolate_poses.py#L204 you didn't use poses_mat = np.linalg.solve(poses_mat[0:4, 0:4], poses_mat). Could you please explain why you don't use this line in your code? Hope you can give me some suggestions.

samarth-robo commented 2 years ago

@LZL-CS sorry for the late reply. In that equation, poses_mat is a list of absolute poses w.r.t. some world coordinate system w.

Denote the i-th frame by w_T_i. So for each frame i, it is solving the equation w_T_0 X = w_T_i for X.

The answer is obviously X = inv(w_T_0) * w_T_i = 0_T_i i.e. the pose of the i-th frame not w.r.t. world w, but the 0th frame. Essentially it is transforming the whole trajectory such that the first pose is identity.

They could have done this in a for loop, but chose to speed it up by using np.linalg.solve()'s fast linear algebra.

The above was an explanation of what that line does. I don't remember exactly why I am not using it, but inside my own code I subtract the mean of the poses of the whole trajectory, so that has a similar effect.

LZL-CS commented 2 years ago

Hi @samarth-robo, thanks for your reply.