Skip to content

Commit

Permalink
test: make tracking error assessment configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
rokusottervanger committed Feb 3, 2022
1 parent a6f4c13 commit fd64003
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/test_path_tracking_pid.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def test_exepath_action(self):
initialpose_pub.publish(pose)
rospy.sleep(0.1) # Fill tf buffers

self.max_tracking_error_linear_x = rospy.get_param("~max_tracking_error_linear_x", 0.1)
self.max_tracking_error_linear_y = rospy.get_param("~max_tracking_error_linear_y", 0.1)
self.max_tracking_error_angular_z = rospy.get_param("~max_tracking_error_angular_z", 0.1)

# Publisher for obstacles:
self.obstacle_pub = rospy.Publisher("pointcloud", PointCloud, latch=True, queue_size=1)
reconfigure = ReconfigureClient("/move_base_flex/PathTrackingPID", timeout=5)
Expand Down Expand Up @@ -109,9 +113,9 @@ def test_exepath_action(self):
return

# Check the errors
self.assertLess(error_catcher.error.linear.x, 0.1)
self.assertLess(error_catcher.error.linear.y, 0.1)
self.assertLess(error_catcher.error.angular.z, 0.1)
self.assertLess(error_catcher.error.linear.x, self.max_tracking_error_linear_x)
self.assertLess(error_catcher.error.linear.y, self.max_tracking_error_linear_y)
self.assertLess(error_catcher.error.angular.z, self.max_tracking_error_angular_z)

# Do the same for backward movements if last path was a success
if client.get_state() != GS.SUCCEEDED or rospy.get_param("backward", True):
Expand Down

0 comments on commit fd64003

Please sign in to comment.