Skip to content

Fix inverted coordinate system in PinpointLocalizer causing reversed autonomous movement#4

Closed
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-auto-alignment
Closed

Fix inverted coordinate system in PinpointLocalizer causing reversed autonomous movement#4
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-auto-alignment

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 17, 2026

The StartRedTop autonomous routine moved backward+right instead of forward+right. The PinpointLocalizer was reading coordinates from the Pinpoint driver without correcting for its inverted coordinate system (noted in code comment "//Field is inverted").

Changes

  • PinpointLocalizer.java: Negate X/Y position and velocity values from Pinpoint driver in update() method
  • Heading remains unchanged—rotational orientation is correctly aligned
// Before
txPinpointRobot = new Pose2d(
    driver.getPosX(DistanceUnit.INCH), 
    driver.getPosY(DistanceUnit.INCH), 
    driver.getHeading(UnnormalizedAngleUnit.RADIANS)
);

// After  
txPinpointRobot = new Pose2d(
    -driver.getPosX(DistanceUnit.INCH), 
    -driver.getPosY(DistanceUnit.INCH), 
    driver.getHeading(UnnormalizedAngleUnit.RADIANS)
);

Impact

Affects all autonomous routines using PinpointLocalizer. Test StartBlueTop, StartRedBottom, and StartBlueBottom for regressions.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx1024M -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.9-bin/90cnw93cvbtalezasaz0blq0a/gradle-8.9/lib/gradle-daemon-main-8.9.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.9-bin/90cnw93cvbtalezasaz0blq0a/gradle-8.9/lib/agents/gradle-instrumentation-agent-8.9.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.9 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

can you figure out why when i run the start red top autonomous routine the bot goes backwards then right rather than forward and right (relative to bot)? if so, please fix it. make a new fix/auto-alignment branch


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 17, 2026 21:48
…PinpointLocalizer

Co-authored-by: Camuise <46655509+Camuise@users.noreply.github.com>
Co-authored-by: Camuise <46655509+Camuise@users.noreply.github.com>
Co-authored-by: Camuise <46655509+Camuise@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix autonomous routine direction issues Fix inverted coordinate system in PinpointLocalizer causing reversed autonomous movement Jan 17, 2026
Copilot AI requested a review from Camuise January 17, 2026 21:55
@Camuise Camuise closed this Jan 28, 2026
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

Successfully merging this pull request may close these issues.

2 participants