From aa12f1ff173a1aae907b152eabc5e92076c17e9a Mon Sep 17 00:00:00 2001 From: Fisch Date: Sun, 21 Mar 2021 19:03:45 +0100 Subject: [PATCH] change output log to more sensible values --- controller_teensy/src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/controller_teensy/src/main.cpp b/controller_teensy/src/main.cpp index 5d3d851..acdf868 100644 --- a/controller_teensy/src/main.cpp +++ b/controller_teensy/src/main.cpp @@ -393,10 +393,10 @@ void writeLog(HardwareSerial &SerialRef, unsigned long time, MotorParameter &mpf SerialRef.print(mprear.cmdL); SerialRef.print(","); SerialRef.print(mprear.cmdR); SerialRef.print(","); - SerialRef.print(mpfront.filtered_curL,3); SerialRef.print(","); - SerialRef.print(mpfront.filtered_curR,3); SerialRef.print(","); - SerialRef.print(mprear.filtered_curL,3); SerialRef.print(","); - SerialRef.print(mprear.filtered_curR,3); SerialRef.print(","); + SerialRef.print(-mpfront.filtered_curL,3); SerialRef.print(","); //invert. positive current is drive current + SerialRef.print(-mpfront.filtered_curR,3); SerialRef.print(","); + SerialRef.print(-mprear.filtered_curL,3); SerialRef.print(","); + SerialRef.print(-mprear.filtered_curR,3); SerialRef.print(","); SerialRef.print(-fbfront.speedL_meas); SerialRef.print(","); //invert speed, because left wheels are negated SerialRef.print(fbfront.speedR_meas); SerialRef.print(","); @@ -408,7 +408,7 @@ void writeLog(HardwareSerial &SerialRef, unsigned long time, MotorParameter &mpf SerialRef.print(fbfront.batVoltage/100.0); SerialRef.print(","); //in V SerialRef.print(fbrear.batVoltage/100.0); SerialRef.print(","); //in V - SerialRef.print(currentAll,3); SerialRef.print(","); + SerialRef.print(-currentAll,3); SerialRef.print(","); //invert. positive current is drive current SerialRef.print(throttle); SerialRef.print(","); SerialRef.print(brake); SerialRef.println(); } \ No newline at end of file