Hairo ROBOCON2021 TrackedVehicle moudule library. Ibaraki KOSEN
Dependents: hairobo2021_F446re
Diff: TrackedVehicle.cpp
- Revision:
- 1:132886173bec
- Parent:
- 0:b5561184f201
--- a/TrackedVehicle.cpp Fri Nov 26 00:29:28 2021 +0000 +++ b/TrackedVehicle.cpp Sun Dec 05 01:30:13 2021 +0000 @@ -3,8 +3,8 @@ TrackedVehicle::TrackedVehicle(uint16_t rightID, uint16_t leftID) : RightID(rightID), LeftID(leftID), RightMsg(rightID, RightData, 3, CANData, CANStandard), LeftMsg(leftID, LeftData, 3, CANData, CANStandard) { ModuleStatus = INITIAL_STATUS; - CWDuty = CW30_DUTY; - CCWDuty = CCW30_DUTY; + CWDuty = CW50_DUTY; + CCWDuty = CCW50_DUTY; EncoderPulse = 4096; MaxTargetPulse = EncoderPulse + 113; MinTargetPulse = EncoderPulse - 113; @@ -103,10 +103,9 @@ } else if(EncoderPulse < MinTargetPulse ) { /* 超信地右旋回 */ RightMsg.data[DUTY] = CWDuty; - LeftMsg.data[DUTY] = CCWDuty - ; + LeftMsg.data[DUTY] = CCWDuty; - } else { + } else if(EncoderPulse >= MinTargetPulse && EncoderPulse <= MaxTargetPulse){ RightMsg.data[DUTY] = BREAK_DUTY; LeftMsg.data[DUTY] = BREAK_DUTY; }