1 Star 1 Fork 0

alfar/gnss-ins-sim

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo_free_integration_openimu.py 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
# -*- coding: utf-8 -*-
# Filename: demo_free_integration.py
"""
Demonstrate free integration performance using logged data.
Created on 2018-12-03
@author: dongxiaoguang
"""
import os
import math
import numpy as np
from gnss_ins_sim.attitude import attitude
from gnss_ins_sim.sim import imu_model
from gnss_ins_sim.sim import ins_sim
# log_dir = "./demo_data_files/nxp/"
log_dir = "./demo_data_files/bosch/"
fs = 100.0 # IMU sample frequency
using_external_g = True
def test_free_integration():
'''
test Sim
'''
#### do not need an IMU model
imu = None
#### Algorithm
from demo_algorithms import free_integration
ini_pos_vel_att = np.genfromtxt(log_dir+"ini.txt", delimiter=',')
ini_pos_vel_att[0:2] *= attitude.D2R # For Lat and Lon, deg to rad
ini_pos_vel_att[6:9] *= attitude.D2R # Attitude from deg to rad
if not using_external_g:
ini_pos_vel_att = ini_pos_vel_att[0:9]
# create the algorithm object
algo = free_integration.FreeIntegration(ini_pos_vel_att, earth_rot=False)
from demo_algorithms import inclinometer_acc
algo2 = inclinometer_acc.TiltAcc()
#### start simulation
sim = ins_sim.Sim([fs, 0.0, 0.0],
log_dir,
ref_frame=0,
imu=imu,
mode=None,
env=None,
algorithm=[algo, algo2])
# run the simulation
sim.run(1)
# generate simulation results, summary
sim.results('', end_point=True, extra_opt='ned')
# plot
sim.plot(['pos', 'vel', 'att_euler', 'accel', 'gyro'],
opt={'pos':'error', 'vel':'error', 'att_euler':'error'})
if __name__ == '__main__':
test_free_integration()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/alfar999/gnss-ins-sim.git
git@gitee.com:alfar999/gnss-ins-sim.git
alfar999
gnss-ins-sim
gnss-ins-sim
master

搜索帮助