Skip to content

Commit f991554

Browse files
adding gif for dijkstra
1 parent 17137f1 commit f991554

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cargo run --bin ekf
2727
* [Cubic Spline](#cubic-spline)
2828
* [Dynamic Window Approach](#dynamic-window-approach)
2929
* [Model Predictive Trajectory Generator](#model-predictive-trajectory-generator)
30-
* Dijkstra algorithm
30+
* [Dijkstra algorithm](#dijkstra_planner)
3131
* Potential Field algorithm
3232
* State Lattice Planner
3333
* Rapidly-Exploring Random Trees (RRT)
@@ -112,6 +112,11 @@ cargo run --bin model_predictive_trajectory_generator
112112
```
113113

114114
## Dijkstra algorithm
115+
116+
<img src="./media/dijkstra-motion-planner.gif" width="640px">
117+
118+
- [src](./src/bin/dijkstra.rs)
119+
115120
## Potential Field algorithm
116121
## State Lattice Planner
117122
## Rapidly-Exploring Random Trees

media/dijkstra-motion-planner.gif

224 KB
Loading

src/bin/dijkstra.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ fn dijkstra_planner(obstacle_map: &grid_map::Map, source: &(usize, usize), goal:
9999
}
100100
}
101101

102+
let mut stop = true;
103+
102104
loop {
103105
let filter_dist: BTreeMap<_, _> = dist
104106
.iter()
@@ -172,6 +174,11 @@ fn dijkstra_planner(obstacle_map: &grid_map::Map, source: &(usize, usize), goal:
172174
fg.show_and_keep_running().unwrap();
173175
sleep(Duration::from_millis(10));
174176

177+
if stop {
178+
sleep(Duration::from_millis(10000));
179+
stop = false;
180+
}
181+
175182
if path_x.len() > 1 {
176183
fg.save_to_svg(format!("{}/img/dijkstra_planner.svg", crate_dir).as_str(), 800, 600);
177184
break

0 commit comments

Comments
 (0)