Class FeedForwardProcessor

    • Constructor Detail

      • FeedForwardProcessor

        public FeedForwardProcessor​(double velocityFeedFwd,
                                    double throtBump,
                                    double accelFeedFwd)
        Creates a FeedForwardProcessor with the provided \(k_v\) and \(v_{Intercept}\)
        Parameters:
        velocityFeedFwd - The velocity constant feed-forward \(k_v\), in output units per speed unit.
        throtBump - The velocity intercept \(V_{intercept}\), in output units.
        accelFeedFwd - The acceleration constant feed-forward \(k_a\), in output units per acceleration unit.
    • Method Detail

      • apply

        @NotNull
        public @NotNull TankDriveData apply​(@NotNull
                                            @NotNull TankDriveData command)
        Applies feed-forwards to the provided TankDriveData. The method for calculating the feed-forward is as follows:
        1. The feed-forward starts at 0.
        2. The product of the velocity (if present) and the velocity feed-forward is added.
        3. The product of the acceleration (if present) and the acceleration feed-forward is added.
        4. If the velocity is present and nonzero, the throttle bump (with the sign of the velocity) is added.
        The calculated feed-forward is then added to any feed-forward already present in the DriveData.
        Specified by:
        apply in interface Function<TankDriveData,​TankDriveData>
        Parameters:
        command - The data to use.
        Returns:
        A new TankDriveData as described above.