Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Field Image Not Continuously Displaying On Dashboard #155

Open
Aldhanekaa opened this issue Sep 16, 2024 · 4 comments
Open

Custom Field Image Not Continuously Displaying On Dashboard #155

Aldhanekaa opened this issue Sep 16, 2024 · 4 comments

Comments

@Aldhanekaa
Copy link

Hello all, as described on the Official FTC Dashboard documentation here and #81 , it's possible to override default field drawing with custom field image by implementing packet.fieldOverlay().drawImage()

I've implemented as described on the docs and tested it, it works, however it only shows once and further after that it won't show the custom field image but instead the default field image. I also notice that my custom field image is overlaying the robot circle on the field.

Is there any solution for this?

Screen.Recording.2024-09-16.at.16.31.25.mov

here is my following code :

TelemetryPacket packet = new TelemetryPacket(false);
        packet.fieldOverlay()
                .drawImage("/dash/FGC_FIELD.jpg", 0, 0, 144, 144);

        SampleTankDrive drive = new SampleTankDrive(hardwareMap, telemetry);
        drive.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
        FtcDashboard dashboard = FtcDashboard.getInstance();

        waitForStart();

        packet.fieldOverlay()
                .drawImage("/dash/FGC_FIELD.jpg", 0, 0, 144, 144);
        while (!isStopRequested()) {
            dashboard.sendTelemetryPacket(packet);
@rbrott
Copy link
Member

rbrott commented Sep 17, 2024

Is that all of your code? I suspect something is sending telemetry to dash without overriding the image.

@Aldhanekaa
Copy link
Author

Is that all of your code? I suspect something is sending telemetry to dash without overriding the image.

well inside the while loop there is more code, as shown below;

while (!isStopRequested()) {
            dashboard.sendTelemetryPacket(packet);

            drive.setWeightedDrivePower(
                    new Pose2d(
                            -gamepad1.left_stick_x,
                            -gamepad1.left_stick_y,
                            -gamepad1.right_stick_y
                    )
            );

            drive.update();

            Pose2d poseEstimate = drive.getPoseEstimate();
            telemetry.addData("x", poseEstimate.getX());
            telemetry.addData("y", poseEstimate.getY());
            telemetry.addData("heading", poseEstimate.getHeading());
            telemetry.update();
        }

does this chunk of code matter?

Pose2d poseEstimate = drive.getPoseEstimate();
            telemetry.addData("x", poseEstimate.getX());
            telemetry.addData("y", poseEstimate.getY());
            telemetry.addData("heading", poseEstimate.getHeading());
            telemetry.update();

@rbrott
Copy link
Member

rbrott commented Sep 17, 2024

Yes unfortunately that other code does matter. Internally that's sending another packet with the default field.

@rbrott
Copy link
Member

rbrott commented Sep 17, 2024

Actually can you try putting

TelemetryPacket packet = new TelemetryPacket(false);
        packet.fieldOverlay()
                .drawImage("/dash/FGC_FIELD.jpg", 0, 0, 144, 144);

inside the loop? Each packet should only be sent once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants