Third, memory management. Anything created with 'new' must eventually be deleted. RobotInit() is kind of the exception since it's only called once, but most of those dynamically allocated objects can be replaced with static objects. Any other allocations need to be deleted, mostly likely in DisabledInit().
So I've been doing some research and have some ideas about debugging the problem with the robot running out of control...
First, there's a way to connect to the robot's console from within Eclipse. I don't know if this is the same console that's viewed in the driver station, but it's worth taking a look at to see if there's any sort of error message displayed. https://wpilib.screenstepslive.com/s/4485/m/13810/l/284333-using-riolog-to-view-console-output
Second, supposedly an actual debugger is available, also from within Eclipse. If we can run with this active or attach the debugger after the problem we should be able to see what's going on. https://wpilib.screenstepslive.com/s/4485/m/13810/l/145321-debugging-a-robot-program
Third, memory management. Anything created with 'new' must eventually be deleted. RobotInit() is kind of the exception since it's only called once, but most of those dynamically allocated objects can be replaced with static objects. Any other allocations need to be deleted, mostly likely in DisabledInit().