Reference¶
Planners¶
A*¶
seally.planners.a_star
¶
AStar
¶
A* Algorithm for finding the shortest path between points in a enviroment.
Source code in src/seally/planners/a_star.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
compute_path(source, goal)
¶
Computes the shortest path from the source position to the goal position using the A* Algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Position
|
The source position in the enviroment. |
required |
goal
|
Position
|
The goal position in the enviroment. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The shortest path from source to goal. |
Source code in src/seally/planners/a_star.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
Breadth-First Search¶
seally.planners.bfs
¶
BFS
¶
Breadth First Search algorithm for finding paths between points in a enviroment.
Source code in src/seally/planners/bfs.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
compute_path(source, goal)
¶
Computes a path from the source position to the goal position using the Breadth First Search Algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Position
|
The source position in the enviroment. |
required |
goal
|
Position
|
The goal position in the enviroment. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
A path from source to goal. |
Source code in src/seally/planners/bfs.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
Depth-First Search¶
seally.planners.dfs
¶
DFS
¶
Depth First Search algorithm for finding paths between points in a enviroment.
Source code in src/seally/planners/dfs.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
compute_path(source, goal)
¶
Computes a path from the source position to the goal position using the Depth First Search Algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Position
|
The source position in the enviroment. |
required |
goal
|
Position
|
The goal position in the enviroment. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
A path from source to goal. |
Source code in src/seally/planners/dfs.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
Dijkstra's Algorithm¶
seally.planners.dijkstras
¶
Dijkstras
¶
Dijkstra's Algorithm for finding the shortest path between points in a enviroment.
Source code in src/seally/planners/dijkstras.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
compute_path(source, goal)
¶
Computes the shortest path from the source position to the goal position using Dijkstra's Algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Position
|
The source position in the enviroment. |
required |
goal
|
Position
|
The goal position in the enviroment. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The shortest path from source to goal. |
Source code in src/seally/planners/dijkstras.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
Greedy Best First Search¶
seally.planners.gbf
¶
GreedyBestFirst
¶
Greedy Best First Search algorithm for finding paths between points in a enviroment.
Source code in src/seally/planners/gbf.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
compute_path(source, goal)
¶
Computes a path from the source position to the goal position using the Greedy Best First Search Algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Position
|
The source position in the enviroment. |
required |
goal
|
Position
|
The goal position in the enviroment. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
A path from source to goal. |
Source code in src/seally/planners/gbf.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
Wavefront Search¶
seally.planners.wave_front
¶
WaveFront
¶
Wave Front Algorithm for finding the shortest path between points in a GridMap.
Source code in src/seally/planners/wave_front.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
calc_wavefront(goal)
¶
Generates a wave front by calculating the distance from each cell in the GridMap to the goal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
goal
|
GridCell
|
The goal cell in the GridMap. |
required |
Source code in src/seally/planners/wave_front.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
compute_path(source, goal)
¶
Computes the shortest path from the source GridCell to the goal GridCell using the Wave Front Algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
GridCell
|
The source cell in the GridMap. |
required |
goal
|
GridCell
|
The goal cell in the GridMap. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
A path from source to goal. |
Source code in src/seally/planners/wave_front.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
Environments¶
Enviroment¶
seally.env.enviroment
¶
Enviroment
¶
Bases: ABC
Source code in src/seally/env/enviroment.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
get_neighbors(position)
abstractmethod
¶
!TODO: Add Comment
Source code in src/seally/env/enviroment.py
44 45 46 47 48 49 | |
in_bounds(pos)
abstractmethod
¶
!TODO Add Comment
Source code in src/seally/env/enviroment.py
37 38 39 40 41 42 | |
is_occupied(pos)
abstractmethod
¶
!TODO: ADD comment
Source code in src/seally/env/enviroment.py
30 31 32 33 34 35 | |
Position
¶
Bases: ABC
Cell in a GridMap
Source code in src/seally/env/enviroment.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
Grid Map¶
seally.env.grid_map
¶
GridCell
¶
Bases: Position
Cell in a GridMap
Source code in src/seally/env/grid_map.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
GridMap
¶
Bases: Enviroment
Grid based discritization of an enviroment. GridMaps store enviroments as a numpy array where the value at each cell is either 0 if the cell is free and 1 if it is occupied.
Source code in src/seally/env/grid_map.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
get_cost(source, goal)
¶
Computes the cost of going from the source cell the goal cell. For GridMaps the cost is sqrt(2) for diagonal cells and 1 otherwise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Position
|
The source cell in the GridMap. |
required |
goal
|
Position
|
The goal cell in the GridMap. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The cost of going from source to goal. |
Source code in src/seally/env/grid_map.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
get_neighbors(cell)
¶
Retuns a list of all valid neighbors for a given cell in the Gripmap A valid cell is a cell that is within the bounds of the map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
Position
|
The cell whose neighbors to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
List[Position]
|
A list of the cells valid neighbors. |
Source code in src/seally/env/grid_map.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
in_bounds(cell)
¶
Determines if the provided coordinates within the bounds of the map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
Position
|
Cell to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the position is in bounds. |
Source code in src/seally/env/grid_map.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
is_occupied(cell)
¶
Determines if the provided coordinates are in collision with an obstacle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
Position
|
Cell to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the position is in collision. |
Source code in src/seally/env/grid_map.py
73 74 75 76 77 78 79 80 81 82 83 | |
Common¶
Heuristics¶
seally.common.heuristics
¶
chebyshev_distance(source, goal)
¶
Computes the Chebyshev distance between the source and goal positions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Position
|
The source position. |
required |
goal
|
Position
|
The goal position. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The Chebyshev distance between the source and goal positions. |
Source code in src/seally/common/heuristics.py
32 33 34 35 36 37 38 39 40 41 42 43 | |
euclidean_distance(source, goal)
¶
Computes the Euclidean distance between the source and goal positions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Position
|
The source position. |
required |
goal
|
Position
|
The goal position. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The Euclidean distance between the source and goal positions. |
Source code in src/seally/common/heuristics.py
6 7 8 9 10 11 12 13 14 15 16 17 | |
manhattan_distance(source, goal)
¶
Computes the Manhattan distance between the source and goal positions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Position
|
The source position. |
required |
goal
|
Position
|
The goal position. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The Manhattan distance between the source and goal positions. |
Source code in src/seally/common/heuristics.py
19 20 21 22 23 24 25 26 27 28 29 30 | |