diff --git a/HISTORY.md b/HISTORY.md index 0d15514..5f2eae0 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,7 +1,25 @@ # CHANGELOG --- -## 2.6.6, 08/25/2022 +## 2.6.7, 02/15/2023 +- [INS402] Add ins402 parse command +- [INS401] Add parameter configuration type to be filtered to resolve timeout issue +- [INS401C] modify canfd setings, add can_id 0x181 0x282 +- [INS401C] set lever format issue +- [INS401] log corrimu data +- [INS401] Add FreeRTOS of ins firmware, after upgrade sta9100 SDK firmware, GPGGA fixed type is RTK_FLOAT +- [INS401C] print ins401c serial number +- [INS401] print ins and gnss lib version +- [INS401] modify ins401c gyro unit +- [INS402] add antenna switch enable(default value: 0) for INS402 8100 double antenna version +- [INS402] add dual ant cali config +- [INS402C] update canfd protocol +- [INS402C] enable log id: 0x181, 0x282 +- [INS402C] modify .json file: modify canfd and can factor and unit of sigal GYRO_X GYRO_Y GYRO_Z, 0.0076293 to 0.00762951, unit s to deg/s +- [INS401/INS402]Add set ins401 and ins402 unit serial number command, ".\acenav.exe -i 100base-t1 -sn XXXXXX" or ".\acenav.exe -i 100base-t1 --device-type INS402 -sn XXXXXX" +- [INS402C] Update User DecoderLib + +## 2.6.6, 09/23/2022 - [INS401] The reply message 0xcc01 can't be received after the "JS" command is executed. - [INS401] GPZDA messages are saved to log, compatible with Sta9100 and Mosaic. @@ -15,6 +33,24 @@ - [INS401] After imu boot upgradation, the IMU fails to switch to boot because the baud rate of the IMU serial port is changed. - [INS401] The default firmware upgrades include RTK, INS, and STA9100 SDK. +- [INS401] The sta9100 upgrade improve +- [INS401] optimized the problem which is getting ins401 configuration parameters messages timeout +- [INS401] update the delay for jumping to the bootloader during the upgraded firmware +- [INS401C] canfd python env issue and canfd set lever issue +- [BEIDOU] modify beidou config file, add binary commands +- [BEIDOU] log unico raw data and update beidou.json +- [INS401] Ethernet cache queue increases +- [INS401] Updated the function of obtaining the botloader version number +- [INS401] optimized the problem which is getting ins401 configuration parameters messages timeout +- [INS401] update the delay for jumping to the bootloader during the upgraded firmware +- [INS401] After Failed to send the IMU "JI" command occasionally, add system reset, Ethernet reconnection, and IMU "JI" command resend functions +- [INS401] Supports multiple Spaces and TAB keys to separate firmware upgrade commands +- [INS401] modify ins401.json file: change offset of INS_PitchAngle INS_RollAngle INS_HeadingAngle to -360 from -250 +- [INS402] support ins402 firmware fully upgrade, contains a default list of the modules which are rtk, ins, sdk and sdk_2. +- [INS402] support the firmware upgrade of a single optional module +- [INS402] Add ins402 NHC switch parameter configuration +- [INS402] Optimized the sta9100 firmware upgrade +- [INS401] fix other bugs ## 2.6.5, 04/11/2022 diff --git a/README.md b/README.md index 6184743..ada02b8 100644 --- a/README.md +++ b/README.md @@ -27,55 +27,108 @@ Run the CLI software and connect with the INS401 system for the first time, ther #### Log data -Run the following command to log all data output from Ethernet port to binary files, and streaming GNSS RTK correction data through Ethernet port to INS401 (e.g. on Ubuntu) +Run the following command to log all data output from Ethernet port to binary files, and streaming GNSS RTK correction data through Ethernet port to the unit (e.g. on Ubuntu) +## INS401 ```shell ./acenav -i 100base-t1 ``` +## INS402 +```shell +./acenav -i 100base-t1 --device-type INS402 +``` + A “data” subfolder will be created for the first time, and every session of data logging will be stored in a subfolder inside the “data” folder. #### Parse Data Run the following command to parse the logged data into text or csv files, +## ins401 + ```shell ./acenav parse -t ins401 -p ``` +## ins402 + +```shell +./acenav parse -t ins402 -p +``` + #### Save Settings -If user changed the GNSS/INS user settings in the "ins401.json" file, and wants to make it effective, run the data logging command with "-s" option like below, and the changed user settings will be saved into flash +If user changed the GNSS/INS user settings in the "ins401.json" or "ins402.json" file, and wants to make it effective, run the data logging command with "-s" option like below, and the changed user settings will be saved into flash + +## ins401 ```shell ./acenav -i 100base-t1 -s ``` +## ins402 + +```shell +./acenav -i 100base-t1 --device-type INS402 -s +``` ## Firmware Upgrade +# INS401 Firmware Upgrade + INS401 supports In-Application Programming (IAP) firmware upgrade through the Ethernet interface, run the executable with the CLI option, and prompt for user input ```shell ./acenav -i 100base-t1 --cli # console display with connection information # prompt for user input, type in command and file path after the arrow symbol -# firmware is fully upgraded by default +# firmware is fully upgraded by default, contains a list of the components which are +# rtk, ins and sdk >>upgrade -# one or more firmware parts(rtk, ins, sdk, imu_boot(if firmware is merged), imu(if firmware is merged)) +# one or more firmware components (rtk, ins, sdk, imu_boot(if firmware is merged), imu(if firmware is merged)) # are optionally upgraded ->>upgrade rtk ins -or ->>upgrade sdk -or ->>upgrade imu -or ->>upgrade imu_boot +>>upgrade + +eg: +>>upgrade rtk ins sdk imu_boot imu ``` After successful FW upgrade, the INS401 system restarts and starts logging data automatically. -## canfd app +# INS402 Firmware Upgrade + +INS402 supports In-Application Programming (IAP) firmware upgrade through the Ethernet interface, run the executable with the CLI option, and prompt for user input + +```shell +./acenav -i 100base-t1 --device-type INS402 --cli +# console display with connection information +# prompt for user input, type in command and file path after the arrow symbol +# firmware is fully upgraded by default, contains a list of the components which are +# rtk, ins, sdk and sdk_2 +>>upgrade + +# one or more firmware components(rtk, ins, sdk, sdk_2, imu_boot(if firmware is merged), imu(if firmware is merged)) are optionally upgraded +>>upgrade + +eg: +>>upgrade rtk ins sdk sdk_2 imu_boot imu +``` + +After successful FW upgrade, the INS402 system restarts and starts logging data automatically. + +## Set the Unit Serial Number +# ins401 +```shell +./acenav -i 100base-t1 -sn +``` + +# ins402 +```shell +./acenav -i 100base-t1 --device-type INS402 -sn +``` + +# canfd app ### run please run $Env:PYTHONPATH="./src/aceinna/devices/widgets;"+$Env:PYTHONPATH in powershell @@ -90,4 +143,4 @@ set "canfd_type": "canfd", set "canfd_type": "can" #### Parse -***python main.py parse -t ins401c -p *** +./acenav parse -t ins401c -p diff --git a/run_with_bat.bat b/run_with_bat.bat index 305bc37..904bad4 100644 --- a/run_with_bat.bat +++ b/run_with_bat.bat @@ -1,5 +1,6 @@ set PYTHONPATH=.;./src/aceinna/devices/widgets;%PYTHONPATH% +set PATH=./src/aceinna/devices/widgets/can/interfaces/bmcan;%PATH% -python main.py -i canfd %1 +python main.py -i canfd %2 @echo kill python driver... \ No newline at end of file diff --git a/src/aceinna/__init__.py b/src/aceinna/__init__.py index f8e5f4c..21524c4 100644 --- a/src/aceinna/__init__.py +++ b/src/aceinna/__init__.py @@ -1,3 +1,3 @@ # Package Version -VERSION = '2.6.6' +VERSION = '2.6.7' PACKAGE_NAME = 'acenav' diff --git a/src/aceinna/bootstrap/canfd_driver.py b/src/aceinna/bootstrap/canfd_driver.py index 42fde43..ab8c4aa 100644 --- a/src/aceinna/bootstrap/canfd_driver.py +++ b/src/aceinna/bootstrap/canfd_driver.py @@ -109,6 +109,9 @@ def __init__(self, **kwargs) -> None: self.imu_version_id = 0 self.get_lever_arm_id = 0 self.set_lever_arm_id = 0 + self.set_lever_config = None + self.lever_arm_get_config = None + self.lever_arm_valid_len = 0 self.prepare_can_setting() self.prepare_log_config() args=[r"powershell",r"$Env:PYTHONPATH=\"./src/aceinna/devices/widgets;\"+$Env:PYTHONPATH"] @@ -128,6 +131,8 @@ def prepare_can_setting(self): self.can_id_list = self.canfd_setting["canfd_id"] output = next((x for x in self.canfd_setting['canfd_messages'] if x['id'] == 640), None) self.set_lever_arm_id = next((x['id'] for x in self.canfd_setting['canfd_messages'] if x['name'] == 'LEVER_ARM_SET'), None) + self.set_lever_config = next((x['signals'] for x in self.canfd_setting['canfd_messages'] if x['name'] == 'LEVER_ARM_SET'), None) + self.lever_arm_get_config = next((x['signals'] for x in self.canfd_setting['canfd_remote_messages'] if x['name'] == 'LEVER_ARM_GET'), None) else: self.can_id_list = self.canfd_setting["can_id"] output = next((x for x in self.canfd_setting['can_messages'] if x['id'] == 640), None) @@ -192,7 +197,11 @@ def prepare_can_setting(self): for inode in self.canfd_setting['canfd_remote_messages']: if(inode['valid_len'] > 0): length = 0 - pack_fmt = '<' + if inode['name'] == 'LEVER_ARM_GET': + pack_fmt = '>' + self.lever_arm_valid_len = inode['valid_len'] + else: + pack_fmt = '<' self.id_name[inode["id"]] = inode["name"] for value in inode['signals']: if value['type'] == 'float': @@ -288,13 +297,13 @@ def prepare_can_setting(self): def load_properties(self): local_config_file_path = os.path.join( - os.getcwd(), 'setting/INS401/RTK_INS/ins401.json') - setting_folder_path = 'setting/INS401/RTK_INS' + os.getcwd(), 'setting/INS402/RTK_INS/ins402c.json') + setting_folder_path = 'setting/INS402/RTK_INS' if not os.path.isdir(setting_folder_path): os.makedirs(setting_folder_path) if not os.path.isfile(local_config_file_path): app_config_content = resource.get_content_from_bundle( - 'setting','INS401\\RTK_INS\\ins401.json') + 'setting','INS402\\RTK_INS\\ins402c.json') with open(local_config_file_path, "wb") as code: code.write(app_config_content) if os.path.isfile(local_config_file_path): @@ -356,8 +365,8 @@ def _build_device_info(self, ins_text, sta_text, imu_text): 'firmware_version': firmware_version, 'sn': sn } - version = 'RTK_INS App {0} Bootloader {1} IMU330ZA FW {2} STA9100 FW {3}'.format( - firmware_version, boot, imu, sta + version = 'RTK_INS App {0} Bootloader {1} IMU330ZA FW {2} STA9100 FW {3} SN {4}'.format( + firmware_version, boot, imu, sta, sn ) self.app_info = { 'app_name': 'INS401c', @@ -365,18 +374,38 @@ def _build_device_info(self, ins_text, sta_text, imu_text): } def get_lever_arm_dict(self, lever_arm_packet): parameters_configuration = dict() - parameters_configuration['gnss lever arm x'] = lever_arm_packet[0] - parameters_configuration['gnss lever arm y'] = lever_arm_packet[1] - parameters_configuration['gnss lever arm z'] = lever_arm_packet[2] - parameters_configuration['vrp lever arm x'] = lever_arm_packet[3] - parameters_configuration['vrp lever arm y'] = lever_arm_packet[4] - parameters_configuration['vrp lever arm z'] = lever_arm_packet[5] - parameters_configuration['user lever arm x'] = lever_arm_packet[6] - parameters_configuration['user lever arm y'] = lever_arm_packet[7] - parameters_configuration['user lever arm z'] = lever_arm_packet[8] - parameters_configuration['rotation rbvx'] = lever_arm_packet[9] - parameters_configuration['rotation rbvy'] = lever_arm_packet[10] - parameters_configuration['rotation rbvz'] = lever_arm_packet[11] + data_value = list() + for i in range(len(lever_arm_packet)): + + try: + if self.lever_arm_get_config[i]['is_float'] == True: + offset = float(self.lever_arm_get_config[i]['offset']) + factor = float(self.lever_arm_get_config[i]['factor']) + else: + offset = float(self.lever_arm_get_config[i]['offset']) + factor = float(self.lever_arm_get_config[i]['factor']) + except Exception as e: + print(e, self.lever_arm_get_config[i]['is_float'], type(self.lever_arm_get_config[i]['is_float'])) + data_value.append(lever_arm_packet[i]*factor + offset) + + parameters_configuration['gnss lever arm x'] = data_value[0] + parameters_configuration['gnss lever arm y'] = data_value[1] + parameters_configuration['gnss lever arm z'] = data_value[2] + parameters_configuration['vrp lever arm x'] = data_value[3] + parameters_configuration['vrp lever arm y'] = data_value[4] + parameters_configuration['vrp lever arm z'] = data_value[5] + parameters_configuration['user lever arm x'] = data_value[6] + parameters_configuration['user lever arm y'] = data_value[7] + parameters_configuration['user lever arm z'] = data_value[8] + parameters_configuration['rotation rbvx'] = data_value[9] + parameters_configuration['rotation rbvy'] = data_value[10] + parameters_configuration['rotation rbvz'] = data_value[11] + parameters_configuration['sec lever arm x'] = data_value[12] + parameters_configuration['sec lever arm y'] = data_value[13] + parameters_configuration['sec lever arm z'] = data_value[14] + parameters_configuration['dual ant switch'] = data_value[15] + parameters_configuration['dual ant baseline length'] = data_value[16] + parameters_configuration['dual ant heading cali'] = data_value[17] return parameters_configuration def save_device_info(self): @@ -387,7 +416,10 @@ def save_device_info(self): imu_result = self.get_imu_message() time.sleep(0.1) lever_arm_result = self.get_lever_arm_message() - data = struct.pack(self.remote_pkfmt['LEVER_ARM_GET']['len_b'], *lever_arm_result['data']) + try: + data = struct.pack(self.remote_pkfmt['LEVER_ARM_GET']['len_b'], *lever_arm_result['data'][0:self.lever_arm_valid_len]) + except Exception as e: + print(e) lever_arm_packet = struct.unpack(self.remote_pkfmt['LEVER_ARM_GET']['pack'], data) device_configuration = None fname_time = self.fname_time + '_configuration.json' @@ -506,10 +538,18 @@ def get_lever_arm_message(self): def set_ins401c_lever_arm(self, data): data_list = [] - for item in data: - data_list.append(item["value"]) - para_len = self.pkfmt['LEVER_ARM_SET']['len'] / 4 - data_bytes = struct.pack('{0}f'.format(int(para_len)), *data_list) + for i in range(len(data)): + data_ori = data[i]["value"] + test = 0 + offset = float(self.set_lever_config[i]['offset']) + factor = float(self.set_lever_config[i]['factor']) + try: + data_list.append( int((data_ori - offset) / factor) ) + except Exception as e: + print(e) + + para_len = self.pkfmt['LEVER_ARM_SET']['len'] / 2 + data_bytes = struct.pack('>{0}H'.format(int(para_len)), *data_list) self.canfd_handle.write(self.set_lever_arm_id, list(data_bytes), False, False, True) def check_predefined_result(self): @@ -518,7 +558,7 @@ def check_predefined_result(self): file_path = os.path.join(self.path, fname_time) # save parameters to data log folder after predefined parameters setup lever_arm_result = self.get_lever_arm_message() - data = struct.pack(self.remote_pkfmt['LEVER_ARM_GET']['len_b'], *lever_arm_result['data']) + data = struct.pack(self.remote_pkfmt['LEVER_ARM_GET']['len_b'], *lever_arm_result['data'][0:self.lever_arm_valid_len]) lever_arm_packet = struct.unpack(self.remote_pkfmt['LEVER_ARM_GET']['pack'], data) parameters_configuration = self.get_lever_arm_dict(lever_arm_packet) with open(file_path, 'w') as outfile: @@ -532,7 +572,7 @@ def check_predefined_result(self): for key in hashed_predefined_parameters: # if parameters_configuration[key] == \ # hashed_predefined_parameters[key]['value']: - if abs(parameters_configuration[key] - hashed_predefined_parameters[key]['value'] < 0.1e5): + if abs(parameters_configuration[key] - hashed_predefined_parameters[key]['value'] < 0.1e4): success_count += 1 else: fail_count += 1 diff --git a/src/aceinna/bootstrap/cli.py b/src/aceinna/bootstrap/cli.py index 1c83311..a6dcc9c 100644 --- a/src/aceinna/bootstrap/cli.py +++ b/src/aceinna/bootstrap/cli.py @@ -7,6 +7,7 @@ import threading from os import getpid import psutil +import re # from .web import Webserver from ..models import WebserverArgs @@ -149,9 +150,8 @@ def setup_command_handler(self): token = input(">>") else: token = input("") - - self.input_string = token.split(" ") - + + self.input_string = re.split(r'\s+', token) if token.strip() == 'exit': break diff --git a/src/aceinna/bootstrap/log_parser.py b/src/aceinna/bootstrap/log_parser.py index aa88654..78b6584 100644 --- a/src/aceinna/bootstrap/log_parser.py +++ b/src/aceinna/bootstrap/log_parser.py @@ -50,7 +50,7 @@ def do_parse(log_type, folder_path, kml_rate, dr_parse): lib.decode_openrtk_inceptio(bytes(file_path, encoding='utf8')) elif log_type == 'beidou': lib.decode_beidou(bytes(file_path, encoding='utf8'), kml_rate) - elif log_type == 'ins401': + elif log_type == 'ins401' or log_type == 'ins402': lib.decode_ins401(bytes(file_path, encoding='utf8'), bytes(dr_parse, encoding='utf8'), kml_rate) elif log_type == 'ins401c': lib.decode_ins401c(bytes(file_path, encoding='utf8')) diff --git a/src/aceinna/devices/configs/ins401_predefine.py b/src/aceinna/devices/configs/ins401_predefine.py index f6e22a2..4f6f22c 100644 --- a/src/aceinna/devices/configs/ins401_predefine.py +++ b/src/aceinna/devices/configs/ins401_predefine.py @@ -26,4 +26,4 @@ def get_ins402_configuratin_file_mapping(): 'INS402':'ins402.json' } -APP_STR = ['RAWDATA', 'RTK', 'RTK_INS'] +APP_STR = ['RAWDATA', 'RTK', 'RTK_INS', 'RTK_INS_CANFD'] diff --git a/src/aceinna/devices/decorator.py b/src/aceinna/devices/decorator.py index f68e13c..13cd1e4 100644 --- a/src/aceinna/devices/decorator.py +++ b/src/aceinna/devices/decorator.py @@ -1,4 +1,5 @@ import functools +import time from .message_center import (DeviceMessage) @@ -17,6 +18,7 @@ def wrapper(*args, **kwargs): def check_result(): global generator_result while not generator_result: + time.sleep(0.05) continue if generator_result: @@ -25,12 +27,14 @@ def check_result(): generator_result = None next_device_message.on('finished', on_resolve) next_device_message.send() + return check_result() else: return next_device_message def on_resolve(*args, **kwargs): global generator_result + generator_result = { 'packet_type': kwargs['packet_type'], 'data': kwargs['data'], diff --git a/src/aceinna/devices/ins401/ethernet_provider_base.py b/src/aceinna/devices/ins401/ethernet_provider_base.py index 98dc9cb..4b17656 100644 --- a/src/aceinna/devices/ins401/ethernet_provider_base.py +++ b/src/aceinna/devices/ins401/ethernet_provider_base.py @@ -31,6 +31,9 @@ GNZDA_DATA_LEN = 39 +SDK_UPGRADE_CHIP_FIRST = 1 +SDK_UPGRADE_CHIP_SECOND = 2 + class Provider_base(OpenDeviceBase): ''' INS401 Ethernet 100base-t1 provider @@ -74,13 +77,15 @@ def __init__(self, communicator, *args): self.rtk_upgrade_flag = False self.ins_upgrade_flag = False self.sdk_upgrade_flag = False + self.sdk_2_upgrade_flag = False self.imu_upgrade_flag = False self.imu_boot_upgrade_flag = False self.unit_sn = None self.bootloader_version = None self.rtk_crc = [] self.ins_crc = [] - self.sdk_upgrade_chip_type = 1 + self.loop_upgrade_flag = False + def prepare_folders(self): ''' @@ -121,33 +126,41 @@ def _build_compile_info(self, text): ''' Build compile info ''' - split_text = text.split(',') - self.compile_info = { - 'ins_lib':{ - 'version': split_text[0], - 'time': split_text[1], - 'author': split_text[2], - 'commit':split_text[3] - }, - 'ins_app':{ - 'version': split_text[4], - 'time': split_text[5], - 'author': split_text[6], - 'commit':split_text[7] - }, - 'rtk_lib':{ - 'version': split_text[8], - 'time': split_text[9], - 'author': split_text[10], - 'commit':split_text[11] - }, - 'rtk_app':{ - 'version': split_text[12], - 'time': split_text[13], - 'author': split_text[14], - 'commit':split_text[15] + split_text = text.replace(" ", "").split(',') + if len(split_text) > 2: + self.compile_info = { + 'ins_lib':{ + 'version': split_text[0], + 'time': split_text[1], + 'author': split_text[2], + 'commit':split_text[3] + }, + 'ins_app':{ + 'version': split_text[4], + 'time': split_text[5], + 'author': split_text[6], + 'commit':split_text[7] + }, + 'rtk_lib':{ + 'version': split_text[8], + 'time': split_text[9], + 'author': split_text[10], + 'commit':split_text[11] + }, + 'rtk_app':{ + 'version': split_text[12], + 'time': split_text[13], + 'author': split_text[14], + 'commit':split_text[15] + } + } + else: + self.compile_info = { + 'lib_version':{ + 'ins': split_text[0], + 'gnss': split_text[1] + } } - } print(self.compile_info) def _build_device_info(self, text): ''' @@ -282,8 +295,7 @@ def after_setup(self): # check saved result self.check_predefined_result() - - + if set_mount_angle: self.set_mount_angle() self.prepare_lib_folder() @@ -559,7 +571,7 @@ def do_reshake(self): if result: break else: - time.sleep(0.5) + time.sleep(1) def before_write_content(self, core, content_len, ack_enable): command_CS = [0x04, 0xaa] @@ -753,11 +765,23 @@ def build_worker(self, rule, content): sdk_upgrade_worker = EthernetSDK9100UpgradeWorker( self.communicator, lambda: helper.format_firmware_content(content), - self.sdk_upgrade_chip_type + SDK_UPGRADE_CHIP_FIRST ) sdk_upgrade_worker.group = UPGRADE_GROUP.FIRMWARE + return sdk_upgrade_worker + if rule == 'sdk_2' and self.sdk_2_upgrade_flag: + sdk2_upgrade_worker = EthernetSDK9100UpgradeWorker( + self.communicator, + lambda: helper.format_firmware_content(content), + SDK_UPGRADE_CHIP_SECOND + ) + sdk2_upgrade_worker.group = UPGRADE_GROUP.FIRMWARE + + return sdk2_upgrade_worker + + if self.imu_boot_upgrade_flag: if rule == 'imu_boot': ethernet_ack_enable = True @@ -830,12 +854,26 @@ def get_upgrade_workers(self, firmware_content): if rule == 'ins': ins_len = len(content) & 0xFFFF self.ins_crc = helper.calc_crc(content[0:ins_len]) + - worker = self.build_worker(rule, content) - if not worker: - continue + if rule == 'sdk': + if self.sdk_upgrade_flag: + worker = self.build_worker(rule, content) + if worker: + workers.append(worker) + + if self.sdk_2_upgrade_flag: + worker = self.build_worker('sdk_2', content) + if worker: + workers.append(worker) + + else: + worker = self.build_worker(rule, content) + if not worker: + continue - workers.append(worker) + workers.append(worker) + # wrap rtk and ins start_index = -1 @@ -856,7 +894,9 @@ def get_upgrade_workers(self, firmware_content): ethernet_ack_enable, command=self.ins_jump_bootloader_command_generator, listen_packet=[0x01, 0xaa], - wait_timeout_after_command=ins_wait_timeout) + wait_timeout_after_command=ins_wait_timeout, + ethernet_reshake=None, + system_reset=None) ins_jump_bootloader_worker.group = UPGRADE_GROUP.FIRMWARE ins_jump_bootloader_worker.on( UPGRADE_EVENT.BEFORE_COMMAND, self.do_reshake) @@ -894,7 +934,9 @@ def get_upgrade_workers(self, firmware_content): ethernet_ack_enable, command=self.imu_jump_bootloader_command_generator, listen_packet=[0x4a, 0x49], - wait_timeout_after_command=15) + wait_timeout_after_command=15, + ethernet_reshake=self.do_reshake, + system_reset=self.send_system_reset_command) imu_boot_jump_bootloader_worker.on( UPGRADE_EVENT.BEFORE_COMMAND, self.do_reshake) imu_boot_jump_bootloader_worker.on( @@ -929,7 +971,9 @@ def get_upgrade_workers(self, firmware_content): ethernet_ack_enable, command=self.imu_jump_bootloader_command_generator, listen_packet=[0x4a, 0x49], - wait_timeout_after_command=15) + wait_timeout_after_command=15, + ethernet_reshake=self.do_reshake, + system_reset=self.send_system_reset_command) imu_jump_bootloader_worker.on( UPGRADE_EVENT.BEFORE_COMMAND, self.do_reshake) imu_jump_bootloader_worker.on( @@ -1062,6 +1106,7 @@ def after_upgrade_completed(self): and not self.is_in_bootloader: threading.Thread(target=self.ntrip_client_thread).start() + self.loop_upgrade_flag = False pass # command list @@ -1142,7 +1187,6 @@ def get_params(self, *args): # pylint: disable=unused-argument break parameter_values.append(result['data']) - time.sleep(0.3) if not has_error: self.parameters = parameter_values @@ -1201,7 +1245,6 @@ def set_params(self, params, *args): # pylint: disable=unused-argument if data['error'] > 0: yield {'packetType': 'error', 'data': {'error': data}} break - time.sleep(0.1) yield {'packetType': 'success', 'data': {'error': 0}} @@ -1236,8 +1279,6 @@ def save_config(self, *args): # pylint: disable=unused-argument self.communicator.get_dst_mac(), self.communicator.get_src_mac(), sC) - # self.communicator.write(command_line) - # result = self.get_input_result('sC', timeout=2) result = yield self._message_center.build(command=command_line.actual_command, timeout=2) @@ -1299,6 +1340,30 @@ def get_compile_message(self): yield {'packetType': 'error', 'data': {'error': error}, 'raw_data': {'error': error}} yield {'packetType': 'success', 'data': data, 'raw_data': raw_data} + + @with_device_message + def set_unit_sn_message(self): + command_sn = b'\x01\xfc' + message_bytes = [] + + if self.communicator and self.communicator.config_unit_sn: + config_unit_sn = int(self.communicator.config_unit_sn) + message_bytes.append(config_unit_sn & 0xFF) + message_bytes.append((config_unit_sn >> 8) & 0xFF) + message_bytes.append((config_unit_sn >> 16) & 0xFF) + message_bytes.append((config_unit_sn >> 24) & 0xFF) + command_line = helper.build_ethernet_packet( + self.communicator.get_dst_mac(), self.communicator.get_src_mac(), + command_sn, message_bytes) + result = yield self._message_center.build(command=command_line.actual_command, timeout=3) + error = result['error'] + data = result['data'] + raw_data = result['raw'] + if error: + yield {'packetType': 'error', 'data': {'error': error}, 'raw_data': {'error': error}} + else: + self.send_system_reset_command() + os._exit(1) @with_device_message def reset_params(self, params, *args): # pylint: disable=unused-argument diff --git a/src/aceinna/devices/ins401/ethernet_provider_ins401.py b/src/aceinna/devices/ins401/ethernet_provider_ins401.py index bfbe5c1..f920a7d 100644 --- a/src/aceinna/devices/ins401/ethernet_provider_ins401.py +++ b/src/aceinna/devices/ins401/ethernet_provider_ins401.py @@ -139,7 +139,8 @@ def after_setup(self): # check saved result self.check_predefined_result() - + + self.set_unit_sn_message() if set_mount_angle: self.set_mount_angle() @@ -291,6 +292,7 @@ def upgrade_framework(self, params, *args): # pylint: disable=unused-argument if not self.is_upgrading: self.is_upgrading = True self._message_center.pause() + self.loop_upgrade_flag = True if self._logger is not None: self._logger.stop_user_log() diff --git a/src/aceinna/devices/ins401/ethernet_provider_ins402.py b/src/aceinna/devices/ins401/ethernet_provider_ins402.py index 87465f5..41625a5 100644 --- a/src/aceinna/devices/ins401/ethernet_provider_ins402.py +++ b/src/aceinna/devices/ins401/ethernet_provider_ins402.py @@ -139,7 +139,8 @@ def after_setup(self): # check saved result self.check_predefined_result() - + + self.set_unit_sn_message() if set_mount_angle: self.set_mount_angle() @@ -212,7 +213,7 @@ def on_receive_output_packet(self, packet_type, data, *args, **kwargs): if packet_type == b'\x06\n': if self.rtcm_rover_logf: self.rtcm_rover_logf.write(bytes(data)) - elif packet_type == b'\x08\n': + elif packet_type == b'\x0c\x0a': if self.rtcm_rover2_logf: self.rtcm_rover2_logf.write(bytes(data)) else: @@ -251,6 +252,7 @@ def upgrade_framework(self, params, *args): # pylint: disable=unused-argument self.rtk_upgrade_flag = False self.ins_upgrade_flag = False self.sdk_upgrade_flag = False + self.sdk_2_upgrade_flag = False self.imu_upgrade_flag = False self.imu_boot_upgrade_flag = False @@ -264,12 +266,10 @@ def upgrade_framework(self, params, *args): # pylint: disable=unused-argument self.ins_upgrade_flag = True if param == 'sdk': - self.sdk_upgrade_flag = True - self.sdk_upgrade_chip_type = 1 + self.sdk_upgrade_flag = True if param == 'sdk_2': - self.sdk_upgrade_flag = True - self.sdk_upgrade_chip_type = 2 + self.sdk_2_upgrade_flag = True if param == 'imu_boot': self.imu_boot_upgrade_flag = True @@ -283,13 +283,15 @@ def upgrade_framework(self, params, *args): # pylint: disable=unused-argument self.rtk_upgrade_flag = True self.ins_upgrade_flag = True self.sdk_upgrade_flag = True - self.imu_upgrade_flag = True - self.imu_boot_upgrade_flag = True + self.sdk_2_upgrade_flag = True + self.imu_upgrade_flag = False + self.imu_boot_upgrade_flag = False # start a thread to do upgrade if not self.is_upgrading: self.is_upgrading = True self._message_center.pause() + self.loop_upgrade_flag = True if self._logger is not None: self._logger.stop_user_log() diff --git a/src/aceinna/devices/parsers/ins401_message_parser.py b/src/aceinna/devices/parsers/ins401_message_parser.py index 7319298..abefdae 100644 --- a/src/aceinna/devices/parsers/ins401_message_parser.py +++ b/src/aceinna/devices/parsers/ins401_message_parser.py @@ -16,7 +16,7 @@ INPUT_PACKETS = [b'\x01\xcc', b'\x02\xcc', b'\x03\xcc', b'\x04\xcc', b'\x05\xcc',b'\x06\xcc', b'\x01\x0b', b'\x02\x0b', b'\x09\x0a', b'\x09\xaa', b'\x01\xfc'] -OTHER_OUTPUT_PACKETS = [b'\x01\n', b'\x02\n', b'\x03\n', b'\x04\n', b'\x05\n', b'\x06\n', b'\x08\n',b'\x09\x0a', b'\x0a\x0a', b'\x0b\x0a', +OTHER_OUTPUT_PACKETS = [b'\x01\n', b'\x02\n', b'\x03\n', b'\x04\n', b'\x05\n', b'\x06\n', b'\x08\n',b'\x09\x0a', b'\x0a\x0a', b'\x0b\x0a', b'\x0c\x0a', b'\x07\n', b'\x09\xaa', b'\x44\x4D', b'\x49\x67', b'\x64\x66'] diff --git a/src/aceinna/devices/upgrade_workers/ethernet_sdk_9100_worker.py b/src/aceinna/devices/upgrade_workers/ethernet_sdk_9100_worker.py index 7542ac7..7e8861a 100644 --- a/src/aceinna/devices/upgrade_workers/ethernet_sdk_9100_worker.py +++ b/src/aceinna/devices/upgrade_workers/ethernet_sdk_9100_worker.py @@ -1818,6 +1818,17 @@ def __init__(self, communicator, file_content, dev_9100=1): self.baud_change_enable = 0 self.new_boot_enable = 0 + self.sync_repeat_count = 100 + self.wait_sync = 100 + self.wait_ack = 3500 + self.wait_read_driver = 100 + self.wait_short_ack = 1000 + self.wait_erase_factor = 60000 + self.erase_factors = 4 + self.wait_erase_all = self.wait_erase_factor * self.erase_factors + self.wait_nvm_erase = 5000 + self.wait_crc = 30000 + self.passthrough_time = 15 def write_wrapper(self, dst, src, send_method, data): send_command = helper.build_ethernet_packet( @@ -1883,9 +1894,10 @@ def get_list_from_int(self, value): value_list[3] = (value >> 24) & 0xff return value_list - def read_until(self, check_data, read_times=1000, read_len=None): + def read_until(self, check_data, time_delay): is_match = False - + time_delay+= self.passthrough_time + read_times = int(time_delay/10) while read_times > 0: packet_raw = self._communicator.read() if packet_raw is None: @@ -1979,13 +1991,13 @@ def send_sync(self): return False sync = [0xfd, 0xc6, 0x49, 0x28] - retry_times = 20 + retry_times = self.sync_repeat_count is_matched = False for i in range(retry_times): self.send_packet(sync) time.sleep(0.05) - is_matched = self.read_until([0x3A, 0x54, 0x2C, 0xA6], 10) + is_matched = self.read_until([0x3A, 0x54, 0x2C, 0xA6], self.wait_sync) if is_matched: break @@ -2000,11 +2012,11 @@ def send_change_baud_cmd(self): for i in range(3): self.send_packet(change_baud_cmd) time.sleep(1) - result = self.read_until(0xCC, 500, 1) + result = self.read_until(0xCC, 500) if result: break return result - + ''' def send_baud(self, baud_int): if self._is_stopped: return False @@ -2032,6 +2044,35 @@ def baud_check(self): break return result + ''' + def reopen_communication(self): + self._communicator.reset_buffer() + time.sleep(0.5) + + + def change_baud(self, baud_int): + print('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') + if self._is_stopped: + return False + change_baud_cmd = [0x71] + self.send_packet(change_baud_cmd) + baud_list = [] + baud_list = self.get_list_from_int(baud_int) + + self.send_packet(baud_list) + has_read = self.read_until(0xCC, self.wait_ack) + if has_read: + self.reopen_communication() + return has_read + + def baud_check(self): + if self._is_stopped: + return False + + check_baud = [0x38] + + self.send_packet(check_baud) + return self.read_until(0xCC, self.wait_read_driver) def is_host_ready(self): if self._is_stopped: @@ -2041,7 +2082,7 @@ def is_host_ready(self): for i in range(5): self.send_packet(host) - result = self.read_until(0xCC, 1000, 1) + result = self.read_until(0xCC, self.wait_short_ack) if result: break @@ -2079,7 +2120,7 @@ def send_boot(self): self.send_packet(boot_part2) for _ in range(3): - is_match = self.read_until(0xCC, 1000, 1) + is_match = self.read_until(0xCC, self.wait_ack) if is_match: return True time.sleep(1) @@ -2120,7 +2161,7 @@ def send_new_boot(self): self.send_packet(boot_part3) for _ in range(3): - is_match = self.read_until(0xCC, 1000, 1) + is_match = self.read_until(0xCC, self.wait_ack) if is_match: return True time.sleep(1) @@ -2135,7 +2176,7 @@ def send_write_flash_cmd(self): for i in range(3): self.send_packet(write_cmd) time.sleep(3) - result = self.read_until(0xCC, 1000, 1) + result = self.read_until(0xCC, self.wait_ack) if result: break @@ -2148,7 +2189,7 @@ def send_bin_info(self, bin_info_list): for i in range(3): self.send_packet(bin_info_list, buffer_size=512) time.sleep(8) - result = self.read_until(0xCC, 200) + result = self.read_until(0xCC, self.wait_short_ack) if result: break @@ -2208,19 +2249,19 @@ def devinit_wait(self): if self._is_stopped: return False - return self.read_until(0xCC, 500, 1) + return self.read_until(0xCC, self.wait_short_ack) def erase_wait(self): if self._is_stopped: return False - return self.read_until(0xCC, 1000, 1) - + return self.read_until(0xCC, self.wait_erase_all) + def erase_nvm_wait(self): if self._is_stopped: return False - return self.read_until(0xCC, 1000, 1) - + return self.read_until(0xCC, self.wait_nvm_erase) + def flash_write_pre(self, bin_data): data_to_sdk = bin_data[0:BLOCK_SIZE] # self.send_packet(data_to_sdk) @@ -2242,7 +2283,7 @@ def flash_write(self, fs_len, bin_data): current += len(data_to_sdk) self.send_packet(list(data_to_sdk)) - has_read = self.read_until(0xCC, 2000) + has_read = self.read_until(0xCC, self.wait_ack) if has_read: self.emit(UPGRADE_EVENT.PROGRESS, @@ -2257,13 +2298,13 @@ def flash_crc(self): if self._is_stopped: return False - return self.read_until(0xCC, 2000, 1) + return self.read_until(0xCC, self.wait_crc) def flash_restart(self): if self._is_stopped: return False - return self.read_until(0xCC, 200, 1) + return self.read_until(0xCC, 200) def _raise_error(self, message): # if self._uart.isOpen(): @@ -2303,6 +2344,8 @@ def firmware_version_check(self, data_buffer): self.new_boot_enable = 0 else: self.new_boot_enable = 1 + else: # ins401 CANFD + self.new_boot_enable = 1 def work(self): ''' @@ -2316,11 +2359,11 @@ def work(self): # need a device ping command, ping 5 times self._communicator.reset_buffer() - for i in range(50): + for i in range(100): self.write_wrapper( bytes([int(x, 16) for x in 'ff:ff:ff:ff:ff:ff'.split(':')]), self._communicator.get_src_mac(), pG, []) - time.sleep(0.2) + time.sleep(1) response = helper.read_untils_have_data( self._communicator, pG, 10, 1000) if response: @@ -2329,12 +2372,13 @@ def work(self): if not self.send_sdk_cmd_JS(): return self._raise_error('Send sdk JS command failed') - for i in range(50): + time.sleep(2) + for i in range(100): result = self._communicator.reshake_hand() if result: break else: - time.sleep(0.5) + time.sleep(1) for i in range(10): self.write_wrapper( @@ -2354,19 +2398,15 @@ def work(self): time.sleep(0.1) if self.baud_change_enable: - if not self.send_change_baud_cmd(): - return self._raise_error('Prepare baudrate change command failed') - - if not self.send_baud(230400): + if not self.change_baud(230400): return self._raise_error('Send baudrate command failed') - if not self.baud_check(): return self._raise_error('Baudrate check failed') if not self.is_host_ready(): return self._raise_error('Host is not ready.') - if self.new_boot_enable: + if self.new_boot_enable: if not self.send_new_boot(): return self._raise_error('SDK boot failed') else: @@ -2384,11 +2424,11 @@ def work(self): if not self.erase_wait(): return self._raise_error('Wait erase failed') - + if not self.erase_nvm_wait(): - return self._raise_error('Wait nvm failed') + return self._raise_error('Wait erase nvm failed') - time.sleep(6) + # time.sleep(6) if not self.flash_write(fs_len, self._file_content): return self._raise_error('Write flash failed') @@ -2399,7 +2439,7 @@ def work(self): return self._raise_error('CRC check fail') else: break - + if not self.send_sdk_cmd_JG(): return self._raise_error('Send sdk command JG fail') else: diff --git a/src/aceinna/devices/upgrade_workers/jump_bootloader_worker.py b/src/aceinna/devices/upgrade_workers/jump_bootloader_worker.py index 147827a..aa0ee44 100644 --- a/src/aceinna/devices/upgrade_workers/jump_bootloader_worker.py +++ b/src/aceinna/devices/upgrade_workers/jump_bootloader_worker.py @@ -7,6 +7,7 @@ from ...framework.command import Command from . import (UPGRADE_EVENT, UPGRADE_GROUP) +IMU_JI_CMD = [0x4a, 0x49] class JumpBootloaderWorker(UpgradeWorkerBase): '''Firmware upgrade worker @@ -32,12 +33,42 @@ def __init__(self, communicator, ack_enable, *args, **kwargs): if kwargs.get('wait_timeout_after_command'): self._wait_timeout_after_command = kwargs.get( 'wait_timeout_after_command') + + if kwargs.get('ethernet_reshake'): + self._ethernet_reshake = kwargs.get('ethernet_reshake') + if kwargs.get('system_reset'): + self._system_reset = kwargs.get('system_reset') + def stop(self): self._is_stopped = True def get_upgrade_content_size(self): return self.total + + def imu_jump_iap_command(self, actual_command, payload_length_format): + response = None + retry_cnt = int((self._wait_timeout_after_command+4)/5) + + for i in range(retry_cnt): + for i in range(5): + self._communicator.write(actual_command) + time.sleep(0.5) + response = helper.read_untils_have_data( + self._communicator, self._listen_packet, 100, 500, payload_length_format) + if response is not None: + break + + if response is None: + if self._system_reset and callable(self._system_reset): + self._system_reset() + + if self._ethernet_reshake and callable(self._ethernet_reshake): + self._ethernet_reshake() + else: + break + + return response def work(self): '''Send JI command @@ -63,13 +94,16 @@ def work(self): self._communicator.reset_buffer() if self.ack_enable: - for i in range(self._wait_timeout_after_command): - self._communicator.write(actual_command) - time.sleep(0.5) - response = helper.read_untils_have_data( - self._communicator, self._listen_packet, 100, 2000, payload_length_format) - if response is not None: - break + if self._listen_packet == IMU_JI_CMD: + response = self.imu_jump_iap_command(actual_command, payload_length_format) + else: + for i in range(self._wait_timeout_after_command): + self._communicator.write(actual_command) + time.sleep(0.5) + response = helper.read_untils_have_data( + self._communicator, self._listen_packet, 100, 1000, payload_length_format) + if response is not None: + break if(response is None): self.emit(UPGRADE_EVENT.ERROR, self._key, diff --git a/src/aceinna/framework/communicators/ethernet_100base_t1.py b/src/aceinna/framework/communicators/ethernet_100base_t1.py index b9952d2..02d00c0 100644 --- a/src/aceinna/framework/communicators/ethernet_100base_t1.py +++ b/src/aceinna/framework/communicators/ethernet_100base_t1.py @@ -1,14 +1,17 @@ import time import collections +import os from scapy.all import sendp, conf, AsyncSniffer from ..constants import (BAUDRATE_LIST, INTERFACES) from ..utils.print import (print_red) from ..utils import helper from ..communicator import Communicator -UPGRADE_PACKETS = [b'\x01\xcc', b'\x01\xaa', b'\x02\xaa', b'\x03\xaa', b'\x04\xaa', - b'\x05\xaa', b'\x06\xaa', b'\x07\xaa', b'\x08\xaa', b'\x4a\x49', b'\x4a\x41', b'\x57\x41', b'\x0a\xaa'] +# Add parameter configuration type to be filtered to resolve timeout issue +OTHER_FILTER_PACKETS = [b'\x02\xcc', b'\x03\xcc', b'\x04\xcc', b'\x05\xcc', b'\x06\xcc'] +UPGRADE_PACKETS = [b'\x01\xcc', b'\x01\xaa', b'\x02\xaa', b'\x03\xaa', b'\x04\xaa',b'\x05\xaa', + b'\x06\xaa', b'\x07\xaa', b'\x08\xaa', b'\x4a\x49', b'\x4a\x41', b'\x57\x41', b'\x0a\xaa'] class Ethernet(Communicator): '''Ethernet''' @@ -24,6 +27,7 @@ def __init__(self, options=None): self.filter_device_type = None self.filter_host_mac = None self.filter_host_mac_assigned = False + self.config_unit_sn = None self.iface_confirmed = False self.receive_cache = collections.deque(maxlen=20000) @@ -38,6 +42,10 @@ def __init__(self, options=None): if options: self.filter_host_mac_assigned = options.host_mac != 'auto' self.filter_host_mac = options.host_mac if self.filter_host_mac_assigned else None + + if options: + self.config_unit_sn = options.unit_sn != 'auto' + self.config_unit_sn = options.unit_sn if self.config_unit_sn else None def handle_iface_confirm_packet(self, packet): self.iface_confirmed = True @@ -97,6 +105,7 @@ def find_device(self, callback, retries=0, not_found_handler=None): if self.iface_confirmed is False: print_red('No available Ethernet card was found.') + os._exit(1) return None else: for i in range(100): @@ -196,7 +205,8 @@ def handle_recive_packet(self, packet): self.use_length_as_protocol = False if self.upgrading_flag: - if UPGRADE_PACKETS.__contains__(packet_type): + if UPGRADE_PACKETS.__contains__(packet_type)\ + or OTHER_FILTER_PACKETS.__contains__(packet_type): self.receive_cache.append(packet_raw[2:]) else: self.receive_cache.append(packet_raw[2:]) diff --git a/src/aceinna/framework/decorator.py b/src/aceinna/framework/decorator.py index 7c99584..d4e2525 100644 --- a/src/aceinna/framework/decorator.py +++ b/src/aceinna/framework/decorator.py @@ -15,7 +15,7 @@ INTERFACE_LIST = INTERFACES.list() MODES = ['default', 'cli', 'receiver'] -TYPES_OF_LOG = ['rtkl', 'ins401', 'beidou', 'ins401c'] +TYPES_OF_LOG = ['rtkl', 'ins401', 'beidou', 'ins401c', 'ins402'] KML_RATES = [1, 2, 5, 10] @@ -45,6 +45,8 @@ def _build_args(): help="true or false") parser.add_argument("-m", dest='host_mac', metavar='', type=str, help="The mac address for listen device data") + parser.add_argument("-sn", dest='unit_sn', metavar='', type=str, + help="set the unit serial number") ''' parser.add_argument("-board", dest='board', metavar='', type=str, help="RTK330LA beidou") diff --git a/src/aceinna/libs/UserDecoderLib.dll b/src/aceinna/libs/UserDecoderLib.dll index 91b0531..71f01b3 100644 Binary files a/src/aceinna/libs/UserDecoderLib.dll and b/src/aceinna/libs/UserDecoderLib.dll differ diff --git a/src/aceinna/models/args.py b/src/aceinna/models/args.py index 1495ef5..2e0ea98 100644 --- a/src/aceinna/models/args.py +++ b/src/aceinna/models/args.py @@ -44,7 +44,8 @@ class WebserverArgs(KeyValuesArgumentBase): 'set_mount_angle': False, 'use_cli':False, 'para_path': None, - 'host_mac': 'auto' + 'host_mac': 'auto', + 'unit_sn': 'auto' } diff --git a/src/aceinna/setting/INS401/RTK_INS/ins401.json b/src/aceinna/setting/INS401/RTK_INS/ins401.json index 50367dc..7fed28e 100644 --- a/src/aceinna/setting/INS401/RTK_INS/ins401.json +++ b/src/aceinna/setting/INS401/RTK_INS/ins401.json @@ -648,7 +648,7 @@ { "canfd_type": "canfd", "is_parse": true, - "canfd_id": [384, 640, 641, 1412], + "canfd_id": [384, 640, 641, 1412, 385, 642], "canfd_remote_id":[1408, 1409, 1410, 1411], "can_id": [384, 385, 386, 387, 388, 389, 390, 391, 392, 640], "can_config":{ @@ -726,7 +726,7 @@ "signals": [ { "bit_length": 16, - "factor": "0.0076293", + "factor": "0.00762951", "is_big_endian": true, "is_float": true, "is_signed": false, @@ -735,11 +735,11 @@ "start_bit": 8, "type": "uint16", "format": "11.4f", - "unit": "s" + "unit": "deg/s" }, { "bit_length": 16, - "factor": "0.0076293", + "factor": "0.00762951", "is_big_endian": true, "is_float": true, "is_signed": false, @@ -748,11 +748,11 @@ "start_bit": 24, "type": "uint16", "format": "11.4f", - "unit": "s" + "unit": "deg/s" }, { "bit_length": 16, - "factor": "0.0076293", + "factor": "0.00762951", "is_big_endian": true, "is_float": true, "is_signed": false, @@ -761,7 +761,7 @@ "start_bit": 40, "type": "uint16", "format": "11.4f", - "unit": "s" + "unit": "deg/s" } ] }, @@ -1186,7 +1186,7 @@ }, { "bit_length": 16, - "factor": "0.0076293", + "factor": "0.00762951", "is_big_endian": true, "is_float": true, "is_signed": false, @@ -1195,11 +1195,11 @@ "start_bit": 56, "type": "uint16", "format": "11.4f", - "unit": "s" + "unit": "deg/s" }, { "bit_length": 16, - "factor": "0.0076293", + "factor": "0.00762951", "is_big_endian": true, "is_float": true, "is_signed": false, @@ -1208,11 +1208,11 @@ "start_bit": 72, "type": "uint16", "format": "11.4f", - "unit": "s" + "unit": "deg/s" }, { "bit_length": 16, - "factor": "0.0076293", + "factor": "0.00762951", "is_big_endian": true, "is_float": true, "is_signed": false, @@ -1221,7 +1221,7 @@ "start_bit": 88, "type": "uint16", "format": "11.4f", - "unit": "s" + "unit": "deg/s" }, { "bit_length": 16, @@ -1230,7 +1230,7 @@ "is_float": true, "is_signed": false, "name": "INS_PitchAngle", - "offset": "-250", + "offset": "-360", "start_bit": 104, "type": "uint16", "format": "11.4f", @@ -1243,7 +1243,7 @@ "is_float": true, "is_signed": false, "name": "INS_RollAngle", - "offset": "-250", + "offset": "-360", "start_bit": 120, "type": "uint16", "format": "11.4f", @@ -1256,7 +1256,7 @@ "is_float": true, "is_signed": false, "name": "INS_HeadingAngle", - "offset": "-250", + "offset": "-360", "start_bit": 136, "type": "uint16", "format": "11.4f", diff --git a/src/aceinna/setting/INS402/RTK_INS/ins402.json b/src/aceinna/setting/INS402/RTK_INS/ins402.json index 20b68c9..be00153 100644 --- a/src/aceinna/setting/INS402/RTK_INS/ins402.json +++ b/src/aceinna/setting/INS402/RTK_INS/ins402.json @@ -1,7 +1,7 @@ { - "appVersion": "INS401 28.00.01", - "type": "INS401", - "description": "6-axis INS401 with INS application", + "appVersion": "INS401 31.00.01", + "type": "INS402", + "description": "6-axis INS402 with INS application", "initial":{ "userParameters": [ { @@ -93,18 +93,38 @@ "paramId": 18, "name": "rotation alignz", "value": 0.0 + }, + { + "paramId": 19, + "name": "NHC switch", + "value": 1 + }, + { + "paramId": 22, + "name": "dual ant switch", + "value": 1 + }, + { + "paramId": 23, + "name": "dual ant baseline length", + "value": 6.7 + }, + { + "paramId": 24, + "name": "dual ant heading cali", + "value": 0 } - ], - "ntrip":[ - { + ], + "ntrip":[ + { "name": "ip", "value": "58.215.20.43" }, { "name": "port", "value": 2201 - }, - { + }, + { "name": "mountPoint", "value": "WX02" }, @@ -116,210 +136,240 @@ "name": "password", "value": "888999" } - ] + ] }, - "userConfiguration": [ - { - "paramId": 0, - "category": "General", - "paramType": "disabled", - "type": "uint16", - "name": "Data CRC" - }, - { - "paramId": 1, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "gnss lever arm x", - "value_accuracy": 4 - }, - { - "paramId": 2, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "gnss lever arm y", - "value_accuracy": 4 - }, - { - "paramId": 3, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "gnss lever arm z", - "value_accuracy": 4 - }, + "userConfiguration": [ + { + "paramId": 0, + "category": "General", + "paramType": "disabled", + "type": "uint16", + "name": "Data CRC" + }, { - "paramId": 4, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "vrp lever arm x", - "value_accuracy": 4 - }, - { - "paramId": 5, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "vrp lever arm y", - "value_accuracy": 4 - }, - { - "paramId": 6, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "vrp lever arm z", - "value_accuracy": 4 - }, + "paramId": 1, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "gnss lever arm x", + "value_accuracy": 4 + }, + { + "paramId": 2, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "gnss lever arm y", + "value_accuracy": 4 + }, + { + "paramId": 3, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "gnss lever arm z", + "value_accuracy": 4 + }, + { + "paramId": 4, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "vrp lever arm x", + "value_accuracy": 4 + }, + { + "paramId": 5, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "vrp lever arm y", + "value_accuracy": 4 + }, + { + "paramId": 6, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "vrp lever arm z", + "value_accuracy": 4 + }, + { + "paramId": 7, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "user lever arm x", + "value_accuracy": 4 + }, { - "paramId": 7, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "user lever arm x", - "value_accuracy": 4 - }, - { - "paramId": 8, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "user lever arm y", - "value_accuracy": 4 - }, - { - "paramId": 9, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "user lever arm z", - "value_accuracy": 4 - }, + "paramId": 8, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "user lever arm y", + "value_accuracy": 4 + }, { - "paramId": 10, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "rotation rbvx", - "value_accuracy": 4 - }, - { - "paramId": 11, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "rotation rbvy", - "value_accuracy": 4 - }, - { - "paramId": 12, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "rotation rbvz", - "value_accuracy": 4 - }, - { - "paramId": 13, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "sec lever arm x", - "value_accuracy": 4 - }, - { - "paramId": 14, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "sec lever arm y", - "value_accuracy": 4 - }, - { - "paramId": 15, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "sec lever arm z", - "value_accuracy": 4 - }, + "paramId": 9, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "user lever arm z", + "value_accuracy": 4 + }, { - "paramId": 16, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "rotation alignx", - "value_accuracy": 4 - }, - { - "paramId": 17, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "rotation aligny", - "value_accuracy": 4 - }, - { - "paramId": 18, - "category": "INS", - "paramType": "input", - "type": "float", - "name": "rotation alignz", - "value_accuracy": 4 - } - ], - "userMessages": { - "inputPackets": [ - { - "name": "pG", - "description": "Get device serial number & factory ID", - "inputPayload": {}, - "responsePayload": { - "type": "string", - "name": "Device ID and SN" - } - }, - { - "name": "gV", - "description": "Get user app version", - "inputPayload": {}, - "responsePayload": { - "type": "string", - "name": "User Version" - } - }, - { - "name": "gA", - "description": "Get All Configuration Parameters", - "inputPayload": {}, - "responsePayload": { - "type": "userConfiguration", - "name": "Full Current Configuration" - } + "paramId": 10, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "rotation rbvx", + "value_accuracy": 4 + }, + { + "paramId": 11, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "rotation rbvy", + "value_accuracy": 4 + }, + { + "paramId": 12, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "rotation rbvz", + "value_accuracy": 4 + }, + { + "paramId": 13, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "sec lever arm x", + "value_accuracy": 4 + }, + { + "paramId": 14, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "sec lever arm y", + "value_accuracy": 4 + }, + { + "paramId": 15, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "sec lever arm z", + "value_accuracy": 4 + }, + { + "paramId": 16, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "rotation alignx", + "value_accuracy": 4 + }, + { + "paramId": 17, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "rotation aligny", + "value_accuracy": 4 + }, + { + "paramId": 18, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "rotation alignz", + "value_accuracy": 4 + }, + { + "paramId": 19, + "category": "INS", + "paramType": "input", + "type": "uint32", + "name": "NHC switch" + }, + { + "paramId": 22, + "category": "GNSS", + "paramType": "input", + "type": "uint32", + "name": "dual ant switch" + }, + { + "paramId": 23, + "category": "GNSS", + "paramType": "input", + "type": "float", + "name": "dual ant baseline length", + "value_accuracy": 4 + }, + { + "paramId": 24, + "category": "GNSS", + "paramType": "input", + "type": "float", + "name": "dual ant heading cali", + "value_accuracy": 4 + } + ], + "userMessages": { + "inputPackets": [ + { + "name": "pG", + "description": "Get device serial number & factory ID", + "inputPayload": {}, + "responsePayload": { + "type": "string", + "name": "Device ID and SN" + } + }, + { + "name": "gV", + "description": "Get user app version", + "inputPayload": {}, + "responsePayload": { + "type": "string", + "name": "User Version" + } + }, + { + "name": "gA", + "description": "Get All Configuration Parameters", + "inputPayload": {}, + "responsePayload": { + "type": "userConfiguration", + "name": "Full Current Configuration" + } }, { - "name": "sC", - "description": "Save Conifguration Parameters to Flash", - "inputPayload": {}, - "responsePayload": {} - }, - { - "name": "uP", - "description": "Update Configuration Parameter", - "inputPayload": { - "type": "userParameter", - "name": "Parameter to be Updated" - }, - "responsePayload": { - "type": "paramId", - "name": "ID of the Updated Parameter" - } - } - ], - "outputPackets": [ + "name": "sC", + "description": "Save Conifguration Parameters to Flash", + "inputPayload": {}, + "responsePayload": {} + }, + { + "name": "uP", + "description": "Update Configuration Parameter", + "inputPayload": { + "type": "userParameter", + "name": "Parameter to be Updated" + }, + "responsePayload": { + "type": "paramId", + "name": "ID of the Updated Parameter" + } + } + ], + "outputPackets": [ { "name": "s1", "isList": 0, @@ -365,363 +415,363 @@ "unit": "deg/s" } ], - "graphs": [ - { - "name": "Acceleration", - "units": "m/s^2", - "xAxis": {"name":"GPS_TimeofWeek", "unit":"sec"}, - "yAxes": [ - "x_accel", - "y_accel", - "z_accel" - ], - "colors": [ - "#FF0000", - "#00FF00", - "#0000FF" - ], - "yMax": 20 - }, - { - "name": "Angular-Rate", - "units": "deg/s", - "xAxis": {"name":"GPS_TimeofWeek", "unit":"sec"}, - "yAxes": [ - "x_rate", - "y_rate", - "z_rate" - ], - "colors": [ - "#FF0000", - "#00FF00", - "#0000FF" - ], - "yMax": 200 - } - ] + "graphs": [ + { + "name": "Acceleration", + "units": "m/s^2", + "xAxis": {"name":"GPS_TimeofWeek", "unit":"sec"}, + "yAxes": [ + "x_accel", + "y_accel", + "z_accel" + ], + "colors": [ + "#FF0000", + "#00FF00", + "#0000FF" + ], + "yMax": 20 + }, + { + "name": "Angular-Rate", + "units": "deg/s", + "xAxis": {"name":"GPS_TimeofWeek", "unit":"sec"}, + "yAxes": [ + "x_rate", + "y_rate", + "z_rate" + ], + "colors": [ + "#FF0000", + "#00FF00", + "#0000FF" + ], + "yMax": 200 + } + ] }, { - "name": "iN", + "name": "iN", "isList": 0, - "payload": [ - { - "type": "uint32", - "name": "GPS_Week", - "unit": "" - }, - { - "type": "double", - "name": "GPS_TimeofWeek", - "unit": "sec" - }, - { - "type": "uint8", - "name": "insStatus", - "unit": "" - }, - { - "type": "uint8", - "name": "insPositionType", - "unit": "" - }, - { - "type": "int32", - "name": "latitude", - "unit": "deg" - }, - { - "type": "int32", - "name": "longitude", - "unit": "deg" - }, - { - "type": "float", - "name": "height", - "unit": "m" - }, - { - "type": "int16", - "name": "velocityNorth", - "unit": "m/s" - }, - { - "type": "int16", - "name": "velocityEast", - "unit": "m/s" - }, - { - "type": "int16", - "name": "velocityUp", - "unit": "m/s" - }, - { - "type": "int16", - "name": "roll", - "unit": "m/s" - }, - { - "type": "int16", - "name": "pitch", - "unit": "m/s" - }, - { - "type": "int16", - "name": "heading", - "unit": "m/s" + "payload": [ + { + "type": "uint32", + "name": "GPS_Week", + "unit": "" + }, + { + "type": "double", + "name": "GPS_TimeofWeek", + "unit": "sec" + }, + { + "type": "uint8", + "name": "insStatus", + "unit": "" + }, + { + "type": "uint8", + "name": "insPositionType", + "unit": "" + }, + { + "type": "int32", + "name": "latitude", + "unit": "deg" + }, + { + "type": "int32", + "name": "longitude", + "unit": "deg" + }, + { + "type": "float", + "name": "height", + "unit": "m" + }, + { + "type": "int16", + "name": "velocityNorth", + "unit": "m/s" + }, + { + "type": "int16", + "name": "velocityEast", + "unit": "m/s" + }, + { + "type": "int16", + "name": "velocityUp", + "unit": "m/s" + }, + { + "type": "int16", + "name": "roll", + "unit": "m/s" + }, + { + "type": "int16", + "name": "pitch", + "unit": "m/s" + }, + { + "type": "int16", + "name": "heading", + "unit": "m/s" } - ], - "graphs": [] + ], + "graphs": [] }, { - "name": "d1", - "isList": 0, - "payload": [ - { - "type": "uint32", - "name": "GPS_Week", - "unit": "" - }, - { - "type": "double", - "name": "GPS_TimeofWeek", - "unit": "sec" - }, - { - "type": "int16", - "name": "latitude_std", - "unit": "" - }, - { - "type": "int16", - "name": "longitude_std", - "unit": "" - }, - { - "type": "int16", - "name": "height_std", - "unit": "" - }, - { - "type": "int16", - "name": "north_vel_std", - "unit": "" - }, - { - "type": "int16", - "name": "east_vel_std", - "unit": "" - }, - { - "type": "int16", - "name": "up_vel_std", - "unit": "" - }, - { - "type": "int16", - "name": "roll_std", - "unit": "" - }, - { - "type": "int16", - "name": "pitch_std", - "unit": "" - }, - { - "type": "int16", - "name": "heading_std", - "unit": "" - } - ], - "graphs": [] + "name": "d1", + "isList": 0, + "payload": [ + { + "type": "uint32", + "name": "GPS_Week", + "unit": "" + }, + { + "type": "double", + "name": "GPS_TimeofWeek", + "unit": "sec" + }, + { + "type": "int16", + "name": "latitude_std", + "unit": "" + }, + { + "type": "int16", + "name": "longitude_std", + "unit": "" + }, + { + "type": "int16", + "name": "height_std", + "unit": "" + }, + { + "type": "int16", + "name": "north_vel_std", + "unit": "" + }, + { + "type": "int16", + "name": "east_vel_std", + "unit": "" + }, + { + "type": "int16", + "name": "up_vel_std", + "unit": "" + }, + { + "type": "int16", + "name": "roll_std", + "unit": "" + }, + { + "type": "int16", + "name": "pitch_std", + "unit": "" + }, + { + "type": "int16", + "name": "heading_std", + "unit": "" + } + ], + "graphs": [] }, { - "name": "gN", - "isList": 0, - "payload": [ - { - "type": "uint32", - "name": "GPS_Week", - "unit": "" - }, - { - "type": "double", - "name": "GPS_TimeofWeek", - "unit": "sec" - }, - { - "type": "uint8", - "name": "positionMode", - "unit": "" - }, - { - "type": "int32", - "name": "latitude", - "unit": "deg" - }, - { - "type": "int32", - "name": "longitude", - "unit": "deg" - }, - { - "type": "float", - "name": "height", - "unit": "m" + "name": "gN", + "isList": 0, + "payload": [ + { + "type": "uint32", + "name": "GPS_Week", + "unit": "" + }, + { + "type": "double", + "name": "GPS_TimeofWeek", + "unit": "sec" }, { "type": "uint8", - "name": "numberOfSVs", - "unit": "" - }, - { - "type": "float", - "name": "hdop", - "unit": "" - }, - { - "type": "uint16", - "name": "diffage", - "unit": "" - }, - { - "type": "int16", - "name": "velocityNorth", - "unit": "m/s" - }, - { - "type": "int16", - "name": "velocityEast", - "unit": "m/s" - }, - { - "type": "int16", - "name": "velocityUp", - "unit": "m/s" - } - ], - "graphs": [] - }, + "name": "positionMode", + "unit": "" + }, + { + "type": "int32", + "name": "latitude", + "unit": "deg" + }, + { + "type": "int32", + "name": "longitude", + "unit": "deg" + }, + { + "type": "float", + "name": "height", + "unit": "m" + }, + { + "type": "uint8", + "name": "numberOfSVs", + "unit": "" + }, + { + "type": "float", + "name": "hdop", + "unit": "" + }, + { + "type": "uint16", + "name": "diffage", + "unit": "" + }, + { + "type": "int16", + "name": "velocityNorth", + "unit": "m/s" + }, + { + "type": "int16", + "name": "velocityEast", + "unit": "m/s" + }, + { + "type": "int16", + "name": "velocityUp", + "unit": "m/s" + } + ], + "graphs": [] + }, { - "name": "sT", - "isList": 0, - "payload": [ - { - "type": "uint32", - "name": "GPS_Week", - "unit": "" - }, - { - "type": "double", - "name": "GPS_TimeofWeek", - "unit": "sec" - }, - { - "type": "uint16", - "name": "year", - "unit": "" - }, - { - "type": "uint8", - "name": "mouth", - "unit": "" - }, - { - "type": "uint8", - "name": "day", - "unit": "" - }, - { - "type": "uint8", - "name": "hour", - "unit": "" - }, - { - "type": "uint8", - "name": "min", - "unit": "" - }, - { - "type": "uint8", - "name": "sec", - "unit": "" - }, + "name": "sT", + "isList": 0, + "payload": [ + { + "type": "uint32", + "name": "GPS_Week", + "unit": "" + }, + { + "type": "double", + "name": "GPS_TimeofWeek", + "unit": "sec" + }, + { + "type": "uint16", + "name": "year", + "unit": "" + }, + { + "type": "uint8", + "name": "mouth", + "unit": "" + }, + { + "type": "uint8", + "name": "day", + "unit": "" + }, + { + "type": "uint8", + "name": "hour", + "unit": "" + }, + { + "type": "uint8", + "name": "min", + "unit": "" + }, + { + "type": "uint8", + "name": "sec", + "unit": "" + }, - { - "type": "uint32", - "name": "imu_status", - "unit": "" - }, - { - "type": "float", - "name": "imu_temperature", - "unit": "sec" - }, - { - "type": "float", - "name": "mcu_temperature", - "unit": "" - } - ], - "graphs": [] - } - ] - }, + { + "type": "uint32", + "name": "imu_status", + "unit": "" + }, + { + "type": "float", + "name": "imu_temperature", + "unit": "sec" + }, + { + "type": "float", + "name": "mcu_temperature", + "unit": "" + } + ], + "graphs": [] + } + ] + }, "CLICommands": [{ - "name": "help", - "description": "CLI help menu", - "function": "help_handler" - }, - { - "name": "exit", - "description": "exit CLI", - "function": "" - }, - { - "name": "run", - "description": "Operations defined by users", - "function": "run_handler" - }, - { - "name": "save", - "description": "Save the configuration into EEPROM", - "function": "save_handler" - }, - { - "name": "connect", - "description": "Find OpenIMU device", - "function": "connect_handler" - }, - { - "name": "upgrade", - "description": "Upgrade firmware", - "function": "upgrade_handler" - }, - { - "name": "record", - "description": "Record output data of OpenIMU on local machine", - "function": "record_handler" - }, - { - "name": "stop", - "description": "stop recording outputs on local machine", - "function": "stop_handler" - }, - { - "name": "server_start", - "description": "start server thread and must use exit command to quit", - "function": "server_start_handler" - }, - { - "name": "get", - "description": "Read the current configuration and output data", - "function": "get_handler" - }, - { - "name": "set", - "description": "Write parameters to OpenIMU", - "function": "set_handler" - } - ], + "name": "help", + "description": "CLI help menu", + "function": "help_handler" + }, + { + "name": "exit", + "description": "exit CLI", + "function": "" + }, + { + "name": "run", + "description": "Operations defined by users", + "function": "run_handler" + }, + { + "name": "save", + "description": "Save the configuration into EEPROM", + "function": "save_handler" + }, + { + "name": "connect", + "description": "Find OpenIMU device", + "function": "connect_handler" + }, + { + "name": "upgrade", + "description": "Upgrade firmware", + "function": "upgrade_handler" + }, + { + "name": "record", + "description": "Record output data of OpenIMU on local machine", + "function": "record_handler" + }, + { + "name": "stop", + "description": "stop recording outputs on local machine", + "function": "stop_handler" + }, + { + "name": "server_start", + "description": "start server thread and must use exit command to quit", + "function": "server_start_handler" + }, + { + "name": "get", + "description": "Read the current configuration and output data", + "function": "get_handler" + }, + { + "name": "set", + "description": "Write parameters to OpenIMU", + "function": "set_handler" + } + ], "canfd_settings": { "canfd_type": "canfd", diff --git a/src/aceinna/setting/INS402/RTK_INS/ins402c.json b/src/aceinna/setting/INS402/RTK_INS/ins402c.json new file mode 100644 index 0000000..f11f01d --- /dev/null +++ b/src/aceinna/setting/INS402/RTK_INS/ins402c.json @@ -0,0 +1,2161 @@ +{ + "appVersion": "INS401 31.00.01", + "type": "INS402", + "description": "6-axis INS402 with INS application", + "initial":{ + "userParameters": [ + { + "paramId": 1, + "name": "gnss lever arm x", + "value": 0.7 + }, + { + "paramId": 2, + "name": "gnss lever arm y", + "value": 0.02 + }, + { + "paramId": 3, + "name": "gnss lever arm z", + "value": -1.06 + }, + { + "paramId": 4, + "name": "vrp lever arm x", + "value": 0.38 + }, + { + "paramId": 5, + "name": "vrp lever arm y", + "value": 0.01 + }, + { + "paramId": 6, + "name": "vrp lever arm z", + "value": 0.21 + }, + { + "paramId": 7, + "name": "user lever arm x", + "value": 0.7 + }, + { + "paramId": 8, + "name": "user lever arm y", + "value": 0.02 + }, + { + "paramId": 9, + "name": "user lever arm z", + "value": -1.06 + }, + { + "paramId": 10, + "name": "rotation rbvx", + "value": 0.0 + }, + { + "paramId": 11, + "name": "rotation rbvy", + "value": 0.0 + }, + { + "paramId": 12, + "name": "rotation rbvz", + "value": 180.0 + }, + { + "paramId": 13, + "name": "sec lever arm x", + "value": 1.75 + }, + { + "paramId": 14, + "name": "sec lever arm y", + "value": 0.02 + }, + { + "paramId": 15, + "name": "sec lever arm z", + "value": -1.06 + }, + { + "paramId": 16, + "name": "dual ant switch", + "value": 1 + }, + { + "paramId": 17, + "name": "dual ant baseline length", + "value": 6.7 + }, + { + "paramId": 18, + "name": "dual ant heading cali", + "value": 0 + } + ], + "ntrip":[ + { + "name": "ip", + "value": "58.215.20.43" + }, + { + "name": "port", + "value": 2201 + }, + { + "name": "mountPoint", + "value": "WX02" + }, + { + "name": "username", + "value": "daich" + }, + { + "name": "password", + "value": "888999" + } + ] + }, + "userConfiguration": [ + { + "paramId": 0, + "category": "General", + "paramType": "disabled", + "type": "uint16", + "name": "Data CRC" + }, + { + "paramId": 1, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "gnss lever arm x", + "value_accuracy": 4 + }, + { + "paramId": 2, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "gnss lever arm y", + "value_accuracy": 4 + }, + { + "paramId": 3, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "gnss lever arm z", + "value_accuracy": 4 + }, + { + "paramId": 4, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "vrp lever arm x", + "value_accuracy": 4 + }, + { + "paramId": 5, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "vrp lever arm y", + "value_accuracy": 4 + }, + { + "paramId": 6, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "vrp lever arm z", + "value_accuracy": 4 + }, + { + "paramId": 7, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "user lever arm x", + "value_accuracy": 4 + }, + { + "paramId": 8, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "user lever arm y", + "value_accuracy": 4 + }, + { + "paramId": 9, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "user lever arm z", + "value_accuracy": 4 + }, + { + "paramId": 10, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "rotation rbvx", + "value_accuracy": 4 + }, + { + "paramId": 11, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "rotation rbvy", + "value_accuracy": 4 + }, + { + "paramId": 12, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "rotation rbvz", + "value_accuracy": 4 + }, + { + "paramId": 13, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "sec lever arm x", + "value_accuracy": 4 + }, + { + "paramId": 14, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "sec lever arm y", + "value_accuracy": 4 + }, + { + "paramId": 15, + "category": "INS", + "paramType": "input", + "type": "float", + "name": "sec lever arm z", + "value_accuracy": 4 + }, + { + "paramId": 16, + "category": "GNSS", + "paramType": "input", + "type": "uint32", + "name": "dual ant switch" + }, + { + "paramId": 17, + "category": "GNSS", + "paramType": "input", + "type": "float", + "name": "dual ant baseline length", + "value_accuracy": 4 + }, + { + "paramId": 18, + "category": "GNSS", + "paramType": "input", + "type": "float", + "name": "dual ant heading cali", + "value_accuracy": 4 + } + ], + "userMessages": { + "inputPackets": [ + { + "name": "pG", + "description": "Get device serial number & factory ID", + "inputPayload": {}, + "responsePayload": { + "type": "string", + "name": "Device ID and SN" + } + }, + { + "name": "gV", + "description": "Get user app version", + "inputPayload": {}, + "responsePayload": { + "type": "string", + "name": "User Version" + } + }, + { + "name": "gA", + "description": "Get All Configuration Parameters", + "inputPayload": {}, + "responsePayload": { + "type": "userConfiguration", + "name": "Full Current Configuration" + } + }, + { + "name": "sC", + "description": "Save Conifguration Parameters to Flash", + "inputPayload": {}, + "responsePayload": {} + }, + { + "name": "uP", + "description": "Update Configuration Parameter", + "inputPayload": { + "type": "userParameter", + "name": "Parameter to be Updated" + }, + "responsePayload": { + "type": "paramId", + "name": "ID of the Updated Parameter" + } + } + ], + "outputPackets": [ + { + "name": "s1", + "isList": 0, + "payload": [ + { + "type": "uint32", + "name": "GPS_Week", + "unit": "" + }, + { + "type": "double", + "name": "GPS_TimeofWeek", + "unit": "sec" + }, + { + "type": "float", + "name": "x_accel", + "unit": "m/s^2" + }, + { + "type": "float", + "name": "y_accel", + "unit": "m/s^2" + }, + { + "type": "float", + "name": "z_accel", + "unit": "m/s^2" + }, + { + "type": "float", + "name": "x_rate", + "unit": "deg/s" + }, + { + "type": "float", + "name": "y_rate", + "unit": "deg/s" + }, + { + "type": "float", + "name": "z_rate", + "unit": "deg/s" + } + ], + "graphs": [ + { + "name": "Acceleration", + "units": "m/s^2", + "xAxis": {"name":"GPS_TimeofWeek", "unit":"sec"}, + "yAxes": [ + "x_accel", + "y_accel", + "z_accel" + ], + "colors": [ + "#FF0000", + "#00FF00", + "#0000FF" + ], + "yMax": 20 + }, + { + "name": "Angular-Rate", + "units": "deg/s", + "xAxis": {"name":"GPS_TimeofWeek", "unit":"sec"}, + "yAxes": [ + "x_rate", + "y_rate", + "z_rate" + ], + "colors": [ + "#FF0000", + "#00FF00", + "#0000FF" + ], + "yMax": 200 + } + ] + }, + { + "name": "iN", + "isList": 0, + "payload": [ + { + "type": "uint32", + "name": "GPS_Week", + "unit": "" + }, + { + "type": "double", + "name": "GPS_TimeofWeek", + "unit": "sec" + }, + { + "type": "uint8", + "name": "insStatus", + "unit": "" + }, + { + "type": "uint8", + "name": "insPositionType", + "unit": "" + }, + { + "type": "int32", + "name": "latitude", + "unit": "deg" + }, + { + "type": "int32", + "name": "longitude", + "unit": "deg" + }, + { + "type": "float", + "name": "height", + "unit": "m" + }, + { + "type": "int16", + "name": "velocityNorth", + "unit": "m/s" + }, + { + "type": "int16", + "name": "velocityEast", + "unit": "m/s" + }, + { + "type": "int16", + "name": "velocityUp", + "unit": "m/s" + }, + { + "type": "int16", + "name": "roll", + "unit": "m/s" + }, + { + "type": "int16", + "name": "pitch", + "unit": "m/s" + }, + { + "type": "int16", + "name": "heading", + "unit": "m/s" + } + ], + "graphs": [] + }, + { + "name": "d1", + "isList": 0, + "payload": [ + { + "type": "uint32", + "name": "GPS_Week", + "unit": "" + }, + { + "type": "double", + "name": "GPS_TimeofWeek", + "unit": "sec" + }, + { + "type": "int16", + "name": "latitude_std", + "unit": "" + }, + { + "type": "int16", + "name": "longitude_std", + "unit": "" + }, + { + "type": "int16", + "name": "height_std", + "unit": "" + }, + { + "type": "int16", + "name": "north_vel_std", + "unit": "" + }, + { + "type": "int16", + "name": "east_vel_std", + "unit": "" + }, + { + "type": "int16", + "name": "up_vel_std", + "unit": "" + }, + { + "type": "int16", + "name": "roll_std", + "unit": "" + }, + { + "type": "int16", + "name": "pitch_std", + "unit": "" + }, + { + "type": "int16", + "name": "heading_std", + "unit": "" + } + ], + "graphs": [] + }, + { + "name": "gN", + "isList": 0, + "payload": [ + { + "type": "uint32", + "name": "GPS_Week", + "unit": "" + }, + { + "type": "double", + "name": "GPS_TimeofWeek", + "unit": "sec" + }, + { + "type": "uint8", + "name": "positionMode", + "unit": "" + }, + { + "type": "int32", + "name": "latitude", + "unit": "deg" + }, + { + "type": "int32", + "name": "longitude", + "unit": "deg" + }, + { + "type": "float", + "name": "height", + "unit": "m" + }, + { + "type": "uint8", + "name": "numberOfSVs", + "unit": "" + }, + { + "type": "float", + "name": "hdop", + "unit": "" + }, + { + "type": "uint16", + "name": "diffage", + "unit": "" + }, + { + "type": "int16", + "name": "velocityNorth", + "unit": "m/s" + }, + { + "type": "int16", + "name": "velocityEast", + "unit": "m/s" + }, + { + "type": "int16", + "name": "velocityUp", + "unit": "m/s" + } + ], + "graphs": [] + }, + { + "name": "sT", + "isList": 0, + "payload": [ + { + "type": "uint32", + "name": "GPS_Week", + "unit": "" + }, + { + "type": "double", + "name": "GPS_TimeofWeek", + "unit": "sec" + }, + { + "type": "uint16", + "name": "year", + "unit": "" + }, + { + "type": "uint8", + "name": "mouth", + "unit": "" + }, + { + "type": "uint8", + "name": "day", + "unit": "" + }, + { + "type": "uint8", + "name": "hour", + "unit": "" + }, + { + "type": "uint8", + "name": "min", + "unit": "" + }, + { + "type": "uint8", + "name": "sec", + "unit": "" + }, + + { + "type": "uint32", + "name": "imu_status", + "unit": "" + }, + { + "type": "float", + "name": "imu_temperature", + "unit": "sec" + }, + { + "type": "float", + "name": "mcu_temperature", + "unit": "" + } + ], + "graphs": [] + } + ] + }, + "CLICommands": [{ + "name": "help", + "description": "CLI help menu", + "function": "help_handler" + }, + { + "name": "exit", + "description": "exit CLI", + "function": "" + }, + { + "name": "run", + "description": "Operations defined by users", + "function": "run_handler" + }, + { + "name": "save", + "description": "Save the configuration into EEPROM", + "function": "save_handler" + }, + { + "name": "connect", + "description": "Find OpenIMU device", + "function": "connect_handler" + }, + { + "name": "upgrade", + "description": "Upgrade firmware", + "function": "upgrade_handler" + }, + { + "name": "record", + "description": "Record output data of OpenIMU on local machine", + "function": "record_handler" + }, + { + "name": "stop", + "description": "stop recording outputs on local machine", + "function": "stop_handler" + }, + { + "name": "server_start", + "description": "start server thread and must use exit command to quit", + "function": "server_start_handler" + }, + { + "name": "get", + "description": "Read the current configuration and output data", + "function": "get_handler" + }, + { + "name": "set", + "description": "Write parameters to OpenIMU", + "function": "set_handler" + } + ], + "canfd_settings": + { + "canfd_type": "canfd", + "is_parse": false, + "canfd_id": [384, 640, 641, 1412, 385, 642], + "canfd_remote_id":[1408, 1409, 1410, 1411], + "can_id": [384, 385, 386, 387, 388, 389, 390, 391, 392, 640], + "can_config":{ + "bus_type": "bmcan", + "channel": 0, + "bitrate": 500000, + "data_bitrate": 2000000 + }, + "imu_log_config": + { + "title": "GPS_Week(),GPS_TimeofWeek(s),x_accel(m/s^2),y_accel(m/s^2),z_accel(m/s^2),x_rate(deg/s),y_rate(deg/s),z_rate(deg/s)\n", + "index":0 + + }, + "ins_log_config": + { + "title": "GPS_Week(),GPS_TimeofWeek(s),insCarStatus(),insPositionType(),latitude(deg),longitude(deg),height(m),velocityNorth(m/s),velocityEast(m/s),velocityUp(m/s),roll(deg),pitch(deg),heading(deg),latitude_std(m),longitude_std(m),height_std(m)\n", + "index":0 + }, + "can_messages": [ + { + "id": 384, + "is_extended_frame": false, + "is_fd": false, + "name": "INS_ACC", + "valid_len": 6, + "signals": [ + { + "bit_length": 16, + "factor": "0.0001220703125", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ACC_X", + "offset": "-4", + "start_bit": 8, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0001220703125", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ACC_Y", + "offset": "-4", + "start_bit": 24, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0001220703125", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ACC_Z", + "offset": "-4", + "start_bit": 40, + "type": "uint16", + "format": "11.4f", + "unit": "s" + } + ] + }, + { + "id": 385, + "is_extended_frame": false, + "is_fd": false, + "name": "INS_GYRO", + "valid_len": 6, + "signals": [ + { + "bit_length": 16, + "factor": "0.0076293", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "GYRO_X", + "offset": "-250", + "start_bit": 8, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0076293", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "GYRO_Y", + "offset": "-250", + "start_bit": 24, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0076293", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "GYRO_Z", + "offset": "-250", + "start_bit": 40, + "type": "uint16", + "format": "11.4f", + "unit": "s" + } + ] + }, + { + "id": 386, + "is_extended_frame": false, + "is_fd": false, + "name": "INS_HeadingPitchRoll", + "valid_len": 6, + "signals": [ + { + "bit_length": 16, + "factor": "0.010986", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_PitchAngle", + "offset": "-250", + "start_bit": 8, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.010986", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_RollAngle", + "offset": "-250", + "start_bit": 24, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.010986", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_HeadingAngle", + "offset": "-250", + "start_bit": 40, + "type": "uint16", + "format": "11.4f", + "unit": "s" + } + ] + }, + { + "id": 387, + "is_extended_frame": false, + "is_fd": false, + "name": "INS_HeightAndIMUStatus", + "valid_len": 8, + "signals": [ + { + "bit_length": 32, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_LocatHeight", + "offset": "-10000", + "start_bit": 24, + "type": "uint32", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 32, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "IMU_Status", + "offset": "0", + "start_bit": 56, + "type": "uint32", + "format": "", + "unit": "s" + } + ] + }, + { + "id": 388, + "is_extended_frame": false, + "is_fd": false, + "name": "INS_LatitudeLongitude", + "valid_len": 8, + "signals": [ + { + "bit_length": 32, + "factor": "0.0000001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Latitude", + "offset": "-180", + "start_bit": 24, + "type": "uint32", + "format": "11.7f", + "unit": "s" + }, + { + "bit_length": 32, + "factor": "0.0000001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Longitude", + "offset": "-180", + "start_bit": 56, + "type": "uint32", + "format": "11.7f", + "unit": "s" + } + ] + }, + { + "id": 389, + "is_extended_frame": false, + "is_fd": false, + "name": "INS_Speed", + "valid_len": 6, + "signals": [ + { + "bit_length": 16, + "factor": "0.0030517", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_NorthSpd", + "offset": "-100", + "start_bit": 8, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0030517", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_EastSpd", + "offset": "-100", + "start_bit": 24, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0030517", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_ToGroundSpd", + "offset": "-100", + "start_bit": 40, + "type": "uint16", + "format": "11.4f", + "unit": "s" + } + ] + }, + { + "id": 390, + "is_extended_frame": false, + "is_fd": false, + "name": "INS_DataInfo", + "valid_len": 6, + "signals": [ + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_GpsFlag_Pos", + "offset": "0", + "start_bit": 0, + "type": "uint8", + "format": "2", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_NumSV", + "offset": "0", + "start_bit": 8, + "type": "uint8", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_GpsFlag_Heading", + "offset": "0", + "start_bit": 16, + "type": "uint8", + "format": "2", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_Gps_Age", + "offset": "0", + "start_bit": 24, + "type": "uint8", + "format": "3f", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_Car_Status", + "offset": "0", + "start_bit": 32, + "type": "uint8", + "format": "2", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_Status", + "offset": "0", + "start_bit": 40, + "type": "uint8", + "format": "2", + "unit": "s" + } + ] + }, + { + "id": 391, + "is_extended_frame": false, + "is_fd": false, + "name": "INS_Std", + "valid_len": 8, + "signals": [ + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Std_Lat", + "offset": "0", + "start_bit": 8, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Std_Lon", + "offset": "0", + "start_bit": 24, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Std_LocatHeight", + "offset": "0", + "start_bit": 40, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Std_Heading", + "offset": "0", + "start_bit": 56, + "type": "uint16", + "format": "11.4f", + "unit": "s" + } + ] + }, + { + "id": 392, + "is_extended_frame": false, + "is_fd": false, + "name": "INS_Time", + "valid_len": 6, + "signals": [ + { + "bit_length": 16, + "factor": "1", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "Week", + "offset": "0", + "start_bit": 8, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 32, + "factor": "1", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "TimeOfWeek", + "offset": "0", + "start_bit": 24, + "type": "uint32", + "format": "11.4f", + "unit": "s" + } + ] + }, + { + "id": 640, + "is_extended_frame": false, + "is_fd": false, + "name": "BASE_RTCM", + "valid_len": 6, + "signals": [ + { + "bit_length": 8, + "factor": "0", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "BASE", + "offset": "0", + "start_bit": 0, + "type": "", + "format": "", + "unit": "s" + } + ] + } + ], + "canfd_messages": [ + { + "id": 384, + "is_extended_frame": false, + "is_fd": true, + "name": "INSPVAX", + "valid_len": 60, + "signals": [ + { + "bit_length": 16, + "factor": "0.0001220703125", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ACC_X", + "offset": "-4", + "start_bit": 8, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0001220703125", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ACC_Y", + "offset": "-4", + "start_bit": 24, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0001220703125", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ACC_Z", + "offset": "-4", + "start_bit": 40, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0076293", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "GYRO_X", + "offset": "-250", + "start_bit": 56, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0076293", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "GYRO_Y", + "offset": "-250", + "start_bit": 72, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0076293", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "GYRO_Z", + "offset": "-250", + "start_bit": 88, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.010986", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_PitchAngle", + "offset": "-250", + "start_bit": 104, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.010986", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_RollAngle", + "offset": "-250", + "start_bit": 120, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.010986", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_HeadingAngle", + "offset": "-250", + "start_bit": 136, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 32, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_LocatHeight", + "offset": "-10000", + "start_bit": 168, + "type": "uint32", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 32, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "IMU_Status", + "offset": "0", + "start_bit": 200, + "type": "uint32", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 32, + "factor": "0.0000001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Latitude", + "offset": "-180", + "start_bit": 232, + "type": "uint32", + "format": "11.7f", + "unit": "s" + }, + { + "bit_length": 32, + "factor": "0.0000001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Longitude", + "offset": "-180", + "start_bit": 264, + "type": "uint32", + "format": "11.7f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0030517", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_NorthSpd", + "offset": "-100", + "start_bit": 280, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0030517", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_EastSpd", + "offset": "-100", + "start_bit": 296, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.0030517", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_ToGroundSpd", + "offset": "-100", + "start_bit": 312, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_GpsFlag_Pos", + "offset": "0", + "start_bit": 320, + "type": "uint8", + "format": "2", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_NumSV", + "offset": "0", + "start_bit": 328, + "type": "uint8", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_GpsFlag_Heading", + "offset": "0", + "start_bit": 336, + "type": "uint8", + "format": "2", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_Gps_Age", + "offset": "0", + "start_bit": 344, + "type": "uint8", + "format": "3f", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_Car_Status", + "offset": "0", + "start_bit": 352, + "type": "uint8", + "format": "2", + "unit": "s" + }, + { + "bit_length": 8, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "INS_Status", + "offset": "0", + "start_bit": 360, + "type": "uint8", + "format": "2", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Std_Lat", + "offset": "0", + "start_bit": 376, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Std_Lon", + "offset": "0", + "start_bit": 392, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Std_LocatHeight", + "offset": "0", + "start_bit": 408, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "INS_Std_Heading", + "offset": "0", + "start_bit": 424, + "type": "uint16", + "format": "11.4f", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "Week", + "offset": "0", + "start_bit": 440, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 32, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "TimeOfWeek", + "offset": "0", + "start_bit": 456, + "type": "uint32", + "format": "11.4f", + "unit": "s" + } + ] + }, + { + "id": 640, + "is_extended_frame": false, + "is_fd": false, + "name": "BASE_RTCM", + "valid_len": 62, + "signals": [ + { + "bit_length": 512, + "factor": "0", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "BASE", + "offset": "0", + "start_bit": 0, + "type": "", + "format": "", + "unit": "s" + } + ] + }, + { + "id": 641, + "is_extended_frame": false, + "is_fd": false, + "name": "ROVER_RTCM", + "valid_len": 63, + "signals": [ + { + "bit_length": 512, + "factor": "0", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "BASE", + "offset": "0", + "start_bit": 0, + "type": "", + "format": "", + "unit": "s" + } + ] + }, + { + "id": 1412, + "is_extended_frame": false, + "is_fd": true, + "name": "LEVER_ARM_SET", + "valid_len": 36, + "signals": [ + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "GNSS_LEVER_ARM_X", + "offset": "-30", + "start_bit": 8, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "GNSS_LEVER_ARM_Y", + "offset": "-30", + "start_bit": 24, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "GNSS_LEVER_ARM_Z", + "offset": "-30", + "start_bit": 40, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "VRP_LEVER_ARM_X", + "offset": "-30", + "start_bit": 56, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "VRP_LEVER_ARM_Y", + "offset": "-30", + "start_bit": 72, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "VRP_LEVER_ARM_Z", + "offset": "-30", + "start_bit": 88, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "USER_LEVER_ARM_X", + "offset": "-30", + "start_bit": 104, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "USER_LEVER_ARM_Y", + "offset": "-30", + "start_bit": 120, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "USER_LEVER_ARM_Z", + "offset": "-30", + "start_bit": 136, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.01", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ROTATION_RBVX", + "offset": "-180", + "start_bit": 152, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.01", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ROTATION_RBVY", + "offset": "-180", + "start_bit": 168, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.01", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ROTATION_RBVZ", + "offset": "-180", + "start_bit": 184, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "SEC_LEVER_ARM_X", + "offset": "-30", + "start_bit": 200, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "SEC_LEVER_ARM_Y", + "offset": "-30", + "start_bit": 216, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "SEC_LEVER_ARM_Z", + "offset": "-30", + "start_bit": 232, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "1", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "DUAL_ANT_SWITCH", + "offset": "0", + "start_bit": 248, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "BASELINE_LENGTH", + "offset": "-30", + "start_bit": 264, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.01", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "HEADING_CALI", + "offset": "-180", + "start_bit": 280, + "type": "uint16", + "format": "", + "unit": "s" + } + ] + } + ], + "canfd_remote_messages": [ + { + "id": 1408, + "is_extended_frame": false, + "is_fd": true, + "name": "INS_VERSION", + "valid_len": 0, + "signals": [ + { + "name": "INS_VERSION" + } + ] + }, + { + "id": 1409, + "is_extended_frame": false, + "is_fd": true, + "name": "SDK_VERSION", + "valid_len": 0, + "signals": [ + { + "name": "SDK_VERSION" + } + ] + }, + { + "id": 1410, + "is_extended_frame": false, + "is_fd": true, + "name": "IMU_VERSION", + "valid_len": 0, + "signals": [ + { + "name": "IMU_VERSION" + } + ] + }, + { + "id": 1411, + "is_extended_frame": false, + "is_fd": true, + "name": "LEVER_ARM_GET", + "valid_len": 36, + "signals": [ + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "GNSS_LEVER_ARM_X", + "offset": "-30", + "start_bit": 8, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "GNSS_LEVER_ARM_Y", + "offset": "-30", + "start_bit": 24, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "GNSS_LEVER_ARM_Z", + "offset": "-30", + "start_bit": 40, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "VRP_LEVER_ARM_X", + "offset": "-30", + "start_bit": 56, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "VRP_LEVER_ARM_Y", + "offset": "-30", + "start_bit": 72, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "VRP_LEVER_ARM_Z", + "offset": "-30", + "start_bit": 88, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "USER_LEVER_ARM_X", + "offset": "-30", + "start_bit": 104, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "USER_LEVER_ARM_Y", + "offset": "-30", + "start_bit": 120, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "USER_LEVER_ARM_Z", + "offset": "-30", + "start_bit": 136, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.01", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ROTATION_RBVX", + "offset": "-180", + "start_bit": 152, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.01", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ROTATION_RBVY", + "offset": "-180", + "start_bit": 168, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.01", + "is_big_endian": true, + "is_float": true, + "is_signed": false, + "name": "ROTATION_RBVZ", + "offset": "-180", + "start_bit": 184, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "SEC_LEVER_ARM_X", + "offset": "-30", + "start_bit": 200, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "SEC_LEVER_ARM_Y", + "offset": "-30", + "start_bit": 216, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "SEC_LEVER_ARM_Z", + "offset": "-30", + "start_bit": 232, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "1", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "DUAL_ANT_SWITCH", + "offset": "0", + "start_bit": 248, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.001", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "BASELINE_LENGTH", + "offset": "-30", + "start_bit": 264, + "type": "uint16", + "format": "", + "unit": "s" + }, + { + "bit_length": 16, + "factor": "0.01", + "is_big_endian": true, + "is_float": false, + "is_signed": false, + "name": "HEADING_CALI", + "offset": "-180", + "start_bit": 280, + "type": "uint16", + "format": "", + "unit": "s" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/src/aceinna/setting/beidou/INS/beidou.json b/src/aceinna/setting/beidou/INS/beidou.json index b05f07f..0b07a89 100644 --- a/src/aceinna/setting/beidou/INS/beidou.json +++ b/src/aceinna/setting/beidou/INS/beidou.json @@ -6,7 +6,8 @@ "logCmd": ["UNLOGALL\r\n", "LOG BESTVELA ONTIME 1\r\n", "LOG BESTPOSA ONTIME 1\r\n", "LOG GPGGA ONTIME 1\r\n", "LOG HEADINGA ONTIME 1\r\n"], "logCmdRAW":["UNLOGALL\r\n", "LOG BESTVELA ONTIME 1\r\n", "LOG BESTXYZA ONTIME 1\r\n", "LOG BESTPOSA ONTIME 1\r\n", - "LOG GPGGA ONTIME 1\r\n", "LOG HEADINGA ONTIME 1\r\n", "OBSVMB COM1 0.1\r\n", "OBSVHB COM1 0.1\r\n", "LOG BD2EPHEMB ONCHANGED\r\n","LOG BD3EPHEMB ONCHANGED\r\n", "GPSEPHEMB COM1 ONCHANGED\r\n", "GLOEPHEMERISB COM1 ONCHANGED\r\n", "GALEPHEMERISB COM1 ONCHANGED\r\n", "LOG RANGEHB ONTIME 1\r\n", "LOG RANGEB ONTIME 1\r\n"], + "LOG GPGGA ONTIME 1\r\n", "LOG HEADINGA ONTIME 1\r\n", "LOG BESTPOSB ONTIME 1\r\n", "LOG BESTVELB ONTIME 1\r\n", "LOG BESTXYZB ONTIME 1\r\n", "OBSVMB COM1 1\r\n", "OBSVHB COM1 1\r\n", + "LOG RANGEB ONTIME 1\r\n", "LOG RANGEHB ONTIME 1\r\n", "LOG GALEPHEMERISB ONTIME 30\r\n", "LOG BD2EPHEMB ONTIME 30\r\n", "LOG GPSEPHEMB ONTIME 30\r\n", "LOG GLOEPHEMERISB ONTIME 30\r\n"], "initial":{ "useDefaultUart": 0, "uart":[ diff --git a/tests/test_ins401_commands.py b/tests/test_ins401_commands.py index 42bb1aa..57ef290 100644 --- a/tests/test_ins401_commands.py +++ b/tests/test_ins401_commands.py @@ -193,6 +193,15 @@ def ethernet_configuration_command_send_receive(device_provider:EhternetProvider else: return False + command_line = system_reset_info(device_provider.communicator.get_dst_mac(), + device_provider.communicator.get_src_mac(), + list(INPUT_PACKETS[4])) + if command_line: + result = device_provider.send_command(command_line.actual_command) + print('system_reset_info:', result) + else: + return False + return True def handle_discovered(device_provider): @@ -212,7 +221,8 @@ def kill_app(signal_int, call_back): @handle_application_exception def simple_start(): driver = Driver(WebserverArgs( - interface=INTERFACES.ETH_100BASE_T1 + interface=INTERFACES.ETH_100BASE_T1, + use_cli = True )) driver.on(DriverEvents.Discovered, handle_discovered) driver.detect() diff --git a/tests/test_ins401_upgrade.py b/tests/test_ins401_upgrade.py index 75d738b..e85e8fb 100644 --- a/tests/test_ins401_upgrade.py +++ b/tests/test_ins401_upgrade.py @@ -4,6 +4,8 @@ import signal import struct import threading +import datetime +import re try: from aceinna.core.driver import (Driver, DriverEvents) @@ -22,23 +24,7 @@ from aceinna.devices.ins401.ethernet_provider_ins401 import Provider as EhternetProvider from aceinna.framework.constants import INTERFACES -# Only loop firmware upgrade -# def handle_discovered(device_provider): -# loop_upgrade_cnt = 0 - -# upgrade_log_file = open(r'.\upgrade_log.txt', 'w+') - -# while True: -# if device_provider.is_upgrading == False: -# loop_upgrade_cnt += 1 -# print('loop_upgrade_cnt: %d' % loop_upgrade_cnt) -# print('loop_upgrade_cnt: %d' % loop_upgrade_cnt, file = upgrade_log_file, flush = True) - -# device_provider.upgrade_framework(['upgrade', './INS401_28.03a.bin']) -# if loop_upgrade_cnt == 200: -# os._exit(1) - -# time.sleep(5) +setattr(sys, '__dev__', True) # loop firmware upgrade and log def loop_upgrade(EhternetProvider): @@ -46,16 +32,34 @@ def loop_upgrade(EhternetProvider): upgrade_log_file = open(r'.\upgrade_log.txt', 'w+') + # 'upgrade ./INS401_v28.04.20.bin sdk imu' + # 'upgrade ./INS401_v28.04.20.bin rtk ins' + # 'upgrade ./INS401_v28.04.20.bin rtk ins sdk imu' + # 'upgrade ./INS401_v28.04.20.bin' + upgrade_cmd_str = 'upgrade ./INS401_v28.05.bin rtk ins' + + upgrade_cmd_list = re.split(r'\s+', upgrade_cmd_str) + while True: + if EhternetProvider.loop_upgrade_flag: + time.sleep(1) + continue + if EhternetProvider.is_upgrading == False: - time.sleep(10) + time.sleep(1) loop_upgrade_cnt += 1 - print('loop_upgrade_cnt: %d' % loop_upgrade_cnt) - print('loop_upgrade_cnt: %d' % loop_upgrade_cnt, file = upgrade_log_file, flush = True) + print('\nloop_upgrade_cnt: %d\n' % loop_upgrade_cnt) + print(upgrade_cmd_str) - EhternetProvider.upgrade_framework(['upgrade', './INS401_v28.04.20.bin']) + print('\nloop_upgrade_cnt: %d\n' % loop_upgrade_cnt, file = upgrade_log_file, flush = True) + device_info = EhternetProvider._device_info_string.replace('\n', '') + print('{0}\n'.format(device_info), file = upgrade_log_file, flush = True) + print(upgrade_cmd_str, file = upgrade_log_file, flush = True) + print("Upgrade INS401 firmware started at:[{0}].".format(datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')), file = upgrade_log_file, flush = True) - if loop_upgrade_cnt == 300: + EhternetProvider.upgrade_framework(upgrade_cmd_list) + + if loop_upgrade_cnt == 500: os._exit(1) time.sleep(5) @@ -70,12 +74,13 @@ def handle_discovered(EhternetProvider): ntrip_client_thread.start() while True: - if EhternetProvider.is_upgrading == False: + if (EhternetProvider.is_upgrading == False)\ + and (EhternetProvider.loop_upgrade_flag == False): if loop_upgrade_thread: - loop_upgrade_thread.join(1.0) + loop_upgrade_thread.join(0.5) else: if ntrip_client_thread: - ntrip_client_thread.join(1.0) + ntrip_client_thread.join(0.5) def kill_app(signal_int, call_back): diff --git a/tests/test_ins402_commands.py b/tests/test_ins402_commands.py new file mode 100644 index 0000000..f1057ea --- /dev/null +++ b/tests/test_ins402_commands.py @@ -0,0 +1,240 @@ +import sys +import time +import os +import signal +import struct + +try: + from aceinna.core.driver import (Driver, DriverEvents) + from aceinna.models.args import WebserverArgs + from aceinna.framework.utils import (helper) + from aceinna.framework.decorator import handle_application_exception + from aceinna.devices.ins401.ethernet_provider_ins401 import Provider as EhternetProvider + from aceinna.framework.constants import INTERFACES +except: # pylint: disable=bare-except + print('load package from local') + sys.path.append('./src') + from aceinna.core.driver import (Driver, DriverEvents) + from aceinna.models.args import WebserverArgs + from aceinna.framework.utils import (helper) + from aceinna.framework.decorator import handle_application_exception + from aceinna.devices.ins401.ethernet_provider_ins401 import Provider as EhternetProvider + from aceinna.framework.constants import INTERFACES + +INPUT_PACKETS = [b'\x01\xcc', b'\x02\xcc', b'\x03\xcc', b'\x04\xcc', b'\x06\xcc', b'\x01\x0b', b'\x02\x0b', b'\x01\xfc'] +user_parameters = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + + +def get_production_info(dest, src, command): + message_bytes = [] + + command_line = helper.build_ethernet_packet(dest, src, command, message_bytes) + return command_line + +def get_user_configuration_parameters(dest, src, command, field_id): + message_bytes = [] + + field_id_bytes = struct.pack('= 1) and (field_id < 13): + field_value_bytes = struct.pack('