Skip to content

Auto ranging#338

Open
Glowdisk wants to merge 17 commits intomainfrom
auto-ranging
Open

Auto ranging#338
Glowdisk wants to merge 17 commits intomainfrom
auto-ranging

Conversation

@Glowdisk
Copy link
Copy Markdown
Contributor

Why are we doing this?

Finding distance to the hub so we can set a RPM and hood.
Asana task URL:
https://app.asana.com/1/2086102074315/project/1212432746991352/task/1213811082673949

Whats changing?

Changing method of finding distance to use a interpolatingTreeMap.

Questions/notes for reviewers

How this was tested

  • tested on robot
  • tested in simulator
  • unit tests added

Video/screenshots (from simulator or live robot)


PR feedback legend

Symbol Meaning
⭐ ⭐ ⭐ must be addressed
⭐ ⭐ should be addressed
something to consider, a good idea

@Glowdisk Glowdisk requested review from a team and Rongrrz March 26, 2026 18:55
@stephenjust
Copy link
Copy Markdown
Contributor

⭐⭐ Can you add some unit tests to prove this works?

Copy link
Copy Markdown
Contributor

@Rongrrz Rongrrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are using interpolating tree map, you shouldn't have to do any rounding


for (boolean zeroHood : new boolean[]{false, true}) {
for (int i = 0; i < 10; i++) {
double randomWidth = rand.nextDouble() * 4.03; // 4.03 is the width of the alliance zone
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐ Can we store this value somewhere or have a function for calculation like what vision does? (And I'd think that they probably already have a function to get the width/height of the alliance zone)


assertNotNull(data);

if (data.servoRatio() > 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐ What's the reason of this check? Could you write a comment to explain why if servoRatio > 0 then it must be in the range [0.2, 1.0]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considered a lower bound for safety but now I think about it, I dont think i need it. The 1.0 is the maximum ratio, so it should never be over. Changing the bounds to 0.0 to 1.0

@Glowdisk Glowdisk requested a review from Rongrrz April 4, 2026 21:45
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.

3 participants