This file contains the function prototypes for the floodfill algorithm for mapping of the maze.
More...
#include <stdint.h>
#include "pathfinding/maze.h"
Go to the source code of this file.
This file contains the function prototypes for the floodfill algorithm for mapping of the maze.
- Author
- Christopher Kok (chris.nosp@m.@for.nosp@m.celig.nosp@m.htni.nosp@m.ng.xy.nosp@m.z)
- Version
- 0.1
- Date
- 2023-11-06
- Copyright
- Copyright (c) 2023
◆ floodfill_explore_func_t
This function pointer type is used to explore the maze. It is expected to return the walls that the robot sees.
- Parameters
-
p_grid | Pointer to the maze. |
p_navigator | Pointer to the navigator state. |
direction | Direction to explore. |
- Returns
- int16_t Returns a bitmask of the walls.
◆ floodfill_move_navigator_t
floodfill_move_navigator_t |
Moves the navigator/robot in the specified direction.
- Parameters
-
p_navigator | Pointer to the navigator state. |
direction | Direction to move. |
◆ floodfill_init_maze_nowall()
void floodfill_init_maze_nowall |
( |
maze_grid_t * |
p_grid | ) |
|
This function initialises a maze with no walls to perform the floodfill algorithm on.
- Parameters
-
[in,out] | p_grid | Pointer to the maze. |
References maze_grid::columns, maze_grid_cell::coordinates, maze_grid_cell::f, maze_grid_cell::g, maze_grid_cell::h, maze_grid_cell::is_visited, maze_get_cell_in_dir(), maze_grid_cell::p_came_from, maze_grid::p_grid_array, maze_grid_cell::p_next, and maze_grid::rows.
◆ floodfill_map_maze()
Runs the floodfill algorithm to map out the maze.
- Parameters
-
[in,out] | p_grid | Pointer to the initialised maze with no walls. |
[in] | p_end_node | Pointer to the end node. |
[in,out] | p_navigator | Pointer to the navigator state. |
[in] | p_explore_func | Pointer to the function that will explore the maze. |
[in] | p_move_navigator | Pointer to the function that will move the navigator. |
References binary_heap::capacity, maze_grid::columns, maze_grid_cell::f, maze_grid_cell::g, maze_grid_cell::h, maze_clear_heuristics(), MAZE_NONE, maze_navigator_state::orientation, binary_heap::p_array, maze_navigator_state::p_current_node, maze_grid::p_grid_array, maze_grid_cell::p_next, maze_grid::rows, and binary_heap::size.