Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
search_map.c File Reference

Library for generic map to store and search from sensor data. More...

Include dependency graph for search_map.c:

Go to the source code of this file.

Macros

#define SEARCH_MAP_DEBUG   0
#define DEBUG_PRINT(...)

Functions

void search_map_init (struct search_map_t *map, struct NedCoor_f pos, float res)
 init map
void search_map_init_from_wp (struct search_map_t *map, uint8_t wp_id, float res)
 init map from waypoint
void search_map_reset (struct search_map_t *map)
 reset map
bool search_map_update (struct search_map_t *map, float data, struct NedCoor_f pos)
 update map with new data
float search_map_get_barycenter (struct search_map_t *map, float threshold, struct NedCoor_f *pos)
 get weighted center of the data, expected to be the search position
void search_map_update_wp (struct search_map_t *map, float threshold, uint8_t wp_id)
 update waypoint position from map

Detailed Description

Library for generic map to store and search from sensor data.

Definition in file search_map.c.

Macro Definition Documentation

◆ DEBUG_PRINT

#define DEBUG_PRINT ( ...)
Value:
{}

Definition at line 34 of file search_map.c.

Referenced by search_map_get_barycenter(), search_map_init(), and search_map_update().

◆ SEARCH_MAP_DEBUG

#define SEARCH_MAP_DEBUG   0

Definition at line 29 of file search_map.c.

Function Documentation

◆ search_map_get_barycenter()

float search_map_get_barycenter ( struct search_map_t * map,
float threshold,
struct NedCoor_f * pos )

get weighted center of the data, expected to be the search position

Parameters
[in]mappointer to map
[in]thresholdvalue between 0 and 1 to filter data (only consider the normalized data above the threshold)
[out]pospointer to computed position
Returns
quality (the averaged data at barycenter)

Definition at line 79 of file search_map.c.

References search_map_t::center, DEBUG_PRINT, search_map_t::grid, offset, search_map_t::res, SEARCH_MAP_SIZE, val, NedCoor_f::x, NedCoor_f::y, and NedCoor_f::z.

Referenced by search_map_update_wp().

Here is the caller graph for this function:

◆ search_map_init()

void search_map_init ( struct search_map_t * map,
struct NedCoor_f pos,
float res )

init map

Parameters
[in]mappointer to map
[in]posposition of the map center
[in]resresolution of the map in m per cell

Definition at line 38 of file search_map.c.

References search_map_t::center, DEBUG_PRINT, search_map_t::grid, search_map_t::res, SEARCH_MAP_SIZE, NedCoor_f::x, and NedCoor_f::y.

Referenced by search_map_init_from_wp().

Here is the caller graph for this function:

◆ search_map_init_from_wp()

void search_map_init_from_wp ( struct search_map_t * map,
uint8_t wp_id,
float res )

init map from waypoint

Parameters
[in]mappointer to map
[in]wp_idwaypoint ID
[in]resresolution of the map in m per cell

Definition at line 50 of file search_map.c.

References ENU_OF_TO_NED, search_map_init(), and waypoint_get_enu_f().

Referenced by scout_detector_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ search_map_reset()

void search_map_reset ( struct search_map_t * map)

reset map

Parameters
[in]mappointer to map

Definition at line 58 of file search_map.c.

References search_map_t::grid, and SEARCH_MAP_SIZE.

◆ search_map_update()

bool search_map_update ( struct search_map_t * map,
float data,
struct NedCoor_f pos )

update map with new data

Parameters
[in]mappointer to map
[in]datanew data
[in]posposition of the new data
Returns
false is position is outside the map

Definition at line 67 of file search_map.c.

References search_map_t::center, DEBUG_PRINT, search_map_t::grid, search_map_t::res, SEARCH_MAP_SIZE, NedCoor_f::x, and NedCoor_f::y.

Referenced by scout_detector_sim(), and scout_detector_uavcan_cb().

Here is the caller graph for this function:

◆ search_map_update_wp()

void search_map_update_wp ( struct search_map_t * map,
float threshold,
uint8_t wp_id )

update waypoint position from map

Parameters
[in]mappointer to map
[in]thresholdvalue between 0 and 1 to filter data (only consider the normalized data above the threshold)
[in]wp_idwaypoint ID

Definition at line 135 of file search_map.c.

References ENU_OF_TO_NED, search_map_get_barycenter(), and waypoint_set_enu().

Here is the call graph for this function: