diff --git a/api/index.js b/api/index.js index 79acf474..c5643657 100644 --- a/api/index.js +++ b/api/index.js @@ -18,7 +18,7 @@ var ws; var api_connected = false; function send_events_to_clients(data) { - console.log("sending events to clients"); + // console.log("sending events to clients"); sse_clients.forEach((client) => { client.response.write("event: message\n"); client.response.write("data:" + JSON.stringify(data) + "\n\n"); diff --git a/api/views/index.ejs b/api/views/index.ejs index 98dcda15..ab774455 100644 --- a/api/views/index.ejs +++ b/api/views/index.ejs @@ -55,7 +55,7 @@

Current speed

Current position

-

Failsafe status

+

Failsafe not enabled

diff --git a/src/api_communication/api_communication/api_listener.py b/src/api_communication/api_communication/api_listener.py index 8566aa16..73d58c3e 100644 --- a/src/api_communication/api_communication/api_listener.py +++ b/src/api_communication/api_communication/api_listener.py @@ -138,8 +138,8 @@ class ApiListener(Node): self.armed = msg.armed self.status_data['control_mode'] = msg.control_mode self.status_data['route_setpoint'] = msg.route_setpoint - self.status_data['velocity'] = [float(msg.velocity[0]), float(msg.velocity[1]), float(msg.velocity[2])] - self.status_data['position'] = [float(msg.position[0]), float(msg.position[1]), float(msg.position[2])] + self.status_data['velocity'] = [int(msg.velocity[0]), int(msg.velocity[1]), int(msg.velocity[2])] + self.status_data['position'] = [int(msg.position[0]), int(msg.position[1]), int(msg.position[2])] self.status_data['failsafe'] = msg.failsafe except Exception as e: self.get_logger().error( @@ -166,7 +166,7 @@ class ApiListener(Node): Args: message (JSON object): the message to send """ - self.get_logger().info(f'Publishing message: {message}') + # self.get_logger().info(f'Publishing message: {message}') if self.websocket is not None: try: await self.websocket.send(message) @@ -193,7 +193,7 @@ class ApiListener(Node): """ while True: if len(self.message_queue) > 0 and self.websocket is not None: - self.get_logger().info("sending message") + # self.get_logger().info("sending message") asyncio.run(self.publish_message(self.message_queue.pop(0))) def start_api_thread(self):