Coder Social home page Coder Social logo

yyccr / location Goto Github PK

View Code? Open in Web Editor NEW
189.0 18.0 62.0 3.13 MB

Smartphone navigation positionning, fusion GPS and IMU sensors.

CMake 2.87% C++ 81.88% C 2.06% Shell 0.17% Cuda 1.15% Fortran 11.65% Python 0.10% JavaScript 0.07% CSS 0.05%
location imu gps fusion ins smartphone-positioning

location's Introduction

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.

  • gyroscope(x, y, z).
  • accelerometer(x, y, z).
  • geomagnetic meter(x, y, z).
  • gravity sensor(x, y, z).
  • direction sensor(roll, pitch, yaw).
  • compass(degree).
  • road info(distance to next cross, bearing, road type).
  • 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.

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

Second open your CMakeLists.txt and add these:

include_directories(${PROJECT_SOURCE_DIR}/Location/include/eigen3)

include_directories(${PROJECT_SOURCE_DIR}/Location/math)
add_subdirectory(Location/math)

include_directories(${PROJECT_SOURCE_DIR}/Location/models)
add_subdirectory(Location/models)

include_directories(${PROJECT_SOURCE_DIR}/Location/location)
add_subdirectory(Location/location)

include_directories(${PROJECT_SOURCE_DIR}/Location/sensor)
add_subdirectory(Location/sensor)

include_directories(${PROJECT_SOURCE_DIR}/Location/system)
add_subdirectory(Location/system)

target_link_libraries(${PROJECT_NAME} Location_math)
target_link_libraries(${PROJECT_NAME} Location_models)
target_link_libraries(${PROJECT_NAME} Location_location)
target_link_libraries(${PROJECT_NAME} Location_sensor)
target_link_libraries(${PROJECT_NAME} Location_system)
target_link_libraries(${PROJECT_NAME} Location_test)

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

#include <iomanip>
#include <Eigen/Dense>
#include "sensor/GPS.h"
#include "location/Location.h"

using namespace Eigen;
using namespace std;

int main() {

    Location location;
    Vector3d gyro_data_v(0.004263,0.019169,-0.001014);
    Vector3d mag_data_v(-2.313675,-82.446960,-366.183838);
    Vector3d acc_data_v(0.105081,0.108075,9.774973);
    VectorXd gps_data_v(7);
    gps_data_v << 114.174118,22.283789,0.0,0.0,24.0,0.0,1554348968704.665039;
    Vector3d g_data_v(0.094139, 0.107857,9.808955);
    Vector3d ornt_data_v(-0.549866,0.629957,-0.069398);
    Vector3d road_data(1000.0, 0.0, 0);
    location.PredictCurrentPosition(gyro_data_v,acc_data_v,mag_data_v,gps_data_v,g_data_v,ornt_data_v, road_data);
    cout << location.GetGNSSINS().lng << " " << location.GetGNSSINS().lat << endl;
    return 0;
}

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

  • improve CMake.
  • Clean the garbage code.
  • Template processing.
  • Using smart pointer instead.
  • Complete all kinds of documents.
  • 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

location's People

Contributors

ruilin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

location's Issues

imu和gps模拟手机的姿态和位置

您好 ,我看到您对通过imu和gps传感器模拟定位有很多经验 ,我有一个问题很困扰想从您这得到帮助。
我是游戏开发工程师 ,希望通过手机的imu和gps模拟手机的姿态和位置出现在unity(游戏引擎)中的地图上行驶。 但是我根据imu的横摆角来模拟时和gps经纬发生了很大的偏离 ,您是否有使用gps来纠正imu yaw角 来修正朝向的经验? 我希望能够及时的响应imu的朝向 ,但不要偏离gps位置太多 。
image
黄色箭头是gps位置,红色箭头是根据imu航向和速度模拟的,朝向偏差导致分道扬镳了。

运行

请问运行的时候需要连接什么吗?为什么我运行时报了许多未声明的标识符

关于api调用

您好,想求教几个API调用的问题:
1、在安卓开发中,该如何调用该项目API呀?
2、输出的经纬度需要是WGS_84格式的吗?

关于测试方式

你好,想问一下关于测试算法的几个问题
1.手机需要固定的很好吗,是不是竖直手机放置就行了
2.在测试时候发现,算法在gnss失锁了的话,惯导就很快会发散了,不知道作者您是否也是同样的情况。

ornt_data_v

main 里边的ornt_data_v 这个是什么数据?

关于二阶低通滤波器参数计算

您好!
想请教下二阶低通滤波器参数计算公式的推导过程,查阅相关滤波器设计的资料,发现无法推导出你在代码中实现的参数公式,请问您是如何推导而来的,有相关参考资料吗?
望不吝赐教!谢谢!!

Add a license to your project

This project does not have an open source license. This makes the project nearly impossible to use under US intellectual property laws. Please choose one of the standard open source licenses and add it to your project. (GitHub has built-in functionality that makes this easy to do.)

If you are looking for pointers, I would suggest the BSD-3-Clause or Apache licenses. I would avoid the LGPL, GPL, and AGPL, because they make your code difficult to use for many organizations.

help

The project is very referential and the code annotation is complete. how to get the sensor data required by the project with mobile phone? Or what devices do you need to buy to collect sensor data?

build fails on macos

... because the file system is not case sensitive and the subdirectory location exists in the build directory. If you follow the description from the README.md to include Location in your own project everything should be fine.

Details:

/opt/local/bin/cmake -E cmake_link_script CMakeFiles/Location.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14 -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/Location.dir/main.cpp.o  -o Location  math/libLocation_math.a models/libLocation_models.a location/libLocation_location.a sensor/libLocation_sensor.a system/libLocation_system.a utils/libLocation_utils.a test/libLocation_test.a location/libLocation_location.a models/libLocation_models.a sensor/libLocation_sensor.a math/libLocation_math.a system/libLocation_system.a utils/libLocation_utils.a 
ld: can't open output file for writing: Location, errno=21 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How to fix:
Use a different name (other than Location) in Location/CMakeLists.txt, e.g.

...
add_executable(LocationTest main.cpp)

target_link_libraries(LocationTest Location_math)
target_link_libraries(LocationTest Location_models)
target_link_libraries(LocationTest Location_location)
target_link_libraries(LocationTest Location_sensor)
target_link_libraries(LocationTest Location_system)
target_link_libraries(LocationTest Location_utils)
target_link_libraries(LocationTest Location_test)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.