From 7b51761b5264128a8daf33da09c7b93afc75c307 Mon Sep 17 00:00:00 2001 From: rclarke0 Date: Wed, 28 Feb 2024 16:39:55 -0500 Subject: [PATCH] updated csv to log in real time, commented time diff with robots --- .../hardware_testing/scripts/abr_asair_sensor.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hardware-testing/hardware_testing/scripts/abr_asair_sensor.py b/hardware-testing/hardware_testing/scripts/abr_asair_sensor.py index d59f10ae2e2..a42bfa7baf5 100644 --- a/hardware-testing/hardware_testing/scripts/abr_asair_sensor.py +++ b/hardware-testing/hardware_testing/scripts/abr_asair_sensor.py @@ -24,7 +24,6 @@ def __init__(self, robot: str, duration: int, frequency: int) -> None: try: sys.path.insert(0, "/var/lib/jupyter/notebooks") import google_sheets_tool # type: ignore[import] - credentials_path = "/var/lib/jupyter/notebooks/abr.json" except ImportError: raise ImportError( @@ -62,7 +61,8 @@ def __init__(self, robot: str, duration: int, frequency: int) -> None: while True: env_data = sensor.get_reading() timestamp = datetime.datetime.now() - new_timestamp = timestamp - datetime.timedelta(hours=5) + # Time adjustment for ABR robot timezone + new_timestamp = timestamp - datetime.timedelta(hours=5) date = new_timestamp.date() time = new_timestamp.time() temp = env_data.temperature @@ -94,12 +94,10 @@ def __init__(self, robot: str, duration: int, frequency: int) -> None: t.sleep(frequency * 60) # seconds # Upload to robot testing data folder - result_string = "" for sublist in results_list: row_str = ", ".join(map(str, sublist)) + "\n" # type: str - result_string += row_str save_file_path = data.append_data_to_file( - test_name, run_id, file_name, result_string + test_name, run_id, file_name, row_str ) print(f"Saved to robot: f{save_file_path}.") print(