Galaxis Codebase  1.0.0
Team Galaxis software stack for the Carolo Cup 2023 - ROS2 based software
MapUtils.hpp
Go to the documentation of this file.
1 #ifndef MAP_UTLIS_HPP
2 #define MAP_UTLIS_HPP
3 
4 #include <galaxis/linatypes.hpp>
5 #include <array>
6 #include <mutex>
7 namespace map {
8  namespace utils {
9 
10  inline float getMin(std::array<galaxis::lina::Vector2f, 4> const& array, int index) {
11  float min = array[0][index];
12  for(auto const& item: array) {
13  if(item[index] < min) {
14  min = item[index];
15  }
16  }
17  return min;
18  }
19 
20  inline float getMax(std::array<galaxis::lina::Vector2f, 4> const& array, int index) {
21  float max = array[0][index];
22  for(auto const& item: array) {
23  if(item[index] > max) {
24  max = item[index];
25  }
26  }
27  return max;
28  }
29 
30  } // namespace utils
31 } // namespace map
32 
33 #endif
map::utils::getMin
float getMin(std::array< galaxis::lina::Vector2f, 4 > const &array, int index)
Definition: MapUtils.hpp:10
map::utils::getMax
float getMax(std::array< galaxis::lina::Vector2f, 4 > const &array, int index)
Definition: MapUtils.hpp:20
linatypes.hpp
map
Definition: MapClasses.hpp:15