Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with the comparison between the estimated position and ground-truth one #79

Open
robocar2018 opened this issue Feb 21, 2023 · 0 comments

Comments

@robocar2018
Copy link

robocar2018 commented Feb 21, 2023

@mbrossar , thanks for the great paper on dead reckoning using IEKF.

I found there was an issue when we made comparison between the estimated position and the ground-truth one.
Basically in the code, we use the following logic to compute the position, in this mode, we assume a flat-earth model , not a wgs84 ellipsoid model,

acc = Rot_prev.dot(u[3:6] - b_acc_prev) + self.g 
v = v_prev + acc * dt
p = p_prev + v_prev*dt + 1/2 * acc * dt**2

However, the ground truth position is computed from a Mercator projection , which is basically a nonlinear transformation from the (latitude, longitude). So after Mercator projection (code is shown below), for example, vehicle moving distance of 1 meter on the ellipsoid surface is NOT equal to 1 meter after the Mercator projection.

def pose_from_oxts_packet(packet, scale):
        """Helper method to compute a SE(3) pose matrix from an OXTS packet.
        """
        er = 6378137.  # earth radius (approx.) in meters

        # Use a Mercator projection to get the translation vector
        tx = scale * packet.lon * np.pi * er / 180.
        ty = scale * er * np.log(np.tan((90. + packet.lat) * np.pi / 360.))
        tz = packet.alt
        t = np.array([tx, ty, tz])

        # Use the Euler angles to get the rotation matrix
        Rx = KITTIDataset.rotx(packet.roll)
        Ry = KITTIDataset.roty(packet.pitch)
        Rz = KITTIDataset.rotz(packet.yaw)
        R = Rz.dot(Ry.dot(Rx))

        # Combine the translation and rotation into a homogeneous transform
        return R, t

A reasonable way to compare seems to be like:
Using an ellipsoid mode, and since v is resolved in the ned-frame, we can compute the delta-longitude and delta-latitude, then updated both longitude and latitude. Then we project those longitude and latitude to the x, y using Mercator projection, and finally we could compare to the ground truth.
How do you think? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant