mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Add X and Y component getters to Pose2d and Transform2d (#2563)
pose.Translation().X() and pose.Translation.Y() are common operations, so shortening them to pose.X() and pose.Y() would be convenient. Java uses the getX() convention so that is used instead of X() for Java.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -107,10 +107,8 @@ TEST_F(MecanumControllerCommandTest, ReachesReference) {
|
||||
m_timer.Stop();
|
||||
command.End(false);
|
||||
|
||||
EXPECT_NEAR_UNITS(endState.pose.Translation().X(),
|
||||
getRobotPose().Translation().X(), kxTolerance);
|
||||
EXPECT_NEAR_UNITS(endState.pose.Translation().Y(),
|
||||
getRobotPose().Translation().Y(), kyTolerance);
|
||||
EXPECT_NEAR_UNITS(endState.pose.X(), getRobotPose().X(), kxTolerance);
|
||||
EXPECT_NEAR_UNITS(endState.pose.Y(), getRobotPose().Y(), kyTolerance);
|
||||
EXPECT_NEAR_UNITS(endState.pose.Rotation().Radians(),
|
||||
getRobotPose().Rotation().Radians(), kAngularTolerance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user