-
Notifications
You must be signed in to change notification settings - Fork 19
/
main.py
35 lines (25 loc) · 692 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""MPC-CBF controller for a differential drive mobile robot.
Author: Elena Oikonomou
Date: Fall 2022
"""
import numpy as np
from mpc_cbf import MPC
from plotter import Plotter
import util
def main():
np.random.seed(99)
# Define controller & run simulation
controller = MPC()
controller.run_simulation() # Closed-loop control simulation
# Plots
plotter = Plotter(controller)
plotter.plot_results()
plotter.plot_predictions()
plotter.plot_path()
plotter.create_trajectories_animation()
plotter.create_path_animation()
plotter.plot_cbf()
# Store results
# util.save_mpc_results(controller)
if __name__ == '__main__':
main()