Skip to content

Commit 185aae8

Browse files
committed
autotune: check for new torque setpoint uorb topic
1 parent b3ed55b commit 185aae8

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

autotune/data_extractor.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ def getInputOutputData(logfile, axis, t_start=0.0, t_stop=0.0, instance=0):
4747
y_data = get_data(log, 'vehicle_angular_velocity', 'xyz[{}]'.format(axis))
4848
t_y_data = us2s(get_data(log, 'vehicle_angular_velocity', 'timestamp'))
4949

50-
actuator_controls_n = 'actuator_controls_{}'.format(instance)
51-
u_data = get_data(log, actuator_controls_n, 'control[{}]'.format(axis))
52-
t_u_data = us2s(get_data(log, actuator_controls_n, 'timestamp'))
50+
u_data = get_data(log, 'vehicle_torque_setpoint', 'xyz[{}]'.format(axis))
51+
t_u_data = us2s(get_data(log, 'vehicle_torque_setpoint', 'timestamp'))
52+
53+
if not np.any(u_data):
54+
# Check for legacy topics
55+
actuator_controls_n = 'actuator_controls_{}'.format(instance)
56+
u_data = get_data(log, actuator_controls_n, 'control[{}]'.format(axis))
57+
t_u_data = us2s(get_data(log, actuator_controls_n, 'timestamp'))
5358

5459
(t_aligned, u_aligned, y_aligned) = extract_identification_data(log, t_u_data, u_data, t_y_data, y_data, axis, t_start, t_stop)
5560

0 commit comments

Comments
 (0)