Class XbotSwervePoint
java.lang.Object
xbot.common.trajectory.XbotSwervePoint
- All Implemented Interfaces:
ProvidesInterpolationData
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXbotSwervePoint(double x, double y, double degrees, double secondsToPoint) XbotSwervePoint(org.wpilib.math.geometry.Pose2d keyPose, double secondsToPoint) XbotSwervePoint(org.wpilib.math.geometry.Translation2d translation, org.wpilib.math.geometry.Rotation2d rotation, double secondsToPoint) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.wpilib.math.geometry.Pose2d[]generatePathVisualization(List<XbotSwervePoint> swervePoints) Converts swerve points to the pose array expected by AdvantageKit's trajectory visualization.org.wpilib.math.geometry.Rotation2ddoubleorg.wpilib.math.geometry.Translation2dvoidsetKinematics(SwervePointKinematics kinematics) voidsetPose(org.wpilib.math.geometry.Pose2d pose)
-
Field Details
-
keyPose
public org.wpilib.math.geometry.Pose2d keyPose -
secondsToPoint
public double secondsToPoint
-
-
Constructor Details
-
XbotSwervePoint
public XbotSwervePoint(org.wpilib.math.geometry.Pose2d keyPose, double secondsToPoint) -
XbotSwervePoint
public XbotSwervePoint(org.wpilib.math.geometry.Translation2d translation, org.wpilib.math.geometry.Rotation2d rotation, double secondsToPoint) -
XbotSwervePoint
public XbotSwervePoint(double x, double y, double degrees, double secondsToPoint)
-
-
Method Details
-
setKinematics
-
getKinematics
- Specified by:
getKinematicsin interfaceProvidesInterpolationData
-
setPose
public void setPose(org.wpilib.math.geometry.Pose2d pose) -
generatePathVisualization
public static org.wpilib.math.geometry.Pose2d[] generatePathVisualization(List<XbotSwervePoint> swervePoints) Converts swerve points to the pose array expected by AdvantageKit's trajectory visualization. Timing remains on the source points for use by the simple trajectory interpolators.- Parameters:
swervePoints- points to visualize- Returns:
- poses in path order
-
getTranslation2d
public org.wpilib.math.geometry.Translation2d getTranslation2d()- Specified by:
getTranslation2din interfaceProvidesInterpolationData
-
getSecondsForSegment
public double getSecondsForSegment()- Specified by:
getSecondsForSegmentin interfaceProvidesInterpolationData
-
getRotation2d
public org.wpilib.math.geometry.Rotation2d getRotation2d()- Specified by:
getRotation2din interfaceProvidesInterpolationData
-