Skip to content

Commit

Permalink
Added feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
  • Loading branch information
ahcorde committed Feb 13, 2024
1 parent baa2611 commit e0aaab1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/python_pybind11/test/MecanumDriveOdometry_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_constructor(self):
# Setup the wheel parameters, and initialize
odom.set_wheel_params(wheelSeparation, wheelRadius, wheelRadius,wheelRadius)
startTime = datetime.timedelta(time.monotonic())
odom.init(datetime.timedelta())
odom.init(startTime)

# Sleep for a little while, then update the odometry with the new wheel
# position.
Expand All @@ -50,7 +50,7 @@ def test_constructor(self):
Angle(math.radians(1.0)),
Angle(math.radians(1.0)),
Angle(math.radians(1.0)),
time1 - startTime)
time1)
self.assertAlmostEqual(0.0, odom.heading().radian())
self.assertAlmostEqual(distPerDegree, odom.x())
self.assertAlmostEqual(0.0, odom.y())
Expand All @@ -66,7 +66,7 @@ def test_constructor(self):
Angle(math.radians(2.0)),
Angle(math.radians(2.0)),
Angle(math.radians(2.0)),
time2 - startTime)
time2)
self.assertAlmostEqual(0.0, odom.heading().radian())
self.assertAlmostEqual(distPerDegree * 2.0, odom.x(), delta=3e-6)
self.assertAlmostEqual(0.0, odom.y())
Expand All @@ -78,7 +78,7 @@ def test_constructor(self):

# Initialize again, and odom values should be reset.
startTime = datetime.timedelta(time.monotonic())
odom.init(datetime.timedelta())
odom.init(startTime)
self.assertAlmostEqual(0.0, odom.heading().radian())
self.assertAlmostEqual(0.0, odom.x())
self.assertAlmostEqual(0.0, odom.y())
Expand All @@ -91,7 +91,7 @@ def test_constructor(self):
Angle(math.radians(2.0)),
Angle(math.radians(2.0)),
Angle(math.radians(2.0)),
time1 - startTime)
time1)
self.assertAlmostEqual(0.0, odom.heading().radian())
self.assertAlmostEqual(distPerDegree * 2.0, odom.x(), delta=3e-6)
self.assertAlmostEqual(0.0, odom.y())
Expand All @@ -102,13 +102,13 @@ def test_constructor(self):
self.assertAlmostEqual(0.0, odom.angular_velocity().radian(), delta=1e-3)

# Sleep again, this time move 2 degrees in 100ms.
odom.init(datetime.timedelta())
odom.init(startTime)
time1 = startTime + datetime.timedelta(milliseconds=100)
odom.update(Angle(math.radians(-2.0)),
Angle(math.radians(2.0)),
Angle(math.radians(2.0)),
Angle(math.radians(-2.0)),
time1 - startTime)
time1)
self.assertAlmostEqual(0.0, odom.heading().radian())
self.assertAlmostEqual(distPerDegree * 2.0, odom.y(), delta=3e-6)
# self.assertAlmostEqual(0.0, odom.y())
Expand Down

0 comments on commit e0aaab1

Please sign in to comment.