aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/motan/readlog.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2022-09-03 22:20:20 -0400
committerKevin O'Connor <kevin@koconnor.net>2022-09-05 11:22:40 -0400
commit35e2472bbc1d160eee157690e6baf5a111dc59e0 (patch)
tree0217e1b04f472c7a3724513a323a97e55e8fa172 /scripts/motan/readlog.py
parent9f8f3cd77d97339bd825053b064ae4d08d5d6902 (diff)
downloadkutter-35e2472bbc1d160eee157690e6baf5a111dc59e0.tar.gz
kutter-35e2472bbc1d160eee157690e6baf5a111dc59e0.tar.xz
kutter-35e2472bbc1d160eee157690e6baf5a111dc59e0.zip
motan: Improve reading of initial step position data
Seed the initial position from the first read position, even if it is some time into the capture. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'scripts/motan/readlog.py')
-rw-r--r--scripts/motan/readlog.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/motan/readlog.py b/scripts/motan/readlog.py
index 513ad726..f49f0b59 100644
--- a/scripts/motan/readlog.py
+++ b/scripts/motan/readlog.py
@@ -217,6 +217,8 @@ class HandleStepQ:
inv_freq = tdiff / cdiff
step_dist = jmsg['step_distance']
step_pos = jmsg['start_position']
+ if not step_data[0][0]:
+ step_data[0] = (0., step_pos, step_pos)
for interval, raw_count, add in jmsg['data']:
qs_dist = step_dist
count = raw_count
@@ -316,6 +318,8 @@ class HandleStepPhase:
if cdiff:
inv_freq = tdiff / cdiff
step_pos = jmsg['start_mcu_position']
+ if not step_data[0][0]:
+ step_data[0] = (0., step_pos)
for interval, raw_count, add in jmsg['data']:
qs_dist = 1
count = raw_count