Hi all,
We’d like to read wind speed/direction from a Lua script (ArduRover 4.6.3), but can’t find any way to access AP_WindVane data from scripting.
We checked bindings.desc on master and don’t see an AP_WindVane singleton defined anywhere. We also directly tested several plausible global names (windvane, wind_vane, WindVane, windVane, Wind_Vane) on actual hardware and all come back nil, both with SAIL_ENABLE=0 and =1 (after reboot). That seems consistent with wind vane data being accessed internally as g2.windvane (e.g. in Rover/mode_loiter.cpp: degrees(g2.windvane.get_true_wind_direction_rad())) - a member of Rover’s own vehicle-specific object, rather than a standalone top-level singleton the way AP_AHRS/AP_GPS/etc. are bound.
A few questions:
- Is this a known gap, or are we missing an existing way to access wind vane data from scripting?
- Is there any interest in adding a Lua binding for AP_WindVane (true/apparent wind speed and direction, maybe enabled()/health status)? The AP_Button scripting binding PR (#12887) looks like a good precedent for adding a binding for a previously-unexposed subsystem, and we’d be happy to test one if added.
- If we attempted adding this ourselves via bindings.desc, is there anything windvane-specific we should know first (multi-instance considerations, or reasons this hasn’t been added already)?
Thanks in advance!