Class TrapezoidPath

  • All Implemented Interfaces:
    edu.wpi.first.wpilibj.Sendable, edu.wpi.first.wpilibj2.command.Command

    public class TrapezoidPath
    extends edu.wpi.first.wpilibj2.command.SequentialCommandGroup
    A simple point-to-waypoint-to-waypoint-to-point movement command. This works by motion-profiling "desired" motor velocity control frames, then sampling them, and comparing against the real motor data. The TrapezoidPath will automatically get from the start pose to the end pose, while finding the "best" way to pass through the two midpoints
    • Field Summary

      • Fields inherited from class edu.wpi.first.wpilibj2.command.CommandBase

        m_requirements
    • Constructor Summary

      Constructors 
      Constructor Description
      TrapezoidPath​(edu.wpi.first.wpilibj.geometry.Pose2d start, edu.wpi.first.wpilibj.geometry.Translation2d mid1, edu.wpi.first.wpilibj.geometry.Translation2d mid2, edu.wpi.first.wpilibj.geometry.Pose2d end)
      Generate a TrapezoidPath from a start pose, through two midpoint translations, to an end pose
      TrapezoidPath​(edu.wpi.first.wpilibj.geometry.Pose2d start, edu.wpi.first.wpilibj.geometry.Translation2d mid1, edu.wpi.first.wpilibj.geometry.Translation2d mid2, edu.wpi.first.wpilibj.geometry.Pose2d end, SpeedConstraint constraints)
      Generate a TrapezoidPath from a start pose, through two midpoint translations, to an end pose
    • Method Summary

      • Methods inherited from class edu.wpi.first.wpilibj2.command.SequentialCommandGroup

        addCommands, end, execute, initialize, isFinished, runsWhenDisabled
      • Methods inherited from class edu.wpi.first.wpilibj2.command.CommandGroupBase

        clearGroupedCommand, clearGroupedCommands, deadline, parallel, race, requireUngrouped, requireUngrouped, sequence
      • Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase

        addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface edu.wpi.first.wpilibj2.command.Command

        alongWith, andThen, andThen, asProxy, beforeStarting, cancel, deadlineWith, getName, getRequirements, hasRequirement, isScheduled, perpetually, raceWith, schedule, schedule, withInterrupt, withTimeout
      • Methods inherited from interface edu.wpi.first.wpilibj.Sendable

        addChild, setName, setName, setName
    • Constructor Detail

      • TrapezoidPath

        public TrapezoidPath​(edu.wpi.first.wpilibj.geometry.Pose2d start,
                             edu.wpi.first.wpilibj.geometry.Translation2d mid1,
                             edu.wpi.first.wpilibj.geometry.Translation2d mid2,
                             edu.wpi.first.wpilibj.geometry.Pose2d end)
        Generate a TrapezoidPath from a start pose, through two midpoint translations, to an end pose
        Parameters:
        start - Starting pose (field-relative)
        mid1 - First midpoint translation (start-relative)
        mid2 - Second midpoint translation (mid1-relative)
        end - Desired end pose (field-relative)
      • TrapezoidPath

        public TrapezoidPath​(edu.wpi.first.wpilibj.geometry.Pose2d start,
                             edu.wpi.first.wpilibj.geometry.Translation2d mid1,
                             edu.wpi.first.wpilibj.geometry.Translation2d mid2,
                             edu.wpi.first.wpilibj.geometry.Pose2d end,
                             SpeedConstraint constraints)
        Generate a TrapezoidPath from a start pose, through two midpoint translations, to an end pose
        Parameters:
        start - Starting pose (field-relative)
        mid1 - First midpoint translation (start-relative)
        mid2 - Second midpoint translation (mid1-relative)
        end - Desired end pose (field-relative)
        constraints - Constraints on path speed