From 3dea3e6d5d10bd19ab8c2c116384708db14dd9a0 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Tue, 6 Jun 2023 17:46:27 +0200 Subject: [PATCH] fix bat perc --- api/views/index.ejs | 4 ++-- src/api_communication/api_communication/api_listener.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/views/index.ejs b/api/views/index.ejs index a636bc86..50c43486 100644 --- a/api/views/index.ejs +++ b/api/views/index.ejs @@ -55,7 +55,7 @@

Current speed

Current position

-

Failsafe not enabled

+

Failsafe not activated

@@ -118,7 +118,7 @@ document.getElementById("speed").innerHTML = "Current speed (m/s): x: " + data.data.velocity[0] + " y: " + data.data.velocity[1] + " z: " + data.data.velocity[2]; document.getElementById("position").innerHTML = "Current position (m): x: " + data.data.position[0] + " y: " + data.data.position[1] + " z: " + data.data.position[2]; } else if (data.type == "FAILSAFE") { - document.getElementById("failsafe").innerHTML = "Failsafe: ENABLED"; + document.getElementById("failsafe").innerHTML = "Failsafe: ACTIVATED"; document.getElementById("failsafe").style.backgroundColor = "red"; document.getElementById("failsafe").style.color = "white"; document.getElementById("failsafe").style.textDecoration = "bold"; diff --git a/src/api_communication/api_communication/api_listener.py b/src/api_communication/api_communication/api_listener.py index d6b7fdd7..964a6bab 100644 --- a/src/api_communication/api_communication/api_listener.py +++ b/src/api_communication/api_communication/api_listener.py @@ -143,7 +143,7 @@ class ApiListener(Node): try: self.status_data_received = True self.status_data['battery_percentage'] = msg.battery_percentage - if msg.battery_percentage < 0.15: + if msg.battery_percentage < 15: self.enable_failsafe( "Battery level too low! Failsafe enabled to prevent damage to battery (" + str(msg.battery_percentage * 10) + "%)") self.status_data['cpu_usage'] = msg.cpu_usage