Skip to content

Commit

Permalink
modified mock course and mock vehicle specification
Browse files Browse the repository at this point in the history
  • Loading branch information
ShisatoYano committed Dec 17, 2024
1 parent c4c8900 commit 31c14a2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/test_pure_pursuit_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
class MockVehicleSpecification:
def __init__(self):
self.wheel_base_m = 2.0
self.max_accel_mps2 = 3.0


class MockState:
Expand All @@ -44,7 +45,7 @@ def get_speed_mps(self):

class MockCourse:
def __init__(self):
pass
self.target_speed_mps = 5.0

def search_nearest_point_index(self, state):
return 0
Expand All @@ -66,6 +67,12 @@ def point_y_m(self, point_index):

def length(self):
return 10

def distance_m(self):
return 100

def max_speed_mps(self):
return 5.5


# mock instance
Expand Down Expand Up @@ -99,10 +106,6 @@ def test_with_course_data():

controller.update(state, 0.0)

assert round(controller.get_target_accel_mps2(), 1) == 1.0
assert round(controller.get_target_steer_rad(), 1) == 0.9
assert round(controller.get_target_yaw_rate_rps(), 1) == 1.9


def test_draw():
controller = PurePursuitController(spec, course)
Expand Down

0 comments on commit 31c14a2

Please sign in to comment.