-
public class CommandFactoryCommands Factory. Use this class to instantiate new commands.
Hint: Extend this class on your project and add your own commands to your new class.
-
-
Constructor Summary
Constructors Constructor Description CommandFactory(ISubsystemHub subsystemHub, ILogger logger)Constructs a new instance of the Commands factory.
-
Method Summary
Modifier and Type Method Description Commanddynamic(String name, Consumer<DynamicCommandBuilder> builderConsumer)Starts building a "dynamic" command group. CommandanyOf(String name, Array<Command> commandList)Creates a new command group for commands that need to execute exclusively. Commandparallel(String name, Array<Command> commandList)Creates a new command group for commands that must run in parallel. Commandsequential(String name, Array<Command> commandList)Creates a new command group for commands that must run in sequence. Commandwait(String name, Duration duration)Creates a new wait command. CommandfollowTrajectory(String name, ITimedTrajectory timedTrajectory, FollowTrajectoryCommandParams trajectoryGoals)Creates a new follow trajectory command. -
-
Constructor Detail
-
CommandFactory
CommandFactory(ISubsystemHub subsystemHub, ILogger logger)
Constructs a new instance of the Commands factory.- Parameters:
logger- telemetry logger.
-
-
Method Detail
-
dynamic
Command dynamic(String name, Consumer<DynamicCommandBuilder> builderConsumer)
Starts building a "dynamic" command group.
-
anyOf
Command anyOf(String name, Array<Command> commandList)
Creates a new command group for commands that need to execute exclusively.
- Parameters:
name- command group name.commandList- list of commands in the group.
-
parallel
Command parallel(String name, Array<Command> commandList)
Creates a new command group for commands that must run in parallel.
- Parameters:
name- command group name.commandList- list of commands in the group.
-
sequential
Command sequential(String name, Array<Command> commandList)
Creates a new command group for commands that must run in sequence.
- Parameters:
name- command group name.commandList- list of commands in the group.
-
wait
Command wait(String name, Duration duration)
Creates a new wait command.
- Parameters:
name- command name.duration- wait duration.
-
followTrajectory
Command followTrajectory(String name, ITimedTrajectory timedTrajectory, FollowTrajectoryCommandParams trajectoryGoals)
Creates a new follow trajectory command.
- Parameters:
name- command name.timedTrajectory- timed trajectory.trajectoryGoals- end position goals.
-
-
-
-