Ignore enabled/disabled, control motors anyway

Hello everyone,

I am using a roboRIO not for an FRC robot, but for a self-driving vehicle for a science fair. I have a separate vision processor (NVIDIA Jetson TX2) which handles camera capture and simply hands off a steering angle to the roboRIO. What I want is for the roboRIO to run its very simple program on startup without having to be enabled. I am not planning to bring a Windows computer on the vehicle, and as such I cannot easily make use of the driver station.

I did manage to get some logic to run in the main OperatorControl loop while disabled by removing the OnEnabled() conditional. However, the loop did not start until the robot was initially enabled, and although the logic executed while disabled, the motor would not move.

Is there an initialization function in which I can start a loop and have it control the motors while the robot is disabled? RobotInit didn’t work. Or does WPILib simply disallow all motor control while the robot is disabled?

I am currently using C++ with all of the bundled FRC stuff, but I am willing to use any other development environment on the roboRIO if I have to. (But not LabView, please not LabView…) I’m not going to use this robot in any competitions, so I’m also happy to hack it and modify configuration files.

Thanks!

Is there a reason you need to use a roboRIO for this if you’re doing offboard vision? Why not just use an arduino or raspberry pi or the like to read the signal from the Jetson, do some basic processing, and create a PWM output? That seems a lot easier than trying to “hack” the roboRIO.

I’m no expert in this stuff, but I would think that the default FRC firmware has built-in safety checks to make it impossible to do exactly what you want to do. From FIRST’s standpoint, they need to make sure that no one’s robot ignores the safety protocol and starts while people are still on the field. There may be some other non-FRC firmware for the roboRIO, but I don’t know of it.

You could make the Jetson send spoofed driver station packets that have the enable flag set to true. Our team has an internal use android app that can intercept and override enable/disabled/e-stop flags in driver station packets, so it’s definitely possible.

Disabled means disabled. No outputs are activated. This is hard-coded into the FPGA program provided with the FRC firmware/image and cannot be overridden by any user code.

As others have said disabled means disabled. However, you likely could write a program using libDS that acts as a “driver station” and enables the robot.

You can either write and deploy your own FPGA image, which requires a lot of work, or you can fake some Driver Station packets with a separate program on your RoboRIO, sending them to localhost. Check the LibDS protocol for implementation details.

Alternatively you could use CTRE’s HERO board which has this behavior by default, although you would have to use their C# libraries rather than C++.