Skip to content

Commit

Permalink
updated csv to log in real time, commented time diff with robots
Browse files Browse the repository at this point in the history
  • Loading branch information
rclarke0 committed Feb 28, 2024
1 parent 8e55ce9 commit 7b51761
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions hardware-testing/hardware_testing/scripts/abr_asair_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 7b51761

Please sign in to comment.