Package: wa-simulator
WA Vehicle SimulatorThe WA Simulator is a powerful, multi-platform, lightweight anduser-friendlysimulation platform for testing algorithms intended for autonomous robot or vehicle applications.
This project is under active development byWisconsin Autonomous, a student organization at the University of Wisconsin - Madison.UsageThe WA Simulator is a lightweight tool meant to facilitate algorithm development. As a result, the majority of the actual vehicle dynamics is hidden behind the wa_simulator API. All you need to do is import the module and instantiate the classes.Default Usage# Import the wa_simulatorimportwa_simulatoraswadefmain():# Create the systemsys=wa.WASystem(step_size=1e-3)# Create an environment using a premade environment descriptionenv_filename=wa.WASimpleEnvironment.EGP_ENV_MODEL_FILEenv=wa.WASimpleEnvironment(sys,env_filename)# Create an vehicle using a premade vehicle descriptionveh_inputs=wa.WAVehicleInputs()veh_filename=wa.WALinearKinematicBicycle.GO_KART_MODEL_FILEveh=wa.WALinearKinematicBicycle(sys,veh_inputs,veh_filename)# Visualize the simulation using matplotlibvis=wa.WAMatplotlibVisualization(sys,veh,veh_inputs,environment=env)# Control the vehicle using the arrow keysctr=wa.WAMatplotlibController(sys,veh_inputs,vis)# Instantiate the simulation managersim_manager=wa.WASimulationManager(sys,env,veh,vis,ctr)# Simulation loopstep_size=sys.step_sizewhilesim_manager.is_ok():time=sys.timesim_manager.synchronize(time)sim_manager.advance(step_size)if__name__=="__main__":main()With ChronoUsing Chrono is as simple as changing a few file names and importing the chrono version of the simulator. Even thoughwa_simulator.chronois the new import, all defaultwa_simulatorclasses are still accessible as seen above.Background about Chrono can be found here.# Import the wa_simulatorimportwa_simulator.chronoaswadefmain():# Create the systemsys=wa.WAChronoSystem(step_size=1e-3)# Create an environment using a premade environment descriptionenv_filename=wa.WAChronoEnvironment.EGP_ENV_MODEL_FILEenv=wa.WAChronoEnvironment(sys,env_filename)# Create an vehicle using a premade vehicle descriptionveh_inputs=wa.WAVehicleInputs()veh_filename=wa.WAChronoVehicle.GO_KART_MODEL_FILEveh=wa.WAChronoVehicle(sys,veh_inputs,env,veh_filename)# Visualize the simulation using matplotlibvis=wa.WAMatplotlibVisualization(sys,veh,veh_inputs,environment=env)# Control the vehicle using the arrow keysctr=wa.WAMatplotlibController(sys,veh_inputs,vis)# Instantiate the simulation managersim_manager=wa.WASimulationManager(sys,env,veh,vis,ctr)# Simulation loopstep_size=sys.step_sizewhilesim_manager.is_ok():time=sys.timesim_manager.synchronize(time)sim_manager.advance(step_size)if__name__=="__main__":main()Command Line Interfacewa_simulatorcan also be run via a command line interface with the entrypointwasim. Whenwa_simulatoris installed, this CLI is automatically made available and has subcommands available.DocumentationHomeBackgroundInstallationAPI ReferencePyPIGithubLicensewa_simulatoris made available under the BSD-3 License. For more details, seeLICENSE.SupportContactWisconsin Autonomousfor any questions or concerns regarding the contents of this repository.See AlsoStay up to date with our technical info by following ourblog.Follow us onFacebook,Instagram, andLinkedIn!