From f6bc110c9edefc0c9d79a86dd0895484284a326d Mon Sep 17 00:00:00 2001 From: MENGHUNG WU Date: Wed, 3 Nov 2021 18:59:11 +0900 Subject: [PATCH] fix exponential notation bug when use csv writer --- scripts/collect_imu_data.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/collect_imu_data.py b/scripts/collect_imu_data.py index 9250df4..8101148 100644 --- a/scripts/collect_imu_data.py +++ b/scripts/collect_imu_data.py @@ -14,10 +14,11 @@ def imu_cb(data): if g_count < SAMPLE_NUM: with open(FILE, 'a') as f: writer = csv.writer(f) - line = ( - f'{data.angular_velocity.x}{data.angular_velocity.y}' - f'{data.angular_velocity.z}{data.linear_acceleration.x}' - f'{data.linear_acceleration.y}{data.linear_acceleration.z}') + line = [ + data.angular_velocity.x, data.angular_velocity.y, + data.angular_velocity.z, data.linear_acceleration.x, + data.linear_acceleration.y, data.linear_acceleration.z + ] writer.writerow(line) if g_count == SAMPLE_NUM: