You can tell if the code is executing by putting a flag out wth SmartDashboard. IF you are expecting any movement in the ShooterSub.Init() it won’t happen. The motor safety protocol will prevent any motor controllers from running motors while disabled.
Alao, if any of those custom classes are loops, the robot may not actually ever get into DisabledInit() or periodic when it is disabled. That could be dangerous.
Not exactly. When we programmed in labview it was easy to create a situation that could cause the code to get “stuck”
Any loop that is waiting for a condition to exit has the potential to be a loop that holds up the main thread until that condition is reached.
It is difficult to create one that also feeds the watchdog (so the typical behavior when this happens is that the motors do not run), but not impossible.
Init is just a command. So if the robot is eaiting for another command to finish, it will not get called until that other command is called.
For this reason, we use the built in main loop for all of our (looping) functions (save for filling an LEDBuffer) and just run conditional checks on that thread. There are other ways to handle this, but this is the simplest for us that also avoids race conditions.
In this case they are using Java which by default is single threaded. I wouldn’t recommend using a separate thread in a Java project unless you know exactly what you’re doing and how to avoid concurrency issues.