Giter VIP home page Giter VIP logo

warpcrowd's Introduction

warpcrowd

warpcrowd is a python script for running crowd simulations on the GPU. It is relatively simple (on purpose) with the simulation calculations (social forces) done in one file. Additional files provide some utilities and examples of how to run the simulation.

The script is purely python and relies on NVIDIA Warp for GPU acceleration. However, the USD run example shows how to load and render an environment with the simulation saved to a USD file that can be loaded in Omniverse.

image

Use

There are example files in the examples folder. The two sample scripts are run_mesh_ex.py and run_usd_ex.py. These both by default reference a sample file, although you can change to most other files. Meshes will often be tricky, and although there is a helper function for converting ngons to triangles, its best at the beginning stages to just use triangles.

Features

The social forces implementation is in 3D, but currently resets the vertical force to 0 to keep agents on the ground. The array of agent goals can be set by the user at their desired timestep (e.g. using A*), but in the current samples it is a static goal. The wall forces are calculated by all triangles in the scene (within a distance threshold), which is obviously not the most efficient way.

The main point of these two statements is to put into context the performance of the simulator. With environments of over 20k triangles and 10,000 agents, calculation and saving capsules for 600 timesteps takes around 7 seconds. In some light experiments, it seems the calculation time is nearly the same as the number of agents increase as long as the number of CUDA cores (and memory) are greater than the number of agents.

Requirements

  • warp-lang
  • numpy
  • usd-core (for USD environments)
  • pywavefront (only needed if dealing with meshes like .obj)

Citing

If you find this repo useful, please cite as:

@misc{warpcrowd2023,
title= {Warpcrowd: GPU Accelerated Crowd Simulation},
author = {Mathew Schwartz},
month = {January},
year = {2023},
note= {},
howpublished = {\url{https://github.com/cadop/warpcrowd}}
}

warpcrowd's People

Contributors

cadop avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

warpcrowd's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.