From a3a643309980d9a083c504673e0b2a8a35f4affd Mon Sep 17 00:00:00 2001 From: eric Date: Sun, 7 Apr 2024 10:26:23 -0400 Subject: [PATCH] odom reading state --- src/teleoperation/backend/consumers.py | 5 ++++- src/teleoperation/db.sqlite3 | Bin 139264 -> 139264 bytes .../frontend/src/components/AutonTask.vue | 4 +++- .../frontend/src/components/DMESTask.vue | 6 ++++-- .../src/components/OdometryReading.vue | 11 +++++++++++ 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/teleoperation/backend/consumers.py b/src/teleoperation/backend/consumers.py index a66111343..a152677b8 100644 --- a/src/teleoperation/backend/consumers.py +++ b/src/teleoperation/backend/consumers.py @@ -607,9 +607,12 @@ def cmd_vel_callback(self, msg): self.send(text_data=json.dumps({"type": "cmd_vel", "linear_x": msg.linear.x, "angular_z": msg.angular.z})) def gps_fix_callback(self, msg): + fixed = True + if msg.status == -1: + fixed = False self.send( text_data=json.dumps( - {"type": "nav_sat_fix", "latitude": msg.latitude, "longitude": msg.longitude, "altitude": msg.altitude} + {"type": "nav_sat_fix", "latitude": msg.latitude, "longitude": msg.longitude, "altitude": msg.altitude, "status": fixed} ) ) diff --git a/src/teleoperation/db.sqlite3 b/src/teleoperation/db.sqlite3 index b8faa90637c5ec8f9ac8e6e70a1b1965e05498d0..0b06bb4f87b0d8e1bd1497bbaa19e0e2245b768e 100644 GIT binary patch delta 29 lcmZoTz|nAkV}dke+(a2?);I<|`

Altitude: {{ odom.altitude.toFixed(2) }}m

+
+

Status: {{get_status}}

+
@@ -64,6 +67,14 @@ export default { }, alt_available: function () { return !isNan(this.odom.altitude) + }, + get_status: function () { + if(this.odom.status){ + return "fixed" + } + else{ + return "not fixed" + } } } }