Skip to content

Commit

Permalink
merge: main -> main
Browse files Browse the repository at this point in the history
  • Loading branch information
jens-hj committed May 29, 2024
2 parents d487af0 + 43a62b3 commit 47ebe69
Show file tree
Hide file tree
Showing 79 changed files with 2,339 additions and 600 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ rustflags = [
"-Clink-arg=-fuse-ld=mold", # Use mold Linker
"-Zshare-generics=y", # (Nightly) Make the current crate share its generic instantiations
"-Zthreads=8", # (Nightly) Use improved multithreading with the recommended amount of threads.
"-Ctarget-cpu=native",
# "-Ctarget-feature=+simd128",
]

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ flamegraphs/*

*.json
!results/*.json

*.html

experiments/
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tasks.wasm]
script = [
"echo hello",
]

[tasks.docs]
description = "Generate rust documentation."
command = "cargo"
args = [
"doc",
"--no-deps",
]

[tasks.format]
description = "Runs the cargo rustfmt plugin."
install_crate = "rustfmt"
command = "cargo"
# args = ["fmt", "--", "--write-mode=overwrite"]
args = [
"fmt",
]
54 changes: 48 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,53 @@
https://github.com/aalpatya/gbpplanner reimplemented in Rust!


FrameCountPlugin
## External Dependencies

EntityCountDiagnosticsPlugin
SystemInformationDiagnosticsPlugin
GizmoPlugin
ScreenShotPlugin
Most dependencies used are available through the `crates.io` registry. And should work on all major platforms supported by the `cargo` build tool. Still some external dependencies are needed for the graphical session.

Create a function to output a graphviz representation of the factor graph similar to how "visual introduction gbp" shows their factor graphs
| Dependencies | Platform Specific |
|--------------|----------|
| `udev` | Linux |
| `alsa-lib` | Linux |
| `vulkan-loader` | |
| `xorg.libX11` | Linux + X11 |
| `xorg.libXcursor` | Linux + X11 |
| `xorg.libXi` | Linux + X11 |
| `xorg.libXrandr` | Linux + X11 |
| `libxkbcommon` | Linux + X11 |
| `wayland` | Linux + Wayland |
| `egl-wayland` | Linux + Wayland |
| `freetype` | |
| `fontconfig` | |

The exact name of the dependency might vary between platforms, and even between Linux distributions. Consult the respective package management tool used on your system for their exact names.


### Nix/NixOS

The `./flake.nix` file provides a development shell with all the necessary dependencies to run the project. If you have `direnv` installed you can simply use the provided `.envrc` and type `direnv allow` to automatically enter it. Otherwise you can run:

```sh
# To enter the development environment
nix develop
```

## Build

The entire project can be build with the following command:

```
cargo build --release
```

## Run


```sh
cargo run --release --bin gbpplanner-rs # Open the simulator
cargo run --release --bin gbpplanner-rs -- --list # List all available scenarios

# Run a specific scenario
cargo run --release --bin gbpplanner-rs -- -i <SCENARIO_NAME>
cargo run --release --bin gbpplanner-rs -- --initial-scenario <SCENARIO_NAME>
```
19 changes: 11 additions & 8 deletions config/simulations/Circle Experiment/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ formation_group = "./config/simulations/ClearCircle/formation.ron"

[interaction]
ui-focus-cancels-inputs = true
default-cam-distance = 100.0
default-cam-distance = 150.0

[visualisation.uncertainty]
max-radius = 2.5
Expand All @@ -17,11 +17,11 @@ height-map = 1.0

[visualisation.draw]
robots = true
communication-graph = true
predicted-trajectories = true
communication-graph = false
predicted-trajectories = false
waypoints = false
uncertainty = false
paths = true
paths = false
generated-map = true
height-map = false
sdf = false
Expand All @@ -33,7 +33,7 @@ interrobot-factors-safety-distance = false
robot-colliders = false
environment-colliders = false
robot-robot-collisions = true
robot-environment-collisions = true
robot-environment-collisions = false

[gbp]
sigma-pose-fixed = 1e-15
Expand All @@ -50,7 +50,9 @@ schedule = "interleave-evenly"

[robot]
# planning-horizon = 13.33 # 2r / initial speed
planning-horizon = 3.0
# planning-horizon = 12.4 # 2r / initial speed
planning-horizon = 5
# planning-horizon = 10
# planning-horizon = 6.677 # 2r / initial speed
max-speed = 15.0
inter-robot-safety-distance-multiplier = 2.2
Expand All @@ -70,9 +72,10 @@ time-scale = 1.0
manual-step-factor = 1
hz = 10.0
# world-size = 100.0
prng-seed = 0
prng-seed = 805
pause-on-spawn = false
despawn-robot-when-final-waypoint-reached = false
despawn-robot-when-final-waypoint-reached = true
exit-application-on-scenario-finished = true

[rrt]
max-iterations = 1000000
Expand Down
3 changes: 2 additions & 1 deletion config/simulations/Circle Experiment/formation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ formations:
delay:
secs: 1
nanos: 0
robots: 50
robots: 30
planning-strategy: only-local
initial-position:
shape: !circle
Expand All @@ -25,4 +25,5 @@ formations:
projection-strategy: cross
# waypoint-reached-when-intersects: horizon
waypoint-reached-when-intersects: current
finished-when-intersects: current
# waypoint-reached-when-intersects: !variable 5
21 changes: 11 additions & 10 deletions config/simulations/Communications Failure Experiment/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ height-map = 1.0
[visualisation.draw]
robots = true
communication-graph = false
predicted-trajectories = true
predicted-trajectories = false
waypoints = false
uncertainty = false
paths = true
paths = false
generated-map = true
sdf = true
communication-radius = false
Expand All @@ -30,9 +30,9 @@ tracking = false
interrobot-factors = false
interrobot-factors-safety-distance = false
robot-colliders = false
environment-colliders = true
robot-robot-collisions = true
robot-environment-collisions = true
environment-colliders = false
robot-robot-collisions = false
robot-environment-collisions = false

[gbp]
# sigma-pose-fixed = 0.000000000000001
Expand All @@ -50,17 +50,17 @@ external = 10
schedule = "interleave-evenly"

[robot]
planning-horizon = 5.0
planning-horizon = 10.0
max-speed = 10.0
inter-robot-safety-distance-multiplier = 2.2

[robot.radius]
min = 2.0
max = 3.0
min = 2.5
max = 2.5

[robot.communication]
radius = 50.0
failure-rate = 0.0
failure-rate = 0.2

[simulation]
# t0 = 0.1
Expand All @@ -71,7 +71,8 @@ hz = 10.0
# world-size = 100.0
prng-seed = 0
pause-on-spawn = false
despawn-robot-when-final-waypoint-reached = false
despawn-robot-when-final-waypoint-reached = true
exit-application-on-scenario-finished = true

[rrt]
max-iterations = 1000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ tiles:
grid:
-
settings:
tile-size: 100.0
tile-size: 200.0
path-width: 0.1
obstacle-height: 1.0
sdf:
resolution: 200
expansion: 0.001
blur: 0.001
resolution: 500
expansion: 0.01
blur: 0.005

obstacles:
- shape: !regular-polygon
sides: 4
Expand Down Expand Up @@ -41,8 +42,8 @@ obstacles:
row: 0
col: 0
- shape: !rectangle
width: 0.0875
height: 0.035
width: 0.035
height: 0.0875
translation:
x: 0.589
y: 0.3965
Expand All @@ -52,9 +53,9 @@ obstacles:
col: 0
- shape: !triangle
angles:
A: 0.5235987755982988
B: 0.5235987755982988
radius: 0.05
A: 1.22
B: 1.22
radius: 0.025
rotation: 0.0
translation:
x: 0.5575
Expand All @@ -64,10 +65,10 @@ obstacles:
col: 0
- shape: !triangle
angles:
A: 1.9198621771937625
B: 0.6981317007977318
radius: 0.03
rotation: 5.225
A: 0.6981317007977318
B: 1.9198621771937625
radius: 0.01
rotation: 5.2
translation:
x: 0.38
y: 0.432
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ formations:
projection-strategy: cross
# waypoint-reached-when-intersects: horizon
waypoint-reached-when-intersects: current
finished-when-intersects: current
# waypoint-reached-when-intersects: !variable 5
4 changes: 4 additions & 0 deletions config/simulations/Complex/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ internal = 10
external = 10
schedule = "interleave-evenly"

[gbp.tracking]
attraction-distance = 1.0
switch-padding = 5.0

[robot]
planning-horizon = 5.0
max-speed = 7.0
Expand Down
16 changes: 9 additions & 7 deletions config/simulations/Environment Obstacles Experiment/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ formation_group = "./config/simulations/Circle/formation.ron"

[interaction]
ui-focus-cancels-inputs = true
default-cam-distance = 100.0
default-cam-distance = 250.0

[visualisation.uncertainty]
max-radius = 2.5
Expand Down Expand Up @@ -43,15 +43,15 @@ sigma-factor-interrobot = 0.005
sigma-factor-obstacle = 0.005
sigma-factor-tracking = 0.1
# iterations-per-timestep = 10
lookahead-multiple = 3
lookahead-multiple = 1

[gbp.iteration-schedule]
internal = 50
external = 10
schedule = "interleave-evenly"

[robot]
planning-horizon = 5.0
planning-horizon = 13.33
max-speed = 15.0
inter-robot-safety-distance-multiplier = 2.2

Expand Down Expand Up @@ -91,13 +91,15 @@ export-location = "./assets/export/"

[graphviz.interrobot.active]
style = "dashed"
len = 8.0
color = "red"
len = 5.0
# color = "green"
color = "#40a02b"

[graphviz.interrobot.inactive]
style = "dashed"
len = 8.0
color = "gray"
len = 5.0
color = "#d20f39"
# color = "red"


[manual]
Expand Down
Loading

0 comments on commit 47ebe69

Please sign in to comment.