Example Code
Closed this issue · 2 comments
Fachmann04 commented
I am not really getting smart from your code as I don't understand where I have to input the data from IMU and GNSS. Could you please provide an example on how to use the functions and where I have to do something myself? That woul be very kind.
orsalmon commented
Hi,
The ins-gps-ekf is a c++ library with very simple API:
1. create an instance of EKF_INS::EKF();
2. input initial conditions using setInitialState(Eigen::Vector3d p_0,
Eigen::Vector3d v_0, Eigen::Matrix3d T_0);
3. when you want to start, run start();
4. whenever you have data from the accelerometer, use
updateWithInertialMeasurement(Eigen::Vector3d data, enum Type type); ,
where type = EKF_INS::Type::ACCELEROMETER
5. whenever you have data from the gyro, use
updateWithInertialMeasurement(Eigen::Vector3d
data, enum Type type); , where type = EKF_INS::Type::GYRO
6. whenever you have data from the GPS, use updateWithGPSMeasurements
(std::vector<Eigen::Matrix<double, 6, 1>> gps_data);
7. to get the output of the ekf you can use one of those methods:
Eigen::VectorXd getErrorState();
std::tuple<Eigen::Vector3d, Eigen::Vector3d, Eigen::Matrix3d>
getNavigationState();
Eigen::MatrixXd getErrorStateCovariance();
Eigen::Vector3d getPositionState();
Eigen::Vector3d getVelocityState();
Eigen::Matrix3d getOrientationState();
double getAzimuth();
You can take a look in
https://github.com/orsalmon/KittiDatasetGPS-INSViewer/blob/master/KittiDatasetTools/KittiDatasetParser.cpp,
especially in the function void KittiDatasetParser::startPlayingData(); to
see how I am using this library.
Have a nice day,
Or
…On Fri, Nov 23, 2018 at 2:52 PM Fachmann04 ***@***.***> wrote:
I am not really getting smart from your code as I don't understand where I
have to input the data from IMU and GNSS. Could you please provide an
example on how to use the functions and where I have to do something
myself? That woul be very kind.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH5BWMnDgOF4K5pREeprHN1QMfiGCiThks5ux--YgaJpZM4YwnLo>
.
Fachmann04 commented
Thanks a lot!