Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
ground_grid.hpp
Go to the documentation of this file.
1#pragma once
2#include <algorithm>
3#include <cmath>
4#include <limits>
5#include <rclcpp/rclcpp.hpp>
6#include <vector>
7
9
17public:
18 GroundGrid() = default;
19
30 GroundGrid(const double range, const double angle, const double radius,
31 const double start_augmentation, const double radius_augmentation, const double fov);
32
39 float get_ground_height(const float x, const float y) const;
40
47 void set_ground_height(const float x, const float y, const float height);
48
52 void reset_grid();
53
54private:
55 double range_; // Maximum range of the grid
56 GridGeometry grid_geometry_; // Grid geometry struct for grid calculations
57 std::vector<std::vector<float>> grid_; // 2D grid to hold ground heights, initialized to NaN
58};
Class to represent a ground height grid for ground proximity checks.
std::vector< std::vector< float > > grid_
double range_
void set_ground_height(const float x, const float y, const float height)
Set the ground height at a specific (x, y) location.
float get_ground_height(const float x, const float y) const
Get the ground height at a specific (x, y) location.
GroundGrid()=default
void reset_grid()
Reset the ground grid to initial state.
GridGeometry grid_geometry_
Structure to hold grid geometry parameters and provide utility functions.