Class PoseUtils

java.lang.Object
com.flarerobotics.lib.PoseUtils

public class PoseUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static edu.wpi.first.math.geometry.Pose2d
    offsetPerpendicular(edu.wpi.first.math.geometry.Pose2d originalPose, double distance)
    Offsets a Pose2d along the direction of the original pose.
    static edu.wpi.first.math.geometry.Pose3d
    offsetPerpendicular(edu.wpi.first.math.geometry.Pose3d originalPose, double distance)
    Offsets a Pose3d along the direction of the original pose.
    static edu.wpi.first.math.geometry.Pose2d
    offsetSideways(edu.wpi.first.math.geometry.Pose2d pose, double offsetMeters)
    Offsets a Pose2d sideways by the given amount in meters.
    static edu.wpi.first.math.geometry.Pose3d
    offsetSideways(edu.wpi.first.math.geometry.Pose3d pose, double offsetMeters)
    Offsets a Pose3d sideways by the given amount in meters.
    static edu.wpi.first.math.geometry.Pose3d
    rotateAround(edu.wpi.first.math.geometry.Pose3d currentPose, edu.wpi.first.math.geometry.Translation3d point, edu.wpi.first.math.geometry.Rotation3d rot)
    Rotates the current pose around a point in 3D space.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • rotateAround

      public static edu.wpi.first.math.geometry.Pose3d rotateAround(edu.wpi.first.math.geometry.Pose3d currentPose, edu.wpi.first.math.geometry.Translation3d point, edu.wpi.first.math.geometry.Rotation3d rot)
      Rotates the current pose around a point in 3D space.
      Parameters:
      point - The point in 3D space to rotate around.
      rot - The rotation to rotate the pose by.
      Returns:
      The new rotated pose.
    • offsetSideways

      public static edu.wpi.first.math.geometry.Pose2d offsetSideways(edu.wpi.first.math.geometry.Pose2d pose, double offsetMeters)
      Offsets a Pose2d sideways by the given amount in meters.
      Parameters:
      pose - The original poe.
      offsetMeters - The amount to offset sideways (positive is to the right, negative is to the left).
      Returns:
      The new Pose2d after the offset.
    • offsetSideways

      public static edu.wpi.first.math.geometry.Pose3d offsetSideways(edu.wpi.first.math.geometry.Pose3d pose, double offsetMeters)
      Offsets a Pose3d sideways by the given amount in meters.
      Parameters:
      pose - The original pose.
      offsetMeters - The amount to offset sideways (positive is to the right, negative is to the left).
      Returns:
      The new Pose3d after the offset.
    • offsetPerpendicular

      public static edu.wpi.first.math.geometry.Pose2d offsetPerpendicular(edu.wpi.first.math.geometry.Pose2d originalPose, double distance)
      Offsets a Pose2d along the direction of the original pose.
      Parameters:
      originalPose - The orginal pose.
      distance - The distance to offset in meters.
      Returns:
      The offset position.
    • offsetPerpendicular

      public static edu.wpi.first.math.geometry.Pose3d offsetPerpendicular(edu.wpi.first.math.geometry.Pose3d originalPose, double distance)
      Offsets a Pose3d along the direction of the original pose.
      Parameters:
      originalPose - The original pose.
      distance - The distance to offset in meters.
      Returns:
      The offset pose.