acmerobotics / ftc-dashboard

React-based web dashboard designed for FTC
https://acmerobotics.github.io/ftc-dashboard
Other
168 stars 125 forks source link

Field overlay blinks when using telemetry #141

Closed manthey closed 10 months ago

manthey commented 11 months ago

If you use FtcDashboard.getInstance().getTelemetry() for your opmode telemetry, and you want to add a field overlay via TelemetryPacket packet = new TelemetryPacket(); and Canvas canvas = packet.fieldOverlay(); and eventually a ftcDashboard dashboard = FtcDashboard.getInstance(); and dashboard.sendTelemetryPacket(packet);, the field overlay blinks.

Specifically, the original telemetry clears the field overlay and the new packet sends the drawing instructions to the field overlay. Am I missing a way to ask the ordinary telemetry to not clear the field overlay or a way to get the ordinary telemetry packet so I can get the fieldOverlay reference of that packet? Is there more appropriate way to send telemetry to the driver station and FTC dashboard AND send a field overlay without duplicating by addData and other calls?

Thank you.

rbrott commented 11 months ago

You can avoid the flickering by creating your empty field overlay packets with new TelemetryPacket(false).