Page 1 of 1

Lighthouse versus other state estimates: which one to log/pull?

Posted: Sun Feb 16, 2020 11:24 pm
I am confused with so many logging variables giving position, velocity, and attitude estimates.

There's lighthouse.x/y/z, kalman.stateX/Y/Z, stateEstimate.x/y/z. Similarly, for velocities and attitudes. Then there's also stabilizer.roll/pitch/yaw.

Which ones should I work with if i want:
• Linear states:
• position in world frame
• velocity in world frame
• acceleration in world frame
• Angular states:
• Roll/pitch/yaw angles
• velocity in body frame
• acceleration in body frame
It would be very helpful if there's a documentation/wiki explaining the differences.
PS: I am using a LH for localizing the cf.

Re: Lighthouse versus other state estimates: which one to log/pull?

Posted: Mon Feb 17, 2020 2:17 pm
It depends which you would want. Position directly from lighthouse is a direct measurement, as from the state estimator is an estimate. Usually looking into the code of the firmware will do the trick but documentation is indeed a problem.
• The lighthouse positioning won't work since now the position is only estimated within the kalmanfilter, unless you enable a flag that enables the 'old' way of positioning in the lighthouse deck driver.
• Linear states:
• position in world frame: stateEstimate.x/z/y (the kalman one would also do since that is already in world coordinates)
• velocity in world frame: stateEstimate.vx/vz/vy
• acceleration in world frame: stateEstimate.ax/az/ay
• Angular states:
• Roll/pitch/yaw angles: stateEstimate.pitch/roll/yaw
• velocity in body frame: kalman.Px/Py/Pz (this function rotates the kalman estimates to world coordinates before it sends it to the stabilizer.
• acceleration in body frame: there is no logging of this, but check out this variable accSnapshot. Here it is put into the externalize-state function, which rotates some variables from a body to a world coordinate system. You can make your own logging variable to read this out from estimator_kalman.c
Let us know if you are still confused