I am having trouble running tank drive PID position control code.
When I deploy the code, there is a constant “CAN: Message not found” error. I am able to drive with joysticks consistently with no problems.
When I press a button bound to drive using the CAN spark max PID position control, the motors only run sometimes (ex. the first time I press the button nothing happens, I continue pressing it rapidly and maybe after 5 tries it works three times in a row, then stops working). And I get the error “[CAN SPARK MAX] IDs: 10, 15, WPILib or External HAL Error: CAN: No token”. The spark maxs with IDs 10 and 15 are my master drive motor controllers.
My code can be found here: https://github.com/Team236/2022-Robot/tree/master/src/main/java/frc/robot
The command I am having trouble with is called DriveWithPID (but the same problem happens with any command using PID).
Also, when I try to run the drive motors using the REV Hardware Client, the motor controllers do not receive any signals. I am unable to test PID using the client because the motor controllers do not respond. I have tried disconnecting the spark max from the CAN bus.