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

The question of head file "csv_reader.hpp" and member function "void EKF::updateJA(const double dt)" in the class of ekf #5

Closed
863217373 opened this issue May 17, 2019 · 7 comments

Comments

@863217373
Copy link

when I read the code, I find that there are lack of a head file "csv_reader.hpp".Can you update it and make this project integrated.
There are also lack of a definition of "calculate_jacobian()" in the member function of "void EKF::updateJA(const double dt)" in ekf.cpp.
Sir, can you help me fix these problems. thank you very much.

@liyuebit
Copy link

Hello,
Have you solved your problem?

@863217373
Copy link
Author

No

@karanchawla
Copy link
Owner

Will push a fix by tonight. It's basically the jacobian of the matrix.

@karanchawla
Copy link
Owner

karanchawla commented Jun 7, 2019

Apologies for the delay,

here's how you can compute the jacobian of the dynamic matrix A

# Calculate the Jacobian of the Dynamic Matrix A
    # see "Calculate the Jacobian of the Dynamic Matrix with respect to the state vector"
    a13 = float((x[3]/x[4]) * (np.cos(x[4]*dt+x[2]) - np.cos(x[2])))
    a14 = float((1.0/x[4]) * (np.sin(x[4]*dt+x[2]) - np.sin(x[2])))
    a15 = float((dt*x[3]/x[4])*np.cos(x[4]*dt+x[2]) - (x[3]/x[4]**2)*(np.sin(x[4]*dt+x[2]) - np.sin(x[2])))
    a23 = float((x[3]/x[4]) * (np.sin(x[4]*dt+x[2]) - np.sin(x[2])))
    a24 = float((1.0/x[4]) * (-np.cos(x[4]*dt+x[2]) + np.cos(x[2])))
    a25 = float((dt*x[3]/x[4])*np.sin(x[4]*dt+x[2]) - (x[3]/x[4]**2)*(-np.cos(x[4]*dt+x[2]) + np.cos(x[2])))
    JA = np.matrix([[1.0, 0.0, a13, a14, a15, 0.0],
                    [0.0, 1.0, a23, a24, a25, 0.0],
                    [0.0, 0.0, 1.0, 0.0, dt, 0.0],
                    [0.0, 0.0, 0.0, 1.0, 0.0, dt],
                    [0.0, 0.0, 0.0, 0.0, 1.0, 0.0],
                    [0.0, 0.0, 0.0, 0.0, 0.0, 1.0]])

This is a python implementation. So, you'll have to convert it to C++

This is based off of work from @balzer82.

@HandsomeDragon3
Copy link

There might be a mistake that you wrote" const double r13 = turn_radius * (-cos(dt * psi_dot) + psi);" in utils.cpp

@balzer82
Copy link

balzer82 commented Oct 6, 2019

@karanchawla Would be nice, if you mention the Author of this code snipped, because I released it under CC-BY 2.0 License.

@karanchawla
Copy link
Owner

Definitely. Apologies for not doing that. Will add it to the Readme as well.

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

5 participants