SwitchableVisionSender

Utility component to switch between different feeds and processors with FtcDashboard and the DS "Camera Stream". The Driver Station usually culminates all processors into a single feed preview, and it is not very helpful to see the same feed when debugging across different processors. All processors in BunyipsLib automatically make their own feeds, and we can use this to send different processors as previews. This sender will also try and set the DS feed to the same processor as FtcDashboard, but it is more efficient to use the FtcDashboard feed for debugging -- if available.

This sender is not a traditional subsystem, as it is designed to run on another thread not a part of the main loop, similar to how Vision is handled. When started, SwitchableVisionSender will automatically manage the FtcDashboard/DS feed and processor switching, and should be interrupted automatically if used with the Threads utility at the end of a BunyipsOpMode. Ensure to manage your threads properly if not using the Threads utility/methods attached to Vision.

Author

Lucas Bubner, 2024

Since

1.0.0-pre

Constructors

Link copied to clipboard
constructor(@NonNull firstInstance: Vision)
Create a new SwitchableVisionSender.

Properties

Link copied to clipboard
Can be changed dynamically via FtcDashboard.
Link copied to clipboard
Can be changed dynamically via FtcDashboard.
Link copied to clipboard
open var MAX_FPS: Int
The maximum FPS to send to FtcDashboard.

Functions

Link copied to clipboard
open fun addInstance(@NonNull instance: Vision): Int
Add an instance that can later be accessed dynamically for selection through CURRENT_PREVIEWING_VISION_INSTANCE_INDEX.
Link copied to clipboard
open fun run()
Link copied to clipboard
open fun setInstance(index: Int)
Set the index to use for vision previews.
open fun setInstance(@NonNull instance: Vision)
Set the instance to use for vision previews.
Link copied to clipboard
open fun setStreamingProcessor(processorName: String)
Programmatically set the processor to send to FtcDashboard