CTRE Halsim

I am working with WPILib’s 2020 HALSIM GUI, and noticed that all CTRE devices don’t show up in the “other devices” list. Is there a way to make this work? or a way to hack it together?

It looks like the initial CTRE release doesn’t support the GUI. You can make your own wrapper class to do this that uses the SimDevice class in the HAL package–see the ADXRS450_Gyro class for example usage. The basic concept is you create a SimDevice and SimValues in the constructor, then use the SimValue in the get/set interface functions to “mock” the behavior of the function. SimDevice and SimValue have dummy functionality in the RoboRIO HAL so it’s easy to only apply the simulation functionality during simulation. You didn’t say whether you were using C++ or Java–if I knew that I could provide a bit better code examples.

3 Likes

Thank you! It works exactly how I was wanting

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.