-
Notifications
You must be signed in to change notification settings - Fork 2
Dynamic auto visionless #47
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
base: main
Are you sure you want to change the base?
Conversation
convert local 4 autos race to deadlines
local 4 doesn't work due to an issue with commands
…priority, and blacklist
Awesomeplayer165
left a comment
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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 = [ |
There was a problem hiding this comment.
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 | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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"]}, | ||
| ] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # obstacles are preset around the corners of the stage for all nodes. this mitigates about 50% of the work that we have to do. | |
| #else: | ||
| # midPoint = next((mid for mid in midPoints if mid["name"] == end_name), None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #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) |
| this.pose = new Pose2d(); | ||
| this.blacklisted = true; | ||
| this.priority = -1; | ||
| this.name = "Uninitialized"; | ||
| this.isThere = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| this.pose = new Pose2d(); | |
| this.blacklisted = true; | |
| this.priority = -1; | |
| this.name = "Uninitialized"; | |
| this.isThere = false; | |
| this("Uninitialized"); |
There was a problem hiding this comment.
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.
| this.pose = new Pose2d(); | ||
| this.name = "Uninitialized"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| this.pose = new Pose2d(); | |
| this.name = "Uninitialized"; | |
| this(new Pose2d(), "Uninitialized"); |
| this.pose = new Pose2d(); | ||
| this.name = "Uninitialized"; |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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"]}, |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
No description provided.