Skip to content

Commit

Permalink
add localizer if condition to update state
Browse files Browse the repository at this point in the history
  • Loading branch information
ShisatoYano committed Oct 28, 2023
1 parent 751685d commit 0e0e817
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/vehicle/four_wheels_vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ class FourWheelsVehicle:
"""

def __init__(self, state, spec, controller=None, sensors=None,
detector=None):
detector=None, localizer=None):
"""
Constructor
state: Vehicle's state object
spec: Vehicle's specification object
controller: Controller object
sensors: Sencors object
detector: Detector object
localizer: Localizer object
"""

self.state = state

self.spec = spec

self.body = Body(spec)
self.chassis = Chassis(spec)
self.front_left_tire = FrontLeftTire(spec)
Expand All @@ -44,11 +44,10 @@ def __init__(self, state, spec, controller=None, sensors=None,
self.rear_axle = RearAxle(spec)

self.controller = controller

self.sensors = sensors
self._install_sensors(self.state)

self.detector = detector
self.localizer = localizer

def _install_sensors(self, state):
"""
Expand Down Expand Up @@ -138,7 +137,10 @@ def update(self, time_s):

target_accel, target_yaw_rate = self._update_control_data()

self.state.update(target_accel, target_yaw_rate, time_s)
if self.localizer:
pass
else:
self.state.update(target_accel, target_yaw_rate, time_s)

def draw(self, axes, elems):
"""
Expand Down

0 comments on commit 0e0e817

Please sign in to comment.