robotpy / mostrobotpy

Official Repository of python implementation of WPILib components
https://robotpy.github.io
Other
11 stars 14 forks source link

Missing hal.simulation functions for registering sim callbacks #90

Closed bhall-ctre closed 7 months ago

bhall-ctre commented 7 months ago

Problem description

Some of the hal.simulation functions for registering callbacks are missing. For example, there is no registerSimValueChangedCallback, even though there is a cancelSimValueChangedCallback. These callbacks are necessary for vendors to use WPILib sim GUI inputs.

I believe all the relevant callback APIs are in SimDeviceData.h: https://github.com/wpilibsuite/allwpilib/blob/main/hal/src/main/native/include/hal/simulation/SimDeviceData.h

Operating System

Windows

Installed Python Packages

pyfrc                          2024.0.1
pyntcore                       2024.3.2.0
robotpy                        2024.3.2.1
robotpy-cli                    2024.0.0
robotpy-commands-v2            2024.3.1
robotpy-hal                    2024.3.2.0
robotpy-halsim-gui             2024.3.2.0
robotpy-installer              2024.2.2
robotpy-wpilib-utilities       2024.0.0
robotpy-wpimath                2024.3.2.0
robotpy-wpinet                 2024.3.2.0
robotpy-wpiutil                2024.3.2.0
wpilib                         2024.3.2.0

Reproducible example code

No response

TheTripleV commented 7 months ago

https://github.com/robotpy/mostrobotpy/blob/main/subprojects/robotpy-hal/gen/simulation/SimDeviceData.yml

They are all manually ignored right now for some reason.

virtuald commented 7 months ago

Nobody ever needed them so I never bothered. It shouldn't be that bad. Which specific callbacks do you need?

bhall-ctre commented 7 months ago

We specifically only need registerSimValueChangedCallback right now, as that's the callback that's triggered when users change the value of SimDevice fields in the sim GUI.