Add getters for pose in odometry classes (#1943)

This commit is contained in:
Prateek Machiraju
2019-10-18 10:58:22 -04:00
committed by Peter Johnson
parent 2402c2bad7
commit 63cfa64fb3
6 changed files with 42 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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