Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathandao0 committed Jan 21, 2025
2 parents b10b375 + 7eb1303 commit 2baec54
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 38 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Codex
Team 4201's Generic Robot Software Library

## Development Notes
* Maven artifacts are saved under the [releases/](releases) directory after running `./gradlew publish`.
* To publish changes to the library, run `./gradlew publish` and push the updated files under `releases/` to GitHub.
* TODO: This can be automated with a GitHub action.
* The Codex repo is set to host the root directory of the main branch as a GitHub page, which allows the vendordep JSON file to pull the library.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e70ed0c1ca8cbdf03af461b944851dfe
944826a05947e9ec9d654327717c6008
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e42fcf0c1b6dba01261ac7e8c80d74139c84b266
ccc2e684a2c3a6964d4e6197aaca5b2e0cbbf65c
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9a1f4b70761a393279135613caa3d76d87db478a4d16a98b0fc0528c93bed329
686d5192c460bd831a794dd59f243a2c4b3ef64c93eef309a301362c2567cefd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
538d34798c281d79ce4aa1c09e3cdb745077c418ecdacacb1885d241a7f59f08b68e6a4cdd0b752a45599a0cc91b00702507dc8bc37b14d6927c5fd0f917a38f
f65d2f8b4b960fbbf66b36c41bd49cdb229fc5b8df6cd462304932337bfbe1804d148ef89136684f7c9e2a43e2563297167a04f5f62fba1478820da9a9a81bc3
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a45e392ad8ec251620a7af5469d9ce27
ddada1675097debe9fb58bc5020d53d4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7289cffa5498c2f49e76f6ef7714d2dfd829988a
360b6c55928d0a6578b7387aa66e2a760e5f27a6
Original file line number Diff line number Diff line change
@@ -1 +1 @@
525d16a0c600f74781114cec633836f28d20339d985abc7b97c60cd90073464a
99a8b5d014ab3821e544ce0d751e5d1704ab990743a6bc8d40b8966922f097af
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ef833dccd05fb0013f0c5e769c1d359483d8a1585331ba3d5dc320b0e9303787674e5d80440a71a5b05c2145bfd5ba0de5765d99a7a92fbbd744fb8cb8858a06
0cf93894e80bbfeef7fd7e98a76f37d36aa812f83a6b459a3778cda0d6a53d5a9897d0d1f1d8a259c7ee2c073b17f5f7d0df1d31b321957784e4e2247adb349a
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bf36f57aac0b162cc6738b3f7d6a9675
300dbce8e5ff70f377ea7d623ec4b49a
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8df1352e750e35937948a6c7c3bda87d6e752a5f
4ecc8e71ee3593fbbf72a68ec6f44e24d1dbda47
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3fa082490cc07a84593ddd41dd3513db1fcf2787c2e4c68bdecb0ef948ccc5b3
fe73e1dc026a1350ae50ff44449f780bd08f8dff645b6c37db8360f5596af9b1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f103d6f5c33733cb429f9489fd8a9a5af2936ccf51344f990ba261026dc814b4b076abaa34511c88d2ef4fd9b4678be0f49ed827267a5c6b09c3038a1097bc7d
c00af60d13c361006de9391767271e33b7602efa1d8c84753ae5175b05d036602bd2a3b7bbc38e5e8fce8c54faaa26c92e642ab7f9e6f6f475a6a4cf3c82316e
35 changes: 9 additions & 26 deletions src/main/java/org/team4201/codex/utils/TrajectoryUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ public TrajectoryUtils(SwerveSubsystem swerveDrive, RobotConfig robotConfig, PID
* Generate a PathPlanner Command to follow a named PathPlanner trajectory file.
*
* @param pathName The name of the PathPlanner Trajectory file to reference.
* @param maxSpeed The robot's max speed to obey (Overrides the setting in the PathPlanner trajectory file)
*
* @return Command
*/
public Command generatePPHolonomicCommand(String pathName, double maxSpeed) {
public Command generatePPHolonomicCommand(String pathName) {
try {
return generatePPHolonomicCommand(PathPlannerPath.fromPathFile(pathName), maxSpeed, false);
return generatePPHolonomicCommand(PathPlannerPath.fromPathFile(pathName), m_robotConfig, false);
} catch (Exception e) {
DriverStation.reportError("Could not load PathPlanner Path '" + pathName + "':" + e.getMessage(), e.getStackTrace());
return new WaitCommand(0);
Expand All @@ -66,14 +65,13 @@ public Command generatePPHolonomicCommand(String pathName, double maxSpeed) {
* Generate a PathPlanner Command to follow a named PathPlanner trajectory file.
*
* @param pathName The name of the PathPlanner Trajectory file to reference.
* @param maxSpeed The robot's max speed to obey (Overrides the setting in the PathPlanner trajectory file)
* @param manualFlip Option to manually flip the trajectory instead of using the robot's current {@link DriverStation.Alliance} color
*
* @return Command
*/
public Command generatePPHolonomicCommand(String pathName, double maxSpeed, boolean manualFlip) {
public Command generatePPHolonomicCommand(String pathName, boolean manualFlip) {
try {
return generatePPHolonomicCommand(PathPlannerPath.fromPathFile(pathName), maxSpeed, manualFlip);
return generatePPHolonomicCommand(PathPlannerPath.fromPathFile(pathName), m_robotConfig, manualFlip);
} catch (Exception e) {
DriverStation.reportError("Could not load PathPlanner Path '" + pathName + "':" + e.getMessage(), e.getStackTrace());
return new WaitCommand(0);
Expand All @@ -84,43 +82,28 @@ public Command generatePPHolonomicCommand(String pathName, double maxSpeed, bool
* Generate a PathPlanner Command to follow a named PathPlanner trajectory file.
*
* @param path The {@link PathPlannerPath} to follow.
* @param maxSpeed The robot's max speed to obey (Overrides the setting in the PathPlanner trajectory file)
* @param robotConfig The {@link RobotConfig} to use.
*
* @return Command
*/
public Command generatePPHolonomicCommand(PathPlannerPath path, double maxSpeed) {
public Command generatePPHolonomicCommand(PathPlannerPath path, RobotConfig robotConfig) {

return generatePPHolonomicCommand(path, maxSpeed, false);
return generatePPHolonomicCommand(path, robotConfig, false);
}

/**
* Generate a PathPlanner Command to follow a named PathPlanner trajectory file.
*
* @param path The {@link PathPlannerPath} to follow.
* @param maxSpeed The robot's max speed to obey (Overrides the setting in the PathPlanner trajectory file)
* @param robotConfig The {@link RobotConfig} to use
* @param flipPath Option to flip the trajectory around the field's center.
*
* @return Command
*/
public Command generatePPHolonomicCommand(
PathPlannerPath path,
double maxSpeed,
RobotConfig robotConfig,
boolean flipPath) {

RobotConfig robotConfig = m_robotConfig;
if (maxSpeed != 0) {
ModuleConfig moduleConfig =
new ModuleConfig(m_robotConfig.moduleConfig.wheelRadiusMeters,
maxSpeed,
m_robotConfig.moduleConfig.wheelCOF,
m_robotConfig.moduleConfig.driveMotor,
m_robotConfig.moduleConfig.driveCurrentLimit,
m_robotConfig.moduleConfig.
driveCurrentLimit,
1);
robotConfig = new RobotConfig(m_robotConfig.massKG, m_robotConfig.MOI, moduleConfig, m_robotConfig.moduleLocations);
}

return new FollowPathCommand(
path,
() -> m_swerveDrive.getState().Pose,
Expand Down

0 comments on commit 2baec54

Please sign in to comment.