mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Add getters for pose in odometry classes (#1943)
This commit is contained in:
committed by
Peter Johnson
parent
2402c2bad7
commit
63cfa64fb3
@@ -64,6 +64,14 @@ public class DifferentialDriveOdometry {
|
||||
m_previousAngle = poseMeters.getRotation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the position of the robot on the field.
|
||||
* @return The pose of the robot (x and y are in meters).
|
||||
*/
|
||||
public Pose2d getPoseMeters() {
|
||||
return m_poseMeters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the robot's position on the field using forward kinematics and
|
||||
* integration of the pose over time. This method takes in the current time as
|
||||
|
||||
@@ -58,6 +58,14 @@ public class MecanumDriveOdometry {
|
||||
m_previousAngle = poseMeters.getRotation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the position of the robot on the field.
|
||||
* @return The pose of the robot (x and y are in meters).
|
||||
*/
|
||||
public Pose2d getPoseMeters() {
|
||||
return m_poseMeters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the robot's position on the field using forward kinematics and
|
||||
* integration of the pose over time. This method takes in the current time as
|
||||
|
||||
@@ -58,6 +58,14 @@ public class SwerveDriveOdometry {
|
||||
m_previousAngle = pose.getRotation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the position of the robot on the field.
|
||||
* @return The pose of the robot (x and y are in meters).
|
||||
*/
|
||||
public Pose2d getPoseMeters() {
|
||||
return m_poseMeters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the robot's position on the field using forward kinematics and
|
||||
* integration of the pose over time. This method takes in the current time as
|
||||
|
||||
Reference in New Issue
Block a user