-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvironment.hpp
More file actions
55 lines (42 loc) · 1.48 KB
/
environment.hpp
File metadata and controls
55 lines (42 loc) · 1.48 KB
1
2
3
4
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
#ifndef TREES_SRC_ENVIRONMENT_H
#define TREES_SRC_ENVIRONMENT_H
#include <string>
#include <unordered_map>
#include "yaml-cpp/yaml.h"
#include <glm/vec3.hpp>
using namespace std;
namespace environment
{
inline YAML::Node config = YAML::LoadFile("<path_to_config>/config.yaml");
inline const float qbase_max = config["qbase_max"].as<float>(150.0);
inline const int num_markers = config["num_markers"].as<int>(10);
inline const float r = config["perception_radius"].as<float>(4.0);
inline const float theta = config["perception_angle"].as<float>(90.0);
inline const float ro = config["occupancy_radius"].as<float>(2.0);
inline const float alpha = config["coeff_proportionality"].as<float>(2.0);
inline const float lambda = config["coeff_resource_alloc"].as<float>(0.5);
inline const float voxel_size = config["voxel_size"].as<float>(2.0);
inline const int qmax = config["qmax"].as<int>(3);
inline glm::vec3 tropism() {
float x = config["v_tropism"][0].as<float>(0.0);
float y = config["v_tropism"][1].as<float>(1.0);
float z = config["v_tropism"][2].as<float>(0.0);
return glm::vec3(x, y, z);
}
class ShadowVoxel {
private:
public:
float value = 0.0f;
};
class ShadowGrid {
private:
public:
ShadowGrid(float _voxel_size, glm::vec3 _center);
ShadowVoxel& getVoxelAtPosition(glm::vec3 position);
void propagateShadow(glm::vec3 position);
float voxel_size;
glm::vec3 center;
std::unordered_map<std::string, ShadowVoxel> grid;
};
} // namespace environment
#endif