Determine where our code is run

testing
java

#1

We have a custom logging library (which is a part of our dbug-kit toolkit) that we use since 2015, and now as we started to test some of our code on our desktop computers before uploading it to the RIOs we want to be able to not run some stuff that are RIO specific (for example, change the directory where the logs are stored between the RIO and our desktop code).

Is there a way to detect using WPILib or some other Java library whether the code is run on a RoboRIO or on a desktop computer?


#2

Yeah, you can use the RobotBase.isReal function to get if the code is running on the roboRIO or another platform.