Skip to content

Commit

Permalink
update: update codebase to v1.1.0
Browse files Browse the repository at this point in the history
. This update is an import from a locally maintained repository.
  • Loading branch information
chrismo-schmidt committed Nov 10, 2023
1 parent 10537e6 commit 6cc342e
Show file tree
Hide file tree
Showing 19 changed files with 5,991 additions and 1,294 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ __pycache__/
*.pdf
*.png
*.gif
*.pgf
*.html

# C and Fortran extensions
*.so
Expand Down
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
Cyclistsocialforce: Modified Social Forces for Cyclists with Realistic Dynamics in SUMO
==============================

This is a working repostory for a package that implements a modified social force model for cyclists. Instead of accelerations, our social forces represent the preferred velocities of a cyclist to their destination and around obstacles. This allows to introduce a 2D kinematic bicycle model and two controllers for acceleration and steer. The original social force model for pedestrians was introduced by Helbing and Molnár (1995). Our model uses the separation into tactical and operational behavior introduced by Twaddle (2017).
This is a working repostory for a package that implements a modified social force model for cyclists. Instead of accelerations, our social forces represent the preferred velocities of a cyclist to their destination and around obstacles. This allows to introduce a various controlled models of bicycle dynamics. The original social force model for pedestrians was introduced by Helbing and Molnár (1995). Our model uses the separation into tactical and operational behavior introduced by Twaddle (2017) and currently only addresses operational behaviour.

The model supports co-simulation with [Eclipse SUMO ](https://eclipse.dev/sumo/) via sumolib and the TraCI interface.
The model supports co-simulation with [Eclipse SUMO ](https://eclipse.dev/sumo/) via sumolib and the [TraCI]([TraCI - SUMO Documentation](https://sumo.dlr.de/docs/TraCI.html))/[Libsumo]([Libsumo - SUMO Documentation](https://sumo.dlr.de/docs/Libsumo.html)) interface.

The model is developed for our contribution to the [2023 Bicycle and Motorcycle Dynamics Conference, 18-20 October 2023, Delft, Netherlands](https://dapp.orvium.io/deposits/649d4037c2c818c6824899bd/view), in the context of my PhD project at TU Delft. Refer to our extended abstract for more explanation. If you use this model in your research, please cite it as indicted below.
The model is developed for our contribution to the [2023 Bicycle and Motorcycle Dynamics Conference, 18-20 October 2023, Delft, Netherlands](https://dapp.orvium.io/deposits/649d4037c2c818c6824899bd/view), in the context of my PhD project at TU Delft. Refer to our conference proceedings preprint for more explanation. If you use this model in your research, please cite it as indicted below.

We provide three different bicycle models:

- `vehicle.Bicycle`: Simple two-wheeler kinematics without wheel slip. ([Model from v0.1.x]([Release v0.1.1 (BMD2023 Extended Abstract) · chrismo-schmidt/cyclistsocialforce · GitHub](https://github.com/chrismo-schmidt/cyclistsocialforce/releases/tag/v0.1.1-bmd2023extendedabstract)))

- `vehicle.InvertedPendulumBicycle`: Two-Wheeler kinematics with an inverted pendulum on top to simulate bicycle roll. A nested control loop ensures that the bicycle stays upright while following the desired yaw angle given by the social force. Additionally, the model includes new repulsive force field shapes and path planning based destination forces. Introduced with v.1.1.0

- `vehicle.TwoDBicycle`: Same two-wheeler kinematics as Bicycle, but with the modified repulsive force fields and path planning of InvertedPendulumBicycle. Introduced with v.1.1.0

### Disclaimer

The package is under development. It may contain bugs and sections of unused or insensible code. Major changes to this package are planned for the time to come. A proper API documentation is still missing. Refer to the demos for examples how to use this model.
The package is research code under development. It may contain bugs and sections of unused or insensible code as well as undocumented features. Major changes to this package are planned for the time to come. A proper API documentation is still missing. Refer to the demos for examples how to use this model.

## Installation

Expand All @@ -30,7 +38,7 @@ The package is under development. It may contain bugs and sections of unused or

## Demos

The package comes with two demos. The first demo shows a simple interaction between two cyclists. The script is pre-coded with an encroachment confclict. Running the script shows a produces an animation of the interaction and a plot of the force fields and potentials of the two cyclists. The second demo shows co-simulation of an intersection with SUMO. It launches the SUMO GUI and creates a small scenario of a four-legged intersection with random bicycle demand. On the road segments, cyclists are controlled by SUMO. As soon as cyclists enter the intersection area, the social force model takes over control. Movements are synchronized between SUMO and the social force model by using the TraCI interface.
The package comes with three demos. The first demo shows a simple interaction between three cyclists in open space. The script is pre-coded with an encroachment conflict and runs as a standalone without SUMO. Running the script produces an animation of the interaction and a plot of the vehicle states. The second demo shows co-simulation of an intersection with SUMO. It launches the SUMO GUI and creates a small scenario of a three-legged intersection with random bicycle demand. On the road segments, cyclists are controlled by SUMO. As soon as cyclists enter the intersection area, the social force model takes over control. Movements are synchronized between SUMO and the social force model by using the TraCI interface. Switching toLibsumo is possible by uncomming a config variable in the beginning of the script, but this will [prevent simulation with the SUMO GUI.]([Libsumo - SUMO Documentation](https://sumo.dlr.de/docs/Libsumo.html#limitations)) A third demo simulates a larger SUMO scenario with four intersections.

**Running the demos:**

Expand All @@ -40,18 +48,24 @@ Switch to the demo directroy.
cd ./demo
```

Run the standalone demo. Optionally set the `--save` flag to save a pdf of the potential and force plots to the `./demo/output/` folder.
Run the standalone demo. Optionally set the `--save` flag to save a pdf of the potential and force plots to the `./demo/output/` folder. Set the `--use_inv_pendulum_bike` flag to use the `vehicle.InvertedPendulumBicycle` model instead of `vehicle.Bicycle`.

```
python demoCSFstandalone.py
```

Run the SUMO demo. After executing the line below, the SUMO GUI and matplotllib figure opens. To start the simulation, press the 'play' button in the SUMO GUI. To end it, press 'stop'.
Run the SUMO demos. After executing the line below, the SUMO GUI and matplotllib figure opens. To start the simulation, press the 'play' button in the SUMO GUI. To end it, press 'stop'. This uses the `vehicle.Bicycle` model. The inverted pendulum model currently not stable enough for crowed scenarios like this demos.

```
python demoCSFxSUMO.py
```

Or:

```
python demoCSFxSUMO-large.py
```

## Authors

- Christoph M. Schmidt, [email protected]
Expand All @@ -65,8 +79,7 @@ This package is licensed under the terms of the [MIT license](https://github.co

If you use this model in your research, please cite it in your publications as:

Schmidt, C., Dabiri, A., Schulte, F., Happee, R. & Moore, J. (2023). Essential Bicycle Dynamics for Microscopic Traffic Simulation: An Example Using the
Social Force Model. The Evolving Scholar - BMD 2023, 5th Edition. [https://doi.org/10.59490/649d4037c2c818c6824899bd](https://doi.org/10.59490/649d4037c2c818c6824899bd)
Schmidt, C., Dabiri, A., Schulte, F., Happee, R. & Moore, J. (2023). Essential Bicycle Dynamics for Microscopic Traffic Simulation: An Example Using the Social Force Model [Preprint]. The Evolving Scholar - BMD 2023, 5th Edition. https://doi.org/10.59490/65037d08763775ba4854da53

## Bibliography

Expand Down
Loading

0 comments on commit 6cc342e

Please sign in to comment.