mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-22 20:36:06 +08:00
Fix small bugs (#2945)
This commit is contained in:
@@ -139,7 +139,9 @@ void imu_aspirin_event(void)
|
||||
|
||||
adxl345_spi_event(&imu_aspirin.acc_adxl);
|
||||
if (imu_aspirin.acc_adxl.data_available) {
|
||||
AbiSendMsgIMU_ACCEL_RAW(IMU_ASPIRIN_ID, now_ts, &imu_aspirin.acc_adxl.data.vect, 1, NAN);
|
||||
struct Int32Vect3 accel;
|
||||
VECT3_COPY(accel, imu_aspirin.acc_adxl.data.vect);
|
||||
AbiSendMsgIMU_ACCEL_RAW(IMU_ASPIRIN_ID, now_ts, &accel, 1, NAN);
|
||||
imu_aspirin.acc_adxl.data_available = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,10 @@ def get_ids_in_log(filename):
|
||||
def get_sensor_ids(ac_id, filename, sensor):
|
||||
f = open(filename, 'r')
|
||||
ids = []
|
||||
pattern = re.compile("\S+ "+ac_id+" IMU_"+sensor+"_RAW (\S+) \S+ \S+ \S+")
|
||||
if sensor == 'MAG':
|
||||
pattern = re.compile("\S+ "+ac_id+" IMU_"+sensor+"_RAW (\S+) \S+ \S+ \S+")
|
||||
else:
|
||||
pattern = re.compile("\S+ "+ac_id+" IMU_"+sensor+"_RAW (\S+) \S+ \S+ \S+ \S+")
|
||||
while True:
|
||||
line = f.readline().strip()
|
||||
if line == '':
|
||||
@@ -67,7 +70,10 @@ def get_sensor_ids(ac_id, filename, sensor):
|
||||
def read_log(ac_id, filename, sensor, sensor_id):
|
||||
"""Extracts raw sensor measurements from a log."""
|
||||
f = open(filename, 'r')
|
||||
pattern = re.compile("(\S+) "+ac_id+" IMU_"+sensor+"_RAW "+sensor_id+" (\S+) (\S+) (\S+)")
|
||||
if sensor == 'MAG':
|
||||
pattern = re.compile("(\S+) "+ac_id+" IMU_"+sensor+"_RAW "+sensor_id+" (\S+) (\S+) (\S+)")
|
||||
else:
|
||||
pattern = re.compile("(\S+) "+ac_id+" IMU_"+sensor+"_RAW "+sensor_id+" \S+ (\S+) (\S+) (\S+)")
|
||||
list_meas = []
|
||||
while True:
|
||||
line = f.readline().strip()
|
||||
|
||||
Reference in New Issue
Block a user