-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the Oxplorer wiki! Use the sidebar on the right to navigate through the pages. This page shows gives a basic guide for getting started.
Add the folowing to the repositories section of your build.gradle
:
maven {
url = uri("https://maven.pkg.github.com/FRCTeam3044/Oxplorer")
credentials {
username = "3044-Packages-Bot"
password = "\u0067\u0068\u0070\u005f\u0038\u0055\u0068\u0037\u0061\u004f\u0062\u0049\u004a\u0041\u005a\u0045\u0059\u0073\u0041\u0055\u0033\u0063\u0041\u0037\u004f\u0065\u0070\u0037\u0053\u0074\u0073\u0058\u0058\u0059\u0031\u004e\u006e\u0056\u0030\u004a"
}
}
Then add this line to the dependencies section:
implementation 'me.nabdev.pathfinding:oxplorer:0.12.7'
Here's a basic example of usage (see more options for the builder on it's javadoc page)
Pathfinder pathfinder = new PathfinderBuilder(Field.CRESCENDO_2024).build();
try {
TrajectoryConfig config = new TrajectoryConfig(3 /* Max vel */, 3 /* Max accel */);
Trajectory myPath = pathfinder.generateTrajectory(m_robotDrive.getPose(), new Pose2d(8, 4, new Rotation2d()), config);
} catch (ImpossiblePathException e) {
e.printStackTrace();
}
Before you can use this on your robot, you will need to configure some things. For more info on this, check out the Advanced Path Generation page.
These are the parameters you will almost definitely have to change, but you will likely have to tweak other values as well. Both the height and length are in meters. These values are used to calculate how far you need to stay away from obstacles, and using too high values could reuslt in some areas of the field becoming inaccessible.
Pathfinder pathfinder = new PathfinderBuilder(Field.CRESCENDO_2024)
.setRobotLength(0.7)
.setRobotWidth(0.7)
.build();