From 420a5723a73b695b418c1fd567281ce5553a6c92 Mon Sep 17 00:00:00 2001 From: john sandstedt Date: Mon, 22 Feb 2016 19:04:27 -0500 Subject: [PATCH] logging code... fixed the error initializing the DriverStation Object potentially, and fixed a few of the syntax errors ' --- Robot2016/src/Robot.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Robot2016/src/Robot.cpp b/Robot2016/src/Robot.cpp index a72b64b..e847442 100644 --- a/Robot2016/src/Robot.cpp +++ b/Robot2016/src/Robot.cpp @@ -31,6 +31,7 @@ class Robot: public IterativeRobot RobotDrive drive; Shooter shooter; Joystick driver_stick, operator_stick; + DriverStation ds; float power; public: Robot(): @@ -45,6 +46,7 @@ public: driver_stick(0), // right stick (operator) operator_stick(1) // left stick (driver) { + ds.GetInstance(); } @@ -59,11 +61,10 @@ private: const std::string autoNameCustom = "My Auto"; std::string autoSelected; - void LogData() + /*void LogData() { static PowerDistributionPanel pdp; - static DriverStation* ds = DriverStation::GetInstance(); - static DriverStation* ds = DriverStation::GetInstance(); + static DriverStation ds = DriverStation::GetInstance(); static std::vector motors; static std::ofstream logA, logB, logC; @@ -72,7 +73,7 @@ private: SmartDashboard::PutBoolean("log A", logA.is_open()); SmartDashboard::PutBoolean("log B", logB.is_open()); SmartDashboard::PutBoolean("log C", logC.is_open()); - } + }*/ void RobotInit() { @@ -190,7 +191,6 @@ private: void LogCSVData() { static PowerDistributionPanel pdp; // preparing to read from the pdp - static DriverStation* ds = DriverStation::GetInstance(); static std::vector motors; static std::ofstream logA, logB, logC; @@ -261,11 +261,11 @@ private: LOG("\t" << driver_stick.GetTwist()); //DriverStation Data - LOG("\t" << ds->GetAlliance()); - LOG("\t" << ds->GetLocation()); - LOG("\t" << ds->GetMatchTime()); - LOG("\t" << ds->IsFMSAttached()); - LOG("\t" << ds->IsSysBrownedOut()); + LOG("\t" << ds.GetAlliance()); + LOG("\t" << ds.GetLocation()); + LOG("\t" << ds.GetMatchTime()); + LOG("\t" << ds.IsFMSAttached()); + LOG("\t" << ds.IsSysBrownedOut()); LOG(std::endl); } };