def main(): # Vehicule dynamical system sys = vehicle.KinematicBicyleModel() # Set default wheel steering angle and velocity sys.ubar = np.array([0.01, 15]) # Plot open-loop behavior sys.plot_trajectory(np.array([0, 0, 0]), 10) # Animate the simulation sys.animate_simulation()
''' ############################################################################### ################## Main ###################### ############################################################################### ''' if __name__ == "__main__": """ MAIN TEST """ from pyro.dynamic import pendulum from pyro.dynamic import vehicle sys = pendulum.DoublePendulum() sys.x0 = np.array([0.1, 0.1, 0, 0]) is_3d = False sys.plot_trajectory() a = Animator(sys) a.animate_simulation(sys.traj, 1, is_3d) sys = vehicle.KinematicBicyleModel() sys.ubar = np.array([1, 0.01]) sys.x0 = np.array([0, 0, 0]) b = Animator(sys) sys.compute_trajectory(100) sys.plot_trajectory() b.animate_simulation(sys.traj, 10, is_3d)