papagina/RotationContinuity

Implementation of your quaternion

Opened this issue · 3 comments

sign = torch.sign(out_rotation_raw[:, 3])+0.5 #batch

Here I assume your intended half quaternion is to negate the quaternion when some value is negative (Point out if I'm wrong). I don't understand why is there an additional +0.5? That will make -1 becomes -0.5 and 1 becomes 1.5

Hi. Yes, you are right. I added +0.5 to handle the case when the value is 0. torch.sign() returns 0 when given 0.

Hi. Yes, you are right. I added +0.5 to handle the case when the value is 0. torch.sign() returns 0 when given 0.

Thanks for reply. In the line below

out_rotation_raw2 = out_rotation_raw * sign.view(batch,1).repeat(1,4)

torch.sign() returns 0 when given 0 and +0.5 we get 0.5. Will this 0.5 multiplication cause some unwanted scaling? I see that this +0.5 is outside of the bracket.

Hi. Yes, you are right. I added +0.5 to handle the case when the value is 0. torch.sign() returns 0 when given 0.

Thanks for reply. In the line below

out_rotation_raw2 = out_rotation_raw * sign.view(batch,1).repeat(1,4)

torch.sign() returns 0 when given 0 and +0.5 we get 0.5. Will this 0.5 multiplication cause some unwanted scaling? I see that this +0.5 is outside of the bracket.

I didn't see any problems in my experiments.