mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpimath] Remove unit suffixes from variable names (#7529)
* Move units into API docs instead because suffixes make user code verbose and hard to read * Rename trackWidth to trackwidth * Make ultrasonic classes use meters instead of a mix of m, cm, mm, ft, and inches
This commit is contained in:
@@ -13,11 +13,11 @@ TEST(SharpIRTest, SimDevices) {
|
||||
SharpIR s = SharpIR::GP2Y0A02YK0F(1);
|
||||
SharpIRSim sim(s);
|
||||
|
||||
EXPECT_EQ(20, s.GetRange().value());
|
||||
EXPECT_EQ(0.2, s.GetRange().value());
|
||||
|
||||
sim.SetRange(units::centimeter_t{30});
|
||||
EXPECT_EQ(30, s.GetRange().value());
|
||||
sim.SetRange(30_cm);
|
||||
EXPECT_EQ(0.3, s.GetRange().value());
|
||||
|
||||
sim.SetRange(units::centimeter_t{300});
|
||||
EXPECT_EQ(150, s.GetRange().value());
|
||||
sim.SetRange(300_cm);
|
||||
EXPECT_EQ(1.5, s.GetRange().value());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user