How to disable motor safety using a mecanum drive?

We can’t get our motor safety to be disabled.

frc::PWMVictorSPX m_frontLeft{kFrontLeftChannel};

frc::PWMVictorSPX m_rearLeft{kRearLeftChannel};

frc::PWMVictorSPX m_frontRight{kFrontRightChannel};

frc::PWMVictorSPX m_rearRight{kRearRightChannel};

frc::VictorSP m_lift1{4};

frc::VictorSP m_lift2{5};


frc::MecanumDrive m_robotDrive{m_frontLeft, m_rearLeft, m_frontRight,m_rearRight};

Motor safety means you’re not outputting a command to move it fast enough. You can generally use the .feed() function in your non-controlled loop, but it’s far more useful to understand why you’re getting motor safety warnings at all.

We are doing: sleep_until(system_clock::now() + seconds(4));

However the motor safety detects that nothing is controlling the motor turning the motor off prematurely

It would be helpful to post the rest of your code in order to see the overall context.
If you are using any form of IterativeRobot (TimedRobot), you shouldn’t be using any sleep statements at all- doing so will block the main loop and prevent other code from executing.

1 Like

Also, if you’re using command based, you should be able to just use your commands with a timeout to avoid having to use sleep functions.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.