diff --git a/src/shared/actuators/stepper/Stepper.cpp b/src/shared/actuators/stepper/Stepper.cpp index d76f6dfebf538a5e39b7378b5ac5a603d01dbf1c..52804e9fa8d3877c7e59ed460223f9fed102696a 100644 --- a/src/shared/actuators/stepper/Stepper.cpp +++ b/src/shared/actuators/stepper/Stepper.cpp @@ -166,13 +166,8 @@ bool Stepper::isEnabled() { return enabled; } StepperData Stepper::getState(float moveDeg) { - return {TimestampTimer::getTimestamp(), - static_cast<unsigned int>(stepPin.getPort()), - stepPin.getNumber(), - enabled, - getCurrentDegPosition(), - speed, - moveDeg}; + return {TimestampTimer::getTimestamp(), enabled, getCurrentDegPosition(), + speed, moveDeg}; } } // namespace Boardcore \ No newline at end of file diff --git a/src/shared/actuators/stepper/StepperData.h b/src/shared/actuators/stepper/StepperData.h index 096f48f2c6ee567259e56d2a57a91ec4dc10a5a5..8dab2c0501c258eb25d9b3f62c8f28b1759aa1c4 100644 --- a/src/shared/actuators/stepper/StepperData.h +++ b/src/shared/actuators/stepper/StepperData.h @@ -30,24 +30,32 @@ namespace Boardcore struct StepperData { uint64_t timestamp; - unsigned int pulsePinPort; - unsigned int pulsePinNumber; bool enabled; float positionDeg; float speed; float moveDeg; + StepperData() + : timestamp(0), enabled(0), positionDeg(0), speed(0), moveDeg(0) + { + } + + StepperData(uint64_t timestamp, bool enabled, float positionDeg, + float speed, float moveDeg) + : timestamp(timestamp), enabled(enabled), positionDeg(positionDeg), + speed(speed), moveDeg(moveDeg) + { + } + static std::string header() { - return "timestamp,pulsePinPort,pulsePinNumber,enabled,positionDeg," - "speed,moveDeg\n"; + return "timestamp,enabled,positionDeg,speed,moveDeg\n"; } void print(std::ostream& os) const { - os << timestamp << "," << pulsePinPort << "," << pulsePinNumber << "," - << enabled << "," << positionDeg << "," << speed << "," << moveDeg - << "\n"; + os << timestamp << "," << enabled << "," << positionDeg << "," << speed + << "," << moveDeg << "\n"; } };