Skip to content

Commit

Permalink
added notes on functional commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Advay17 committed Oct 7, 2024
1 parent 5965d0b commit a785d9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/commands/DriveCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class DriveCommands {
* @return Command that causes the XRP to execute the functions below
*/
public static Command driveDistance(double distance){
//A functional command is returned. A functional command is a basic command with parameters for initialization code, execution code, ending code, a boolean supplier to cause the command to end, and required subsystems.
//A functional command is returned. A functional command is a basic command with a constructor with parameters for initialization code, execution code, ending code, a boolean supplier to cause the command to end, and required subsystems.
return new FunctionalCommand(
/*
* The arrow -> causes the code to be what is called a "lambda". This means that the code is considered to be a method without needing to define it like normal.
Expand Down Expand Up @@ -66,6 +66,7 @@ public static Command driveDistance(double distance){
* Our team usually uses code that looks like the above command.
* Usage is basically the same, however add new in front of the function call.
* Example: new DriveCommands.AltDriveDistance(5)
* NOTE: Class Commands do not extend FunctionalCommand, however Function Commands do return FunctionalCommand.
*/
public static class AltDriveDistance extends Command{
/**
Expand Down

0 comments on commit a785d9b

Please sign in to comment.