项目作者: yyccR

项目描述 :
Smartphone navigation positionning, fusion GPS and IMU sensors.
高级语言: C++
项目地址: git://github.com/yyccR/Location.git
创建时间: 2018-11-25T14:08:57Z
项目社区:https://github.com/yyccR/Location

开源协议:

下载


LOCATION

Build Status

Positioning is the most basic and crucial step in the driving navigation. An accurate positioning can effectively improve the accuracy of the road-binding, and can also sense the change of the driving pattern more accurately. Since the project is mainly based on mobile phones for navigation and positioning, Currently used is the built-in sensor data (gyroscope, accelerometer, geomagnetic meter, direction sensor, gravity sensor) and GPS data fusion positioning.

Sensor data required.

  • [X] gyroscope(x, y, z).
  • [X] accelerometer(x, y, z).
  • [X] geomagnetic meter(x, y, z).
  • [X] gravity sensor(x, y, z).
  • [X] direction sensor(roll, pitch, yaw).
  • [X] compass(degree).
  • [X] road info(distance to next cross, bearing, road type).
  • [X] GPS(lng, lat, alt, accuracy, speed, bearing, t).

Some implement details

  • sensor data filter.

  • GPS fusion INS under uncoupling system.

Quick start

First make sure gcc and cmake was installed, and include this library into your project.

  1. git clone https://github.com/yyccR/Location.git

Second open your CMakeLists.txt and add these:

  1. include_directories(${PROJECT_SOURCE_DIR}/Location/include/eigen3)
  2. include_directories(${PROJECT_SOURCE_DIR}/Location/math)
  3. add_subdirectory(Location/math)
  4. include_directories(${PROJECT_SOURCE_DIR}/Location/models)
  5. add_subdirectory(Location/models)
  6. include_directories(${PROJECT_SOURCE_DIR}/Location/location)
  7. add_subdirectory(Location/location)
  8. include_directories(${PROJECT_SOURCE_DIR}/Location/sensor)
  9. add_subdirectory(Location/sensor)
  10. include_directories(${PROJECT_SOURCE_DIR}/Location/system)
  11. add_subdirectory(Location/system)
  12. target_link_libraries(${PROJECT_NAME} Location_math)
  13. target_link_libraries(${PROJECT_NAME} Location_models)
  14. target_link_libraries(${PROJECT_NAME} Location_location)
  15. target_link_libraries(${PROJECT_NAME} Location_sensor)
  16. target_link_libraries(${PROJECT_NAME} Location_system)
  17. target_link_libraries(${PROJECT_NAME} Location_test)

final open your main file, and add the test code.

  1. #include <iomanip>
  2. #include <Eigen/Dense>
  3. #include "sensor/GPS.h"
  4. #include "location/Location.h"
  5. using namespace Eigen;
  6. using namespace std;
  7. int main() {
  8. Location location;
  9. Vector3d gyro_data_v(0.004263,0.019169,-0.001014);
  10. Vector3d mag_data_v(-2.313675,-82.446960,-366.183838);
  11. Vector3d acc_data_v(0.105081,0.108075,9.774973);
  12. VectorXd gps_data_v(7);
  13. gps_data_v << 114.174118,22.283789,0.0,0.0,24.0,0.0,1554348968704.665039;
  14. Vector3d g_data_v(0.094139, 0.107857,9.808955);
  15. Vector3d ornt_data_v(-0.549866,0.629957,-0.069398);
  16. Vector3d road_data(1000.0, 0.0, 0);
  17. location.PredictCurrentPosition(gyro_data_v,acc_data_v,mag_data_v,gps_data_v,g_data_v,ornt_data_v, road_data);
  18. cout << location.GetGNSSINS().lng << " " << location.GetGNSSINS().lat << endl;
  19. return 0;
  20. }

if you see the output 114.174 22.2838 that means this library was embedded to your project successfully.

Input data format.

  • gyroscope(x, y, z), origin gyroscope data, unit rad/s

  • accelerometer(x, y, z), origin accelerometer data, unit m/s²

  • geomagnetic meter(x, y, z), origin geomagnetic data, unit μt

  • gravity sensor(x, y, z), origin gravity data, unit m/s²

  • direction sensor(roll, pitch, yaw), origin sensor data, unit degree

Note that direction sensor doesn’t exit actually , the ‘sensor data’ is computation result from system underlying algorithm.

  • compass(degree), origin sensor data, unit degree

  • road info(distance to next cross, bearing, road type)

This data is from map data, and if you couldn’t search map server data, just fill in all zero (0.0, 0.0, 0.0)

  • GPS(lng, lat, alt, accuracy, speed, bearing, t)
    • lng, longitude, double
    • lat, latitude, double
    • alt, altitude, double
    • accuracy, double
    • speed, double
    • bearing, double, unit degree
    • t, timestampe, unit millisecond

More detail tutorial.

TODO

  • [X] improve CMake.
  • [X] Clean the garbage code.
  • Template processing.
  • [X] Using smart pointer instead.
  • [X] Complete all kinds of documents.
  • [X] Add quick start.
  • Add more test case.
  • Design a suitable pattern.

reference:

  1. 《惯性导航》秦永元
  2. 《捷联惯性导航技术(第2版 译本)》译者:张天光/王秀萍/王丽霞 作者:DavidH.Titte
  3. An efficient orientation filter for inertial and
    inertial/magnetic sensor arrays
  4. Estimation of IMU and MARG orientation using a gradient descent algorithm
  5. Direction Cosine Matrix IMU Theory
  6. METHODS FOR NON-LINEAR LEAST SQUARES PROBLEMS
  7. A Calibration Algorithm for Microelectromechanical Systems Accelerometers in Inertial Navigation Sensors
  8. A Calibration Method of Three-axis Magnetic Sensor Based on Ellipsoid Fitting
  9. Accuracy Improvement of Low Cost INS/GPS for Land Applications
  10. Trajectory preprocessing: Computing with Spatial Trajectories