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

When 'useGpsSpeed' is 'false', m_kf.Zk is size 2 but update expects size 4 #47

Open
Pstoppani opened this issue Jul 26, 2019 · 2 comments

Comments

@Pstoppani
Copy link

Pstoppani commented Jul 26, 2019

Apparently 'assert' is turned off so the app does not crash even though 'm_kf.Zk.setData(x, y, xVel, yVel);' is passing 4 values when the Zk is only a 2 element vector.

public void update(double timeStamp, double x, double y,
                       double xVel,  double yVel,
                       double posDev,  double velErr) {
        m_predictCount = 0;
        m_timeStampMsUpdate = timeStamp;
        rebuildR(posDev, velErr);
        m_kf.Zk.setData(x, y, xVel, yVel);  // <--- Zk has 2 elements, not 4
        m_kf.update();
   }
@Pstoppani
Copy link
Author

Pstoppani commented Jul 26, 2019

I believe the fix is to add a check for m_useGpsSpeed:

    if (m_useGpsSpeed) {
        m_kf.Zk.setData(x, y, xVel, yVel);
    } else {
        m_kf.Zk.setData(x, y);
    }

@Lezh1k
Copy link
Collaborator

Lezh1k commented Jul 27, 2019

Sure, thank you

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

2 participants