Skip to content

Commit

Permalink
changed angular velo and acc to degrees
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarhead20 committed Sep 10, 2023
1 parent 7ed8f0b commit 908b189
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main/java/jarhead/DrawPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public void paintComponent (Graphics g){

private TrajectorySequence generateTrajectory(NodeManager manager, Node exclude){
Node node = exclude.shrink(main.scale);
TrajectorySequenceBuilder builder = new TrajectorySequenceBuilder(new Pose2d(node.x, node.y, Math.toRadians(-node.robotHeading - 90)), Math.toRadians(-node.splineHeading - 90), new MecanumVelocityConstraint(robot.maxVelo, robot.trackWidth), new ProfileAccelerationConstraint(robot.maxAccel), robot.maxAngVelo, robot.maxAngAccel);
TrajectorySequenceBuilder builder = new TrajectorySequenceBuilder(new Pose2d(node.x, node.y, Math.toRadians(-node.robotHeading - 90)), Math.toRadians(-node.splineHeading - 90), new MecanumVelocityConstraint(robot.maxVelo, robot.trackWidth), new ProfileAccelerationConstraint(robot.maxAccel), Math.toRadians(robot.maxAngVelo), Math.toRadians(robot.maxAngAccel));
builder.setReversed(exclude.reversed);
for (int i = 0; i < manager.size(); i++) {
if(exclude.equals(manager.get(i))) continue; //stops empty path segment error
Expand Down
19 changes: 9 additions & 10 deletions src/main/java/jarhead/ProgramProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ private void generateFile(File file) {
file.createNewFile();
FileWriter writer = new FileWriter(file, false);
writer.write(
"""
ROBOT_WIDTH=18
ROBOT_LENGTH=18
RESOLUTION=0.1
IMPORT/EXPORT=
TRACK_WIDTH=15
MAX_VELO=60
MAX_ACCEL=60
MAX_ANGULAR_VELO=60
MAX_ANGULAR_ACCEL=60"""
"ROBOT_WIDTH=18\n" +
"ROBOT_LENGTH=18\n" +
"RESOLUTION=0.1\n" +
"IMPORT/EXPORT=\n" +
"TRACK_WIDTH=15\n" +
"MAX_VELO=60\n" +
"MAX_ACCEL=60\n" +
"MAX_ANGULAR_VELO=60\n" +
"MAX_ANGULAR_ACCEL=60"
);
writer.close();
readFile(file);
Expand Down

0 comments on commit 908b189

Please sign in to comment.