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

@@ -47,6 +47,12 @@ class DifferentialDriveOdometry {
m_previousAngle = pose.Rotation();
}
/**
* Returns the position of the robot on the field.
* @return The pose of the robot.
*/
const Pose2d& GetPose() const { return m_pose; }
/**
* 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

@@ -45,6 +45,12 @@ class MecanumDriveOdometry {
m_previousAngle = pose.Rotation();
}
/**
* Returns the position of the robot on the field.
* @return The pose of the robot.
*/
const Pose2d& GetPose() const { return m_pose; }
/**
* 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

@@ -50,6 +50,12 @@ class SwerveDriveOdometry {
m_previousAngle = pose.Rotation();
}
/**
* Returns the position of the robot on the field.
* @return The pose of the robot.
*/
const Pose2d& GetPose() const { return m_pose; }
/**
* 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