princeton-vl / lietorch

BSD 3-Clause "New" or "Revised" License
679 stars 50 forks source link

bug in SE3.matrix()? #17

Closed MightyChaos closed 2 years ago

MightyChaos commented 2 years ago

Hi, thanks so much for your awsome work. I've been trying to apply the libary in my project, but got some comfusions.

I was looking for the defininaiton of the se(3)'s 6D vector (i.e. if it's (rot_vec, trans_vec) or. (trans_vec, rot_vec)), but got the following results which seems wrong.

a.vec() tensor([0.7433, 0.4080, 0.7250, 0.0628, 0.2401, 0.2408])

a.matrix() tensor([[ 0.6560, -0.5883, 0.9783, 0.0628], [ 0.5775, -0.4621, 0.1977, 0.2401], [-0.4860, 0.6636, 0.0627, 0.2408], [ 0.0000, 0.0000, 0.0000, 1.0000]])

a * torch.Tensor([0,0,0]) tensor([0.7433, 0.4080, 0.7250])

a.matrix() @ torch.Tensor([0,0,0,1]) tensor([0.0628, 0.2401, 0.2408, 1.0000])

it looks like matrix() is treating the se(3) 6D embedding as [rotation_vec, translation_vec], which conflits to the act() or * operations, where the embedding is apparently [translation_vec, rotation_vec].

MightyChaos commented 2 years ago

Just realize that the difference between the se(3) embedding v.s. translation+quaternion. Self-closing the issue.