Skip to content

Commit

Permalink
update java example with an EventTrigger
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansen4857 committed Oct 6, 2024
1 parent 168b0c6 commit 0dfa9b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/java/src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.auto.NamedCommands;
import com.pathplanner.lib.commands.PathPlannerAuto;
import com.pathplanner.lib.events.EventTrigger;
import com.pathplanner.lib.path.GoalEndState;
import com.pathplanner.lib.path.PathConstraints;
import com.pathplanner.lib.path.PathPlannerPath;
Expand Down Expand Up @@ -45,6 +46,9 @@ public RobotContainer() {
NamedCommands.registerCommand("marker2", Commands.print("Passed marker 2"));
NamedCommands.registerCommand("print hello", Commands.print("hello"));

// Use event markers as triggers
new EventTrigger("Example Marker").onTrue(Commands.print("Passed an event marker"));

// Configure the trigger bindings
configureBindings();

Expand Down

0 comments on commit 0dfa9b5

Please sign in to comment.