From 15f916c1225bcbaa4ce6c87afb7b65bf36f54420 Mon Sep 17 00:00:00 2001 From: Binghamton University Rover Team Date: Fri, 2 Feb 2024 10:01:04 -0500 Subject: [PATCH] Disabled some logs --- bin/motor.dart | 4 ++-- lib/can.dart | 2 +- lib/src/can/socket_ffi.dart | 4 ++-- lib/src/serial/imu.dart | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/motor.dart b/bin/motor.dart index 256445a..5cd8907 100644 --- a/bin/motor.dart +++ b/bin/motor.dart @@ -1,13 +1,13 @@ import "package:subsystems/subsystems.dart"; import "package:burt_network/logging.dart"; -const speed = [0, 0, 0x10, 0]; +const speed = [0, 0, 0x9, 0xc4]; void main() async { Logger.level = LogLevel.info; await collection.init(); while (true) { - collection.can.can.sendMessage(id: 0x303, data: speed); + collection.can.can.sendMessage(id: 0x304, data: speed); await Future.delayed(const Duration(milliseconds: 500)); } } diff --git a/lib/can.dart b/lib/can.dart index b97c2f3..72d4fc1 100644 --- a/lib/can.dart +++ b/lib/can.dart @@ -60,7 +60,7 @@ class CanService { /// Handles an incoming CAN message. void onMessage(CanMessage message) { final name = dataCanIDs[message.id]; - logger.debug("Received CAN message (0x${message.id.toRadixString(16)}): ${message.data}. Name=${name ?? 'None'}"); +// logger.debug("Received CAN message (0x${message.id.toRadixString(16)}): ${message.data}. Name=${name ?? 'None'}"); if (name == null) { logger.warning("Received CAN message with unknown ID", body: "ID=0x${message.id.toRadixString(16)}"); return; diff --git a/lib/src/can/socket_ffi.dart b/lib/src/can/socket_ffi.dart index 902d7e9..f5bc06c 100644 --- a/lib/src/can/socket_ffi.dart +++ b/lib/src/can/socket_ffi.dart @@ -106,9 +106,9 @@ class CanFFI implements CanSocket { if (pointer.ref.length == 0) break; count++; if (count % 10 == 0) { - logger.warning("CAN Buffer is full", body: "Processed $count messages in one callback. Consider decreasing the CAN read interval."); + logger.warning("CAN Buffer is full", body: "Processed $count messages in one callback. Consider decreasing the CAN read interval."); } - final message = CanMessage.fromPointer(pointer, isNative: true); + final message = CanMessage.fromPointer(pointer, isNative: true); _controller.add(message); } } diff --git a/lib/src/serial/imu.dart b/lib/src/serial/imu.dart index e3de705..3ced1d3 100644 --- a/lib/src/serial/imu.dart +++ b/lib/src/serial/imu.dart @@ -25,7 +25,7 @@ class ImuReader { void handleOsc(List data) { try { final message = OSCMessage.fromBytes(data.sublist(20)); - logger.debug("Received: $message"); +// logger.debug("Received: $message"); final orientation = Orientation( x: message.arguments[0] as double, y: message.arguments[1] as double, @@ -33,15 +33,15 @@ class ImuReader { ); if (orientation.x.isZero() || orientation.y.isZero() || orientation.z.isZero()) return; if (orientation.x > 360 || orientation.y > 360 || orientation.z > 360) { - logger.trace("Got invalid orientation", body: "x=${orientation.x}, y=${orientation.y}, z=${orientation.z}"); +// logger.trace("Got invalid orientation", body: "x=${orientation.x}, y=${orientation.y}, z=${orientation.z}"); return; } - logger.debug("Got orientation: x=${orientation.x}, y=${orientation.y}, z=${orientation.z}"); +// logger.debug("Got orientation: x=${orientation.x}, y=${orientation.y}, z=${orientation.z}"); final position = RoverPosition(orientation: orientation); collection.server.sendMessage(position); } catch (error) { final rawLine = utf8.decode(data.sublist(20), allowMalformed: true); - logger.debug("Got invalid line from IMU", body: rawLine); +// logger.debug("Got invalid line from IMU", body: rawLine); } }