openvslam icon indicating copy to clipboard operation
openvslam copied to clipboard

Innaccurate result of mono video SLAM

Open angussmitchell opened this issue 5 years ago • 3 comments
trafficstars

I've been encountering strange and plainly incorrect results from running the video_slam example. I ran it on the "aist_living_lab_1" example, and plotting using evo tool, the rotation results are clearly incorrect, and do not reflect the values seen through the viewer.

The x y z translations look accurate: image

However the rotation values are very wrong: image

This video only really contains rotations in one dimension (pitch - about the y axis), however in the frames_trajectory.txt, you can see that there are significant rotations about the z and x axes (yaw and roll).

These plots were created by running evo_traj tum frame_trajectop _0.txt -p on the frames_trajectory.txt output.

angussmitchell avatar Sep 04 '20 04:09 angussmitchell

You probably need to change the Euler angle representation used for this plot. This is not related to accuracy of the trajectory. https://github.com/MichaelGrupp/evo/issues/295#issuecomment-649584091 https://github.com/MichaelGrupp/evo/issues/181#issuecomment-507675295

MichaelGrupp avatar Sep 09 '20 09:09 MichaelGrupp

Thanks very much @MichaelGrupp, I see that this is a common issue - that there is a mismatch between the Euler angle representation that openvslam outputs in the frames_trajectory.txt file, and what is expected by evo by default.

I am working on an application where I want to stabilize video based on rotation about a single axis (with x y or z), which cannot be predicted (i.e. its not always about the y or the z axis in the case of a camera mounted to a car).

From the previous issues raised it seems that the output is represented in szxy rotation order. That being the case, using standard libraries such as scipy how does one convert the openvslam outputs to axis angles?

i.e. using scipy I get the same result as the default evo sxyz rotation order

from scipy.spatial.transform import Rotation as R r = R.from_quat([1, 0, 0, 0])

I understand that there is a configurable rotation order in evo, but surely openvslam should output a rotation order than is compatible with the convention expected by users and by other modules such as scipy. It seems that several past issues have raised the same problem. Is it possible to set the default output order to correspond with what users expect?

angussmitchell avatar Sep 09 '20 11:09 angussmitchell

I don't understand - the trajectory file contains a quaternion, not RPY. So if you want to convert it to an Euler representation, you need to choose the order yourself.

MichaelGrupp avatar Sep 25 '20 12:09 MichaelGrupp