Package frc.robot.autonomous.actions
Class TrapezoidPath
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.CommandBase
-
- edu.wpi.first.wpilibj2.command.CommandGroupBase
-
- edu.wpi.first.wpilibj2.command.SequentialCommandGroup
-
- frc.robot.autonomous.actions.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
-
-
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 poseTrapezoidPath(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
-
-
-
-
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
-
-