Simulation tool for prototyping autonomous vehicle related algorithms.
Project description
WA Vehicle Simulator
The WA Simulator is a powerful, multi-platform, lightweight and user-friendly simulation platform for testing algorithms intended for autonomous robot or vehicle applications. This project is under active development by Wisconsin Autonomous, a student organization at the University of Wisconsin - Madison.
Usage
The 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_simulator
import wa_simulator as wa
def main():
# Create the system
sys = wa.WASystem(step_size=1e-3)
# Create an environment using a premade environment description
env_filename = wa.WASimpleEnvironment.EGP_ENV_MODEL_FILE
env = wa.WASimpleEnvironment(sys, env_filename)
# Create an vehicle using a premade vehicle description
veh_inputs = wa.WAVehicleInputs()
veh_filename = wa.WALinearKinematicBicycle.GO_KART_MODEL_FILE
veh = wa.WALinearKinematicBicycle(sys, veh_inputs, veh_filename)
# Visualize the simulation using matplotlib
vis = wa.WAMatplotlibVisualization(sys, veh, veh_inputs, environment=env)
# Control the vehicle using the arrow keys
ctr = wa.WAMatplotlibController(sys, veh_inputs, vis)
# Instantiate the simulation manager
sim_manager = wa.WASimulationManager(sys, env, veh, vis, ctr)
# Simulation loop
step_size = sys.step_size
while sim_manager.is_ok():
time = sys.time
sim_manager.synchronize(time)
sim_manager.advance(step_size)
if __name__ == "__main__":
main()
With Chrono
Using Chrono is as simple as changing a few file names and importing the chrono version of the simulator. Even though wa_simulator.chrono
is the new import, all default wa_simulator
classes are still accessible as seen above. Background about Chrono can be found here.
# Import the wa_simulator
import wa_simulator.chrono as wa
def main():
# Create the system
sys = wa.WAChronoSystem(step_size=1e-3)
# Create an environment using a premade environment description
env_filename = wa.WAChronoEnvironment.EGP_ENV_MODEL_FILE
env = wa.WAChronoEnvironment(sys, env_filename)
# Create an vehicle using a premade vehicle description
veh_inputs = wa.WAVehicleInputs()
veh_filename = wa.WAChronoVehicle.GO_KART_MODEL_FILE
veh = wa.WAChronoVehicle(sys, veh_inputs, env, veh_filename)
# Visualize the simulation using matplotlib
vis = wa.WAMatplotlibVisualization(sys, veh, veh_inputs, environment=env)
# Control the vehicle using the arrow keys
ctr = wa.WAMatplotlibController(sys, veh_inputs, vis)
# Instantiate the simulation manager
sim_manager = wa.WASimulationManager(sys, env, veh, vis, ctr)
# Simulation loop
step_size = sys.step_size
while sim_manager.is_ok():
time = sys.time
sim_manager.synchronize(time)
sim_manager.advance(step_size)
if __name__ == "__main__":
main()
Command Line Interface
wa_simulator
can also be run via a command line interface with the entrypoint wasim
. When wa_simulator
is installed, this CLI is automatically made available and has subcommands available.
Documentation
License
wa_simulator
is made available under the BSD-3 License. For more details, see LICENSE.
Support
Contact Wisconsin Autonomous for any questions or concerns regarding the contents of this repository.
See Also
Stay up to date with our technical info by following our blog.
Follow us on Facebook, Instagram, and LinkedIn!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wa_simulator-2.3.7.tar.gz
.
File metadata
- Download URL: wa_simulator-2.3.7.tar.gz
- Upload date:
- Size: 52.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffb49b1f838d6c6ade272bd2090315dd8988da83e3c70263275dfd407403e487 |
|
MD5 | a1122d965a1c0c893ebfc3606dabff46 |
|
BLAKE2b-256 | 37a5e749b3cff73a4dc65441d6362c68ddb95b20fadfa83749f0e5d359c3acf1 |
File details
Details for the file wa_simulator-2.3.7-py3-none-any.whl
.
File metadata
- Download URL: wa_simulator-2.3.7-py3-none-any.whl
- Upload date:
- Size: 76.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca454f2248689f699f187fdbd53f5e47af25f76cd8141d5ccd87461e9f124985 |
|
MD5 | 75d653edf1fc97b75deac099c82d04cf |
|
BLAKE2b-256 | 2d4f81618b16bbf3f1b43051703cb1c2d8e02f3f211f0eab2cbaf993afd9ae4f |