Code deployed to roboRio successfully but keeps crashing

We have successfully deployed our c++ code to our roboRio, but it crashes every few seconds. The RioLog displays the the message:

  • Set Camera Server Shared

  • Default DisabledInit() method… Override me!

  • Default DisabledPeriodic() method… Override me!

For context the code we have written is only to run motors, and there is no camera being used. Here is a link to what we have written:
Does anyone know what might be wrong?

The problem is you are passing references to local variables to DifferentialDrive on line 32. The SparkMax variables get destroyed when they go out of scope at the end of RobotInit, so DifferentialDrive is holding pointers to destroyed classes. To fix this, put the SparkMax variables in the class definition so they stay in scope for the entire program execution.

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