optimizing orientation w.r.t. gravity vector: how to parametrize 2DoF (roll, pitch) orientation?

463 views
Skip to first unread message

phreak...@gmail.com

unread,
Nov 17, 2017, 10:44:39 AM11/17/17
to Ceres Solver
Hi,
I was wodering if someone could provide me any pointers into how should I write a local parameterization for a 2DoF rotation, representing only rotations with non-zero roll and pitch angles. I'm using this to correct for estimated orientation w.r.t. to gravity vector, where yaw is not observable. I guess I could work with quaternions and write a paremeterization to integrate 2dof perturbations using the plus operator. However, I'm not really sure how should I write it in order to mimic the standard quaternion parameterization.

Best,
Matias

Keir Mierle

unread,
Nov 17, 2017, 12:27:03 PM11/17/17
to ceres-...@googlegroups.com
One idea off the top of my head: you can parameterize this by using a vector normal to the plane, then ignoring the magnitude and only extracting the pitch/yaw. In the typical axis-angle representation the magnitude is taken to be the rotation amount on that plane, but in this case you ignore that. You could then do a local parameterization in pitch/roll.

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/ee88d54f-4eb1-42e7-a035-c1a8fe77659a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

phreak...@gmail.com

unread,
Nov 17, 2017, 1:32:22 PM11/17/17
to Ceres Solver
I'm not sure if I got your idea, but maybe it is similar to what I'm thinking. My idea would be to perturb the original quaternion with a quaternion built as if the two degrees of freedom where roll and pitch. However, I don't really understand how the quaternion parameterization works so I don't fully see how to proceed with this.

On Friday, November 17, 2017 at 6:27:03 PM UTC+1, Keir Mierle wrote:
One idea off the top of my head: you can parameterize this by using a vector normal to the plane, then ignoring the magnitude and only extracting the pitch/yaw. In the typical axis-angle representation the magnitude is taken to be the rotation amount on that plane, but in this case you ignore that. You could then do a local parameterization in pitch/roll.
On Fri, Nov 17, 2017 at 7:44 AM, <phreak...@gmail.com> wrote:
Hi,
I was wodering if someone could provide me any pointers into how should I write a local parameterization for a 2DoF rotation, representing only rotations with non-zero roll and pitch angles. I'm using this to correct for estimated orientation w.r.t. to gravity vector, where yaw is not observable. I guess I could work with quaternions and write a paremeterization to integrate 2dof perturbations using the plus operator. However, I'm not really sure how should I write it in order to mimic the standard quaternion parameterization.

Best,
Matias

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.

phreak...@gmail.com

unread,
Nov 17, 2017, 2:06:05 PM11/17/17
to Ceres Solver
Actually, If I use the standard quaternion parameterization but with a delta_x of two dimensions, and then use [delta_x 0] instead of the delta_x in the following equation, I would be effectively killing rotations around Z, right?

Jing Wang

unread,
Dec 10, 2017, 10:25:54 AM12/10/17
to Ceres Solver
Hi, i'm thinking about the problem these days. Do you have any updates?

In my opinion, using [delta_x, 0] will keep the 'local' rotation around Z, however the rotation around the 'global' Z-axis may still change.

So, perhaps the only method is to use Euler-angle in global frame?

Regards.
Jing


在 2017年11月18日星期六 UTC+8上午3:06:05,phreak...@gmail.com写道:

Bo Li

unread,
Jul 9, 2018, 11:56:01 PM7/9/18
to Ceres Solver
Ran into similar problem recently and this is the only related post I search out. Just post my understanding (I am not sure this solution is completely correct) here in case someone else with similar questions can search it. I know this is an outdated post.

1. 2DoF Rotation
This can be obtain by modifying the QuaternionParameterization s.t. [delta_x, delta_y, delta_z] is changed to [delta_x, delta_y, 0]. The jacobian computation should also be modified (basically remove the third column). 

2. Rotation in local or global frame
I am optimizing a R, s.t. X_global = Q * X_local. The ceres QuaternionParameterization perturbs Q as dQ * Q. Since Q * X_local is a point in global frame, dQ * Q * X_local should be pertubed in the global frame. If we want to rotate in local frame, we probably should perturb Q as Q * dQ.

3. Rotation of a gravity
Should probably rotate (0, 0, 1) by dQ = [delta_x, delta_y, 0] in the local frame, I guess.

在 2017年12月10日星期日 UTC+8下午11:25:54,Jing Wang写道:

Jing Wang

unread,
Jul 10, 2018, 12:19:20 AM7/10/18
to Ceres Solver
I managed to achieve this by writing a Euler-Quaternion local parameterization based on the implementation in VINS-Mono. By updating 3DoF global euler angles in Plus and setting the yaw-related columns in ComputeJacobian to zero, the yaw angle can be fixed.

However I've another question. I'm dealing with this issue in visual inertial odometry. And the gauge freedom of visual inertial odometry is usually described as '4DoF, including 3DoF positions and the 1DoF rotation around the gravity'.  

The question is, by fixing the global yaw angle in the z-y-x convention, is the 1DoF rotation-gauge-freedom really fixed? Or should we perturb the rotation as dQ([delta_x, delta_y, 0]) * Q? How to mathematically represent the rotation around the gravity?

Regards.
Jing


在 2018年7月10日星期二 UTC+8上午11:56:01,Bo Li写道:

phreak...@gmail.com

unread,
Jul 19, 2018, 8:20:09 PM7/19/18
to Ceres Solver
Hi,
actually, I employed a much simpler solution. Since gravity has only 2 DoF but I wan't it as a 3-vector, I'm using the Homogeneous point parametrization of ceres, which allows you to parametrize a N-DoF parameter as N+1 vector. As I understand from the code, it supposedly keeps the vector normalized. 
Reply all
Reply to author
Forward
0 new messages