diff --git a/controllers/sunny360vfe_ap_params.sldd b/controllers/sunny360vfe_ap_params.sldd index 971493c..d72c4d0 100644 Binary files a/controllers/sunny360vfe_ap_params.sldd and b/controllers/sunny360vfe_ap_params.sldd differ diff --git a/controllers/sunny360vfe_params.xlsx b/controllers/sunny360vfe_params.xlsx index b91851f..0f9dcac 100644 Binary files a/controllers/sunny360vfe_params.xlsx and b/controllers/sunny360vfe_params.xlsx differ diff --git a/doc/RunShow.m b/doc/RunShow.m new file mode 100644 index 0000000..ad7dbb0 --- /dev/null +++ b/doc/RunShow.m @@ -0,0 +1,3 @@ + +showRecMat('00000021.DAT.mat', [1:25]); + diff --git a/doc/parserRec.bat b/doc/parserRec.bat new file mode 100644 index 0000000..262da3b --- /dev/null +++ b/doc/parserRec.bat @@ -0,0 +1,2 @@ +python parserRec.py %1 +pause diff --git a/doc/parserRec.py b/doc/parserRec.py new file mode 100644 index 0000000..03a7ff0 --- /dev/null +++ b/doc/parserRec.py @@ -0,0 +1,777 @@ + +import struct +import scipy.io as spio +import math + +line_buff = [] +inv_dalin_fix = [-0.0061075297, 0.0116297975, 0.0000028471, -0.0000004536] +inv_dalout_fix = [-0.0202131443, 0.0125861888, 0.0000298655, -0.0000013490] +inv_darin_fix = [-0.0010516139, -0.0114334432, -0.0000011885, 0.0000004852] +inv_darout_fix = [-0.0004526855, -0.0112986413, -0.0000081846, 0.0000004624] +inv_drl_fix = [0.0024652155, -0.0139869564, 0.0000143248, 0.0000004647] +inv_drr_fix = [-0.0016802808, -0.0139145523, -0.0000072242, 0.0000002906] + +def printline(txt): + global line_buff + line_buff.append(txt) + if len(line_buff) >= 40: + print(' '.join(line_buff)) + line_buff.clear() + + +def chksum(buff): + s = 0 + for i in buff: + s = s+i + return s % 256 + +def pwm2pos(pwm): + if pwm > 0x1000: + return 0 + elif pwm > 0x7FF: + return pwm - 4095 + else: + return pwm +def act2deg_new(para): + def wrap(p): + x = p + if p > 32767: + x = p - 65536 + x = x / 10 + act =(para[0] + para[1] * x + para[2] * x * x + para[3] * x * x * x )*57.3 + return act + return wrap + + +def parseHJ(filename): + + hj = open(filename, 'rb') + pkgs = \ + { 1: [struct.Struct('<2I2d24f3B'), + [['boot_time',0.005,'时间戳',0], + ['tick',0.005,'时间戳',0], + ['lat_ins_inn',1,'内部惯导纬度(deg)',0], + ['lon_ins_inn',1,'内部惯导经度(deg)',0], + ['alt_ins_inn',1,'内部惯导高度(m)',0], + ['phi_ins_inn',57.29,'内部惯导滚转角(deg)',0], + ['tht_ins_inn',57.29,'内部惯导俯仰角(deg)',0], + ['psi_ins_inn',57.29,'内部惯导偏航角(deg)',0], + ['quad1',1,'四元数',0], + ['quad2',1,'四元数',0], + ['quad3',1,'四元数',0], + ['quad4',1,'四元数',0], + ['vn_ins_inn',1,'内部惯导北向速度(m/s)',0], + ['ve_ins_inn',1,'内部惯导东向速度(m/s)',0], + ['vu_ins_inn',-1,'内部惯导天向速度(m/s)',0], + ['ax_ins_1',1,'主IMU前向加速度(m/s2)',0], + ['ay_ins_1',1,'主IMU侧向加速度(m/s2)',0], + ['az_ins_1',-1,'主IMU上向加速度(m/s2)',0], + ['ax_ins_2',1,'副IMU前向加速度(m/s2)',0], + ['ay_ins_2',1,'副IMU侧向加速度(m/s2)',0], + ['az_ins_2',-1,'副IMU上向加速度(m/s2)',0], + ['p_ins_1',57.29,'主IMU滚转角速度(deg/sec)',0], + ['q_ins_1',57.29,'主IMU俯仰角速度(deg/sec)',0], + ['r_ins_1',57.29,'主IMU偏航角速度(deg/sec)',0], + ['p_ins_2',57.29,'副IMU滚转角速度(deg/sec)',0], + ['q_ins_2',57.29,'副IMU俯仰角速度(deg/sec)',0], + ['r_ins_2',57.29,'副IMU偏航角速度(deg/sec)',0], + ['acc_g',1,'重力加速度(deg/sec)',0], + ['fuse_vel_cnt',1,'速度组合计数',0], + ['fuse_hdg_cnt',1,'航向组合计数',0], + ['integrated_flag',1,'惯导组合状态',0], + ], + [], + ], + 2: [struct.Struct('<2I35f'), + [['boot_time',0.005,'时间戳',0], + ['tick',0.005,'时间戳',0], + ['gyro_bias1',1,'gyro_bias',0], + ['gyro_bias2',1,'gyro_bias',0], + ['gyro_bias3',1,'gyro_bias',0], + ['acc_bias1',1,'acc_bias',0], + ['acc_bias2',1,'acc_bias',0], + ['acc_bias3',1,'acc_bias',0], + ['hdg_bias',1,'hdg_bias',0], + ['euler_var1',1,'euler_var',0], + ['euler_var2',1,'euler_var',0], + ['euler_var3',1,'euler_var',0], + ['vn_var',1,'vned_var',0], + ['ve_var',1,'vned_var',0], + ['vd_var',1,'vned_var',0], + ['gyro_bias_var1',1,'gyro_bias_var',0], + ['gyro_bias_var2',1,'gyro_bias_var',0], + ['gyro_bias_var3',1,'gyro_bias_var',0], + ['acc_bias_var1',1,'acc_bias_var',0], + ['acc_bias_var2',1,'acc_bias_var',0], + ['acc_bias_var3',1,'acc_bias_var',0], + ['hdg_bias_var',1,'hdg_bias_var',0], + ['vel_innov1',1,'vel_innov',0], + ['vel_innov2',1,'vel_innov',0], + ['vel_innov3',1,'vel_innov',0], + ['vel_innov_var1',1,'vel_innov_var',0], + ['vel_innov_var2',1,'vel_innov_var',0], + ['vel_innov_var3',1,'vel_innov_var',0], + ['pos_innov1',1,'pos_innov',0], + ['pos_innov2',1,'pos_innov',0], + ['pos_innov3',1,'pos_innov',0], + ['pos_innov_var1',1,'pos_innov_var',0], + ['pos_innov_var2',1,'pos_innov_var',0], + ['pos_innov_var3',1,'pos_innov_var',0], + ['LLA_var',1,'LLA_var',0], + ['LLA_var',1,'LLA_var',0], + ['LLA_var',1,'LLA_var',0], + ], + [], + ], + 3: [struct.Struct('<3I2df3f3H7B'), + [['boot_time',0.005,'时间戳',0], + ['tick',0.005,'时间戳',0], + ['tow',1,'GPS周期计数',0], + ['lat_gps_inn',1,'内部GPS纬度(deg)',0], + ['lon_gps_inn',1,'内部GPS经度(deg)',0], + ['alt_gps_inn',1,'内部GPS高度(m)',0], + ['vn_gps_inn',1,'内部GPS北向速度(m/s)',0], + ['ve_gps_inn',1,'内部GPS东向速度(m/s)',0], + ['vu_gps_inn',-1,'内部GPS天向速度(m/s)',0], + ['year',1,'年份',0], + ['msec',1,'毫秒',0], + ['pdop',1,'PDOP值',0], + ['month',1,'月份',0], + ['day',1,'日期',0], + ['hour',1,'小时',0], + ['minute',1,'分钟',0], + ['second',1,'秒',0], + ['fixtype',1,'内部惯导定位模式',0], + ['satnum',1,'内部惯导定位星数',0], + ], + [], + ], + 4: [struct.Struct('<3I6f9hH'), + [['boot_time',0.005,'时间戳',0], + ['tick',0.005,'时间戳',0], + ['health',1,'传感器健康状态',0], + ['ps_raw_1',1,'主静压(Pa)',0], + ['ps_raw_2',1,'副静压(Pa)',0], + ['qbar_raw_1',1,'主动压(Pa)',0], + ['qbar_raw_2',1,'副动压(Pa)',0], + ['mag_hdg',57.29,'磁航向(Deg)',0], + ['gps_hdg',57.29,'GPS航向(Deg)',0], + ['temp_imu_1',0.01,'主IMU温度(Deg)',0], + ['temp_imu_2',0.01,'副IMU温度(Deg)',0], + ['temp_qbar_1',0.01,'主IMU温度(Deg)',0], + ['temp_qbar_2',0.01,'副IMU温度(Deg)',0], + ['temp_ps_1',0.01,'主IMU温度(Deg)',0], + ['temp_ps_2',0.01,'副IMU温度(Deg)',0], + ['magx_raw',1,'磁力计',0], + ['magy_raw',1,'磁力计',0], + ['magz_raw',1,'磁力计',0], + ['cpu_load',1,'导航',0], + ], + [], + ], + 5: [struct.Struct('<2IB9f2d10f8B5Hb'), + [['boot_time',0.005,'时间戳',0], + ['tick',1,'桢计数器',0], + ['state',1,'传感器状态',0], + ['tht_ins_ext',57.29,'外部惯导俯仰角(deg)',0], + ['phi_ins_ext',57.29,'外部惯导滚转角(deg)',0], + ['psi_ins_ext',57.29,'外部惯导偏航角(deg)',0], + ['psit_ins_ext',57.29,'外部GPS航迹偏航角(deg)',0], + ['q_ahrs_ext',57.29,'外部惯导俯仰角速度(deg/sec)',0], + ['p_ahrs_ext',57.29,'外部惯导滚转角速度(deg/sec)',0], + ['r_ahrs_ext',57.29,'外部惯导偏航角速度(deg/sec)',0], + ['gps_hdg',57.29,'外部GPS双天线航向(deg)',0], + ['gps_hdg_dev',57.29,'外部GPS双天线航向标准差(deg)',0], + ['lon_gps_ext',1,'外部GPS经度(deg)',0], + ['lat_gps_ext',1,'外部GPS纬度(deg)',0], + ['alt_gps_ext',1,'外部GPS高度(m)',0], + ['vn_ins_ext',1,'外部惯导北向速度(m/s)',0], + ['ve_ins_ext',1,'外部惯导东向速度(m/s)',0], + ['vu_ins_ext',-1,'外部惯导天向速度(m/s)',0], + ['acc_n_ext',1,'外部惯导北向加速度(m/s2)',0], + ['acc_e_ext',1,'外部惯导东向加速度(m/s2)',0], + ['acc_d_ext',1,'外部惯导地向加速度(m/s2)',0], + ['vn_gps_ext',1,'外部gps北向速度(m/s)',0], + ['ve_gps_ext',1,'外部gps东向速度(m/s)',0], + ['vu_gps_ext',-1,'外部gps天向速度(m/s)',0], + ['satnum_ext',1,'外部卫星星数',0], + ['gps_fixtype',1,'外部惯导定位类型',0], + ['gps_hous',1,'GPS时',0], + ['gps_minute',1,'GPS分',0], + ['gps_second',1,'GPS秒',0], + ['gps_day',1,'GPS周内天',0], + ['work_state',1,'工作状态',0], + ['gps_month',1,'GPS月',0], + ['gps_year',1,'GPS年',0], + ['gps_week',1,'GPS周',0], + ['gps_msec',1,'GPS秒内毫秒',0], + ['hdop',1,'水平精度因子',0], + ['vdop',1,'垂直精度因子',0], + ['temperature',1,'摄氏度',0], + ], + [], + ], + 6: [struct.Struct('<4IHd6f'), + [['boot_time',0.005,'时间戳',0], + ['tow_ms',1,'tow_ms',0], + ['GPSWeek_uint32',1,'GPSWeek_uint32',0], + ['imu_status',1,'imu_status',0], + ['GPSWeek_uint16',1,'GPSWeek_uint16',0], + ['tow_s',1,'tow_s',0], + ['az_ins_ext',-1,'外部惯导上向加速度(m/s2)',0], + ['ax_ins_ext',1,'外部惯导前向加速度(m/s2)',0], + ['ay_ins_ext',1,'外部惯导侧向加速度(m/s2)',0], + ['r_ins_ext',57.29,'外部惯导偏航角速度(deg/sec)',0], + ['p_ins_ext',57.29,'外部惯导滚转角速度(deg/sec)',0], + ['q_ins_ext',57.29,'外部惯导俯仰角速度(deg/sec)',0], + ], + [], + ], + 7: [struct.Struct('