Is the Telemetry display format always set back to classic when a new OpMode starts?

The TelemetryImpl class doesn’t seem to set it back CLASSIC, but it also does not keep track of the display format.

What SDK version are you using? Can you provide any sample code?

What SDK version are you using?

12.0

Can you provide any sample code?

Sorry I didn’t really understand, sample code for what?

Sample code that I can run on my Control Hub that will reproduce the issue you’re describing. Also, what effects does this have on your operation?

Sorry it tool me ages to respond, I was very busy.

@TeleOp
public class HtmlCarryOver extends OpMode {
    @Override
    public void init() {
        telemetry.setDisplayFormat(Telemetry.DisplayFormat.HTML);
    }

    @Override
    public void loop() {
        telemetry.addLine("<b>Test</b>");
    }
}

If you run this OpMode it will print the line: Test

I am wondering if you run this OpMode again (without rebuilding) but without telemetry.setDisplayFormat(Telemetry.DisplayFormat.HTML) will the output be
Test or < b>Test</ b> (without the spaces of course, I couldn’t write the tags properly without the text getting formatted)?

Best practices suggest that you indeed need to set the Display Format that your OpMode expects within the OpMode, you cannot rely on previous OpModes to set the Display Format for you - this isn’t a persistent setting across OpModes or reboots.

-Danny

1 Like

I took a look around in JADX to be 100% sure.
It seems that the Telemetry display format is kept between user OpModes.

The display format does get set back to CLASSIC when the DriverStation app is started, and when system OpMode is ran or a common start(?).

I merely stated best practices. Best practices says that if you need a specific mode set, your OpMode should set it.