Skip to content

Commit

Permalink
input ekf instance as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ShisatoYano committed Nov 1, 2023
1 parent dd300bd commit 5982569
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
sys.path.append(abs_dir_path + relative_path + "control/pure_pursuit")
sys.path.append(abs_dir_path + relative_path + "sensors")
sys.path.append(abs_dir_path + relative_path + "sensors/gnss")
sys.path.append(abs_dir_path + relative_path + "localization/kalman_filter")


# import component modules
Expand All @@ -31,6 +32,7 @@
from pure_pursuit_controller import PurePursuitController
from sensors import Sensors
from gnss import Gnss
from extended_kalman_filter_localizer import ExtendedKalmanFilterLocalizer


# flag to show plot figure
Expand Down Expand Up @@ -61,9 +63,10 @@ def main():
pure_pursuit = PurePursuitController(spec, course, color='m')

# create vehicle instance
# set state, spec, controller instances as arguments
sensors = Sensors(gnss=Gnss())
vehicle = FourWheelsVehicle(state, spec, controller=pure_pursuit, sensors=sensors)
# set state, spec, controller, sensors and localizer instances as arguments
gnss = Sensors(gnss=Gnss())
ekf = ExtendedKalmanFilterLocalizer(state)
vehicle = FourWheelsVehicle(state, spec, controller=pure_pursuit, sensors=gnss, localizer=ekf)
vis.add_object(vehicle)

# plot figure is not shown when executed as unit test
Expand Down

0 comments on commit 5982569

Please sign in to comment.