Skip to main content

Simulation tool for prototyping autonomous vehicle related algorithms. Wrapper of the PyChrono simulator.

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
    system = wa.WASystem(step_size=1e-3)

    # Create an environment using a premade environment description
    env_filename = wa.WASimpleEnvironment.EGP_ENV_MODEL_FILE
    environment = wa.WASimpleEnvironment(system, env_filename)

    # Create an vehicle using a premade vehicle description
    vehicle_inputs = wa.WAVehicleInputs()
    veh_filename = wa.WALinearKinematicBicycle.GO_KART_MODEL_FILE
    vehicle = wa.WALinearKinematicBicycle(system, vehicle_inputs, veh_filename)

    # Visualize the simulation using matplotlib
    visualization = wa.WAMatplotlibVisualization(system, vehicle, vehicle_inputs, environment=environment)

    # Control the vehicle using the arrow keys
    controller = wa.WAMatplotlibController(system, vehicle_inputs, visualization)

    # Instantiate the simulation manager
    sim_manager = wa.WASimulationManager(system, environment, vehicle, visualizatioon, controller)

    # Simulation loop
    step_size = system.step_size
    while sim_manager.is_ok():
        time = system.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
    system = wa.WAChronoSystem(step_size=1e-3)

    # Create an environment using a premade environment description
    env_filename = wa.WAChronoEnvironment.EGP_ENV_MODEL_FILE
    environment = wa.WAChronoEnvironment(system, env_filename)

    # Create an vehicle using a premade vehicle description
    vehicle_inputs = wa.WAVehicleInputs()
    veh_filename = wa.WAChronoVehicle.GO_KART_MODEL_FILE
    vehicle = wa.WAChronoVehicle(system, vehicle_inputs, environment, veh_filename)

    # Visualize the simulation using matplotlib
    visualization = wa.WAMatplotlibVisualization(system, vehicle, vehicle_inputs, environment=environment)

    # Control the vehicle using the arrow keys
    controller = wa.WAMatplotlibController(system, vehicle_inputs, visualization)

    # Instantiate the simulation manager
    sim_manager = wa.WASimulationManager(system, environment, vehicle, visualizatioon, controller)

    # Simulation loop
    step_size = system.step_size
    while sim_manager.is_ok():
        time = system.time

        sim_manager.synchronize(time)
        sim_manager.advance(step_size)


if __name__ == "__main__":
    main()

Documentation

License

wa_simulator is made available under the BSD-3 License. For more details, see LICENSE.

Support

Contact Aaron Young 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!


Wisconsin Autonomous Logo University of Wisconsin - Madison Crest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wa_simulator-2.1.7.tar.gz (59.5 MB view details)

Uploaded Source

Built Distribution

wa_simulator-2.1.7-py3-none-any.whl (75.0 kB view details)

Uploaded Python 3

File details

Details for the file wa_simulator-2.1.7.tar.gz.

File metadata

  • Download URL: wa_simulator-2.1.7.tar.gz
  • Upload date:
  • Size: 59.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for wa_simulator-2.1.7.tar.gz
Algorithm Hash digest
SHA256 dc8b158e3d5e55b8265e10d3e3600f41ada7c650c324cb63b3d2521257f0b352
MD5 1d9a469740009b47de48c8b863e8bc00
BLAKE2b-256 eaa5ac72ea91a00ff757d0180d542e1fdc6c591609421139737736ecbbc696ad

See more details on using hashes here.

File details

Details for the file wa_simulator-2.1.7-py3-none-any.whl.

File metadata

  • Download URL: wa_simulator-2.1.7-py3-none-any.whl
  • Upload date:
  • Size: 75.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for wa_simulator-2.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6b2076d33e5c6ef26360d6f4863e07b9d181106e75d137bf6f1f34aed4dc4814
MD5 fbffeea8488b1f9c14cb713216c8c7e2
BLAKE2b-256 9d46a83d7621adce824a9c3dd42887a04200afcbfae5a2f0630e5b5c153e2840

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page