Open
Conversation
d4c7dfb to
3c94840
Compare
3c94840 to
60d64c6
Compare
60d64c6 to
e4e4af5
Compare
e4e4af5 to
950b17e
Compare
|
Can this be used together with standard MSP canvas OSD? |
The ScriptingOSD test requires SFML which is not available in the CI environment. Add it to disabled_tests() so CI skips it cleanly rather than failing.
IamPete1
reviewed
Feb 2, 2026
Member
IamPete1
left a comment
There was a problem hiding this comment.
I suspect there should be some semaphores in here somewhere.
I never was very happy with how this ended up. What do you need for your use case? Would it be better to have a scripting page rather than take over the whole OSD?
…word Use the existing literal singleton pattern instead of adding a new get keyword to the generator. This makes the bindings.desc more verbose but avoids adding new generator features.
… get keyword" This reverts commit 78ce3a2.
Remove redundant type check since both branches returned false.
Add get_semaphore() to AP_OSD_Backend that delegates to the parent AP_OSD semaphore. Add semaphore keyword to scripting bindings so that all OSD method calls from Lua are thread-safe with respect to the OSD update thread.
Use customise_SITL_commandline to pass --osd flag so SITL actually creates the OSD window when running the test.
The OSD binding exists when OSD_ENABLED is true, but the underlying backend may be nullptr at runtime (e.g., when SITL is not built with SFML support). The simple "if not osd" check only verifies the binding exists, not whether the backend is valid. Add a pcall-based check that tests if a method call succeeds, which properly detects when the backend is unavailable.
- Remove --osd flag and customise_SITL_commandline as SFML may not be available - Remove SIM_SPEEDUP change that was only needed for visual testing - Remove ScriptingOSD from disabled_tests since the test now properly detects and handles missing OSD backend gracefully
65bfc65 to
4890011
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a rebase of #18000
Summary
Adds Lua scripting bindings for OSD, allowing scripts to write custom content to OSD displays.
Features
osd:write(col, row, text)- Write text at positionosd:clear()- Clear OSD bufferosd:flush()- Push buffer to displayosd:draw_screen()- Request screen redrawosd:get_backend_count()- Get number of backendsosd:get_backend_type(i)- Get backend typeExample Script
See
libraries/AP_Scripting/examples/osd.luafor a full example demonstrating:Testing
Running the autotest with SFML OSD display
To see the OSD window during testing, build SITL with SFML support:
The test will:
The SFML window shows the OSD output in real-time.
Manual testing