Holonomic Vector Drive Task
Gamepad drive for all holonomic drivetrains which will use a vector-based approach to drive. This task is designed to be used as a default/standard-priority task, other tasks will override it.
Compared to HolonomicDriveTask, this task will constantly track the (x,y,r) pose of the robot, rather than setting the powers directly from the gamepad inputs. When the translational/rotational components for these poses are zero, this task will take a snapshot of the values they were at, using PID controllers to attempt to stay in place. This allows for more predictable and consistent driving, as the robot will only accept movement when told to do so, ensuring that all movements of the robot can only be achieved via the controller.
This system can be comparable to one of a drone, where releasing the sticks and allowing it to hover will hold position and resist external forces. This locking nature has been implemented on the vector (translation) and heading components. Note that user input overrides all, where the x or y inputs will both unlock both translational axes to avoid corrections that could be dangerous. This caveat means that this task will make no effort to try and correct translational deviation when the robot is being commanded.
A localizer-attached holonomic drive is required for this class, as it will require the use of the pose estimate system.
Author
Lucas Bubner, 2024
Since
4.0.0
Constructors
Properties
Inherited properties
Convenience field to get a reference to FtcDashboard's field overlay for drawing on the field. Available as soon as init() has been called for this task.
Timeout value for an infinite task that will run forever.
Whether the task is finished or not via timeout or custom condition. Will be true regardless of the finisher being fired or not, as some tasks will handle this via finishNow().
Functions
Inherited functions
Compose this task into a SequentialTaskGroup with the supplied tasks to run before this one.
Utility to create a new DynamicTask based on the supplied task builder. Useful for constructing tasks that use data that is not available at the build time of the wrapped task.
Compose this task into a DeadlineTaskGroup with the supplied tasks to run these extra tasks until this task is done.
Force a task to finish immediately, and fire the onFinish() method without waiting for the next polling loop. This method is useful when your task needs to die and needs to finish up immediately. If your finisher has already been fired, this method will do nothing but ensure that the task is marked as finished.
Composes a ParallelTaskGroup with a WaitTask to run before this task. This will ensure the task runs for at least the specified time, and no-ops until the duration if it finishes early.
Time in seconds since the task was started.
Get the subsystem reference that this task has elected a dependency on. Will return an Optional where if it is not present, this task is not dependent on any subsystem.
Convenience field to get a reference to FtcDashboard's field overlay for drawing on the field. Available as soon as init() has been called for this task.
Return whether this task has elected a dependency on a subsystem or not.
Query (but not update) the finished state of the task. This will return true if the task is finished and the finisher has been fired.
Return a boolean to this method to add custom criteria if a task should be considered finished.
Mute task reports from the Scheduler.
Set the subsystem you want to elect this task to run on, notifying the runner that this task should run there. This task is scheduled with default override behaviour.
Set the subsystem you want to elect this task to run on, notifying the runner that this task should run there.
Update and query the state of the task if it is finished. This will return true if the task is finished and the finisher has been fired.
Compose this task into a RaceTaskGroup with the supplied tasks to run all of these tasks until one finishes.
Wrap this task in a RepeatTask where finish conditions are reset immediately.
Convenience field to get a reference to FtcDashboard's field overlay for drawing on the field. Available as soon as init() has been called for this task.
Compose this task into a SequentialTaskGroup with the supplied tasks to follow after this one.
Get a verbose string representation of this task, including all of its properties.
Compose this task into a RaceTaskGroup with a WaitUntilTask based on this condition.
Compose this task into a ParallelTaskGroup with the supplied tasks to run all of these tasks at once.
Set the timeout of this task dynamically and return the task.