GradleRIO Simulation Status

Does anyone know how well supported or active the development of the simulation framework is? I haven’t seen a lot of documentation around it and was wondering what features are actually included with it? I noticed the project page for it on GitHub isn’t very active so I was wondering if the priority of the project has dropped because of the command framework rewrite.

As a C++ team, we would like to get more involved with testing, however there are no frameworks for C++ besides GradleRIO so we are stuck with that.

Also, I’d like to thank the WPILib team and all contributors because even over the past 7 years Ive been involved there has been an exponential increase in programming features and quality of life improvements. (Anyone else remember WindRiver?)

The simulation system works, but it has some key caveats:

  • You can’t use vendor libraries like CTRE or NavX. They don’t provide desktop simulation builds, so you have the option of either not using them at all, or adding your own abstraction layer that uses them on the real robot, but your own code in simulation.
  • The wpilib simulation framework doesn’t run any kind of interactive GUI. There is an extension you can add to make it connect to the Driver Station and publish values to NT, though.

To enable desktop builds, you need to set the desktop build flag to true in your build.gradle, that’s pretty much it. For unit tests, you can use Google Test like any other C++ project, and for simulation you can launch it through VS Code with F5.

You can add HAL Extensions by adding the following to your build.gradle in the dependencies {} block:

simulation "edu.wpi.first.halsim:halsim_ds_socket:${wpi.wpilibVersion}:${wpi.platforms.desktop}debug@zip

(you can change that to match any of the extensions we build, or any combination: https://github.com/wpilibsuite/allwpilib/tree/master/simulation )

We’re going to work on the docs for simulation for 2020, since the support still wasn’t quite ironed out when we started 2019.

3 Likes