private void DriveEncoderHandler(drive.DriveEncodersUpdate statistics) { LeftEncoderCurrent = statistics.Body.LeftEncoderCurrent; RightEncoderCurrent = statistics.Body.RightEncoderCurrent; LeftPowerCurrent = statistics.Body.LeftPowerCurrent; RightPowerCurrent = statistics.Body.RightPowerCurrent; }
private void driveSensorHandler(drive.DriveEncodersUpdate notification) { //notification.Body.RightPowerTarget vs notification.Body.RightPowerCurrent difference? // This sets the value of motorSpinning to true if the power of any of the motors is not 0 else it sets the // value to false if (notification.Body.RightPowerCurrent != 0 && notification.Body.LeftPowerCurrent != 0) { motorSpinning = true; } else { motorSpinning = false; } // Get current encoder readings (may use in future) rightEncoder = notification.Body.RightEncoderCurrent; leftEncoder = notification.Body.LeftEncoderCurrent; }