Skip to content

Conversation

@Awesomeplayer165
Copy link
Contributor

No description provided.

@Awesomeplayer165 Awesomeplayer165 linked an issue Feb 19, 2024 that may be closed by this pull request
@Awesomeplayer165 Awesomeplayer165 marked this pull request as ready for review February 26, 2024 08:58
Copy link
Contributor Author

@Awesomeplayer165 Awesomeplayer165 left a comment

Choose a reason for hiding this comment

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

needs revision.

options.add(new PathPlannerAuto(autoName));
} catch (Exception e) {
System.out.println("Error loading auto: " + autoName);
e.printStackTrace();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

never prints out the stack trace. remove?


# Assuming locations is a list of dictionaries where each dictionary represents a location
# L,M, and R were change to S1, S2, and S4 with an S3 being added.
locations = [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add image in comments of referencing letters?

@@ -0,0 +1,117 @@
import json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
# File for constructing trajectories between each node (note and a shooting location).
# Locations each have an `allowed_destinations`, which states where it can possibly go to. Right now, this is set to every destination except itself.

{"name": "C4", "x": 7.68, "y": 2.457, "angle": 0, "allowed_destinations": ["W1", "W2", "W3", "S1", "S2", "S3", "S4", "C1", "C2", "C3", "C5"]},
{"name": "C5", "x": 7.68, "y": 0.787, "angle": 0, "allowed_destinations": ["W1", "W2", "W3", "S1", "S2", "S3", "S4", "C1", "C2", "C3", "C4"]},
]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
# obstacles are preset around the corners of the stage for all nodes. this mitigates about 50% of the work that we have to do.

Comment on lines +74 to +75
#else:
# midPoint = next((mid for mid in midPoints if mid["name"] == end_name), None)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
#else:
# midPoint = next((mid for mid in midPoints if mid["name"] == end_name), None)
# previously used for connecting a node to a node to a node. usually used as note to shootingLocation to note.
#else:
# midPoint = next((mid for mid in midPoints if mid["name"] == end_name), None)

Comment on lines +46 to +50
this.pose = new Pose2d();
this.blacklisted = true;
this.priority = -1;
this.name = "Uninitialized";
this.isThere = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
this.pose = new Pose2d();
this.blacklisted = true;
this.priority = -1;
this.name = "Uninitialized";
this.isThere = false;
this("Uninitialized");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should actually keep this as it could be very helpful.

Comment on lines +23 to +24
this.pose = new Pose2d();
this.name = "Uninitialized";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
this.pose = new Pose2d();
this.name = "Uninitialized";
this(new Pose2d(), "Uninitialized");

Comment on lines +23 to +24
this.pose = new Pose2d();
this.name = "Uninitialized";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

concerned about the usage of Uninitialized a lot

if (DriverStation.getAlliance().isPresent()) {
if (DriverStation.getAlliance().get() == Alliance.Red) {
return new Pose2d(
16.5410515 - this.pose.getX(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

provide explanation for this number?


for (String autoName : autoNames) {
try {
options.add(new PathPlannerAuto(autoName));
Copy link
Contributor

Choose a reason for hiding this comment

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

should this also handle selecting dynamic autos?

"trackWidth": 0.5778496879611685,
"bumperLength": 0.8762995267982555,
"bumperWidth": 0.8762995267982555,
"wheelRadius": 0.050799972568014815
Copy link
Contributor

Choose a reason for hiding this comment

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

check these numbers


# Write the data to a JSON file
# C:\\Users\\Robotics\\Desktop\\Crescendo\\src\\main\\java\\frc\\robot\\utils\\dynamicauto\\data.chor
with open('C:\\Users\\stoopi_poopy\\Crescendo\\src\\main\\java\\frc\\robot\\utils\\dynamicauto\\data.chor', 'w') as f:
Copy link
Contributor

Choose a reason for hiding this comment

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

dont hardcode this

new Note(new Pose2d(7.538, 5.7, Rotation2d.fromRadians(Math.PI)), false, 0, "C2", true), // c2
new Note(new Pose2d(7.538, 4.1, Rotation2d.fromRadians(Math.PI)), false, 1, "C3", true), // c3
new Note(new Pose2d(7.538, 2.5, Rotation2d.fromRadians(Math.PI)), false, 2, "C4", true), // c4
new Note(new Pose2d(7.538, 0.7, Rotation2d.fromRadians(Math.PI)), false, 0, "C5", true) // c5
Copy link
Contributor

Choose a reason for hiding this comment

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

might want to figure out a way to share these between py and java

{"name": "Amp Side", "x": 0.71, "y": 6.72, "angle": 1.04, "allowed_destinations": ["W1", "W2", "W3", "C1", "C2", "C3", "C4", "C5"]},
{"name": "Center", "x": 1.35, "y": 5.56, "angle": 0, "allowed_destinations": ["W1", "W2", "W3", "C1", "C2", "C3", "C4", "C5"]},
{"name": "Stage Side", "x": 0.71, "y": 4.36, "angle": -1.04, "allowed_destinations": ["W1", "W2", "W3", "C1", "C2", "C3", "C4", "C5"]},
{"name": "W1", "x": 2.3, "y": 6.757, "angle": 0.39, "allowed_destinations": [ "W2", "W3", "S1", "S2", "S3", "S4", "C1", "C2", "C3", "C4", "C5"]},
Copy link
Contributor

Choose a reason for hiding this comment

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

consider making the wing notes aligned to the speaker so you can shoot directly from them

note.setPriority(priority.getAsInt());
}

public static Command DynamicToNote(Supplier<Pose2d> curPose) {
Copy link
Contributor

Choose a reason for hiding this comment

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

lowerCamelCase

Supplier<Pose2d> curPose, ShootingLocation[] shootingLocations) {

ShootingLocation closestLocation = new ShootingLocation("shooting shooting");
double shortestDistance = 9999999;
Copy link
Contributor

Choose a reason for hiding this comment

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

use Double.MAX_VALUE instead of 99999999


public static Note getAbsoluteClosestNote(Supplier<Pose2d> curPose) {
Note closestNote = new Note();
double shortestDistance = 99999999;
Copy link
Contributor

Choose a reason for hiding this comment

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

same as 79

"""
Things to Change for each path
1. Clear Trajectory array
2. Reverse headings for each waypoint
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry was my internal thoughts.. we can remove

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.

Auto: Dynamic Pickup

5 participants