Skip to content

Node system -> master#357

Draft
Nitay4 wants to merge 12 commits into
masterfrom
node-system
Draft

Node system -> master#357
Nitay4 wants to merge 12 commits into
masterfrom
node-system

Conversation

@Nitay4

@Nitay4 Nitay4 commented Sep 27, 2025

Copy link
Copy Markdown

No description provided.

Comment thread src/main/java/frc/robot/statemachine/RobotState.java
Comment thread src/main/java/frc/robot/statemachine/RobotState.java
Comment thread src/main/java/frc/robot/statemachine/RobotCommander.java Outdated
Comment thread src/main/java/frc/robot/statemachine/RobotCommander.java Outdated
Comment thread src/main/java/frc/robot/statemachine/AStarFinder/AStarFinder.java Outdated
Comment thread src/main/java/frc/robot/statemachine/AStarFinder/AStarFinder.java Outdated
Comment thread src/main/java/frc/robot/statemachine/AStarFinder/AStarFinder.java Outdated
Comment thread src/main/java/frc/robot/statemachine/AStarFinder/AStarFinder.java Outdated

@hillelv hillelv left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ok I realized I can't do this CR without you explaining the code to me (which either means this is very bad code or this is a very complicated concept)

Comment on lines +8 to +9
private double gCost;
private double hCost;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

g? h?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

those are the names in the algorithm, technically the h represents heuristic but i'm pretty sure that the g doesn't represent anything, i think it's better to leave it like that


private RobotState[] neighbors;

static {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why is it assigned in a static block and not in a constructor?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

because java is funny, i cant assign a state as a neighbor before its constructed

Comment on lines +89 to +90
for (int i = 0; i < RobotState.values().length; i++) {
for (int j = 0; j < RobotState.values().length; j++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

could be foreach

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i prefer it like that, if its critical to you i will change but i dont see why

Comment thread src/main/java/frc/robot/statemachine/AStarFinder/AStarFinder.java Outdated
return hCost;
}

public double getFCost() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

f?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

same as the comment above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants