Skip to content

Commit

Permalink
Merge pull request #14 from Aceinna/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
lihaiyong827 authored Feb 15, 2023
2 parents dab003f + 1c36379 commit 9f30284
Show file tree
Hide file tree
Showing 27 changed files with 3,602 additions and 734 deletions.
38 changes: 37 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

Expand Down
79 changes: 66 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path to data folder/session data subfolder>
```

## ins402

```shell
./acenav parse -t ins402 -p <path to data folder/session data subfolder>
```

#### 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 <INS401 FW file path>

# 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 <INS401 FW file path> rtk ins
or
>>upgrade <INS401 FW file path> sdk
or
>>upgrade <INS401 FW file path> imu
or
>>upgrade <INS401 FW file path> imu_boot
>>upgrade <INS401 FW file path> <one or more components are optional, the names of adjacent components are separated by a space bar>

eg:
>>upgrade <INS401 FW file path> 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 <INS402 FW file path>

# 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 <INS402 FW file path> <one or more components are optional, the names of adjacent components are separated by a space bar>

eg:
>>upgrade <INS402 FW file path> 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 <Ins401 serial number>
```

# ins402
```shell
./acenav -i 100base-t1 --device-type INS402 -sn <Ins402 serial number>
```

# canfd app

### run
please run $Env:PYTHONPATH="./src/aceinna/devices/widgets;"+$Env:PYTHONPATH in powershell
Expand All @@ -90,4 +143,4 @@ set "canfd_type": "canfd",
set "canfd_type": "can"

#### Parse
***python main.py parse -t ins401c -p <path to data folder>***
./acenav parse -t ins401c -p <path to data folder>
3 changes: 2 additions & 1 deletion run_with_bat.bat
Original file line number Diff line number Diff line change
@@ -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...
2 changes: 1 addition & 1 deletion src/aceinna/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Package Version
VERSION = '2.6.6'
VERSION = '2.6.7'
PACKAGE_NAME = 'acenav'
90 changes: 65 additions & 25 deletions src/aceinna/bootstrap/canfd_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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)
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -356,27 +365,47 @@ 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',
"version": version
}
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):
Expand All @@ -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'
Expand Down Expand Up @@ -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):
Expand All @@ -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:
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/aceinna/bootstrap/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import threading
from os import getpid
import psutil
import re
# from .web import Webserver
from ..models import WebserverArgs

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/aceinna/bootstrap/log_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion src/aceinna/devices/configs/ins401_predefine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Loading

0 comments on commit 9f30284

Please sign in to comment.