Skip to content

Commit 8003f8a

Browse files
committed
Added new GolfSimConfiguration::GetPiTracRootPath() method.
1 parent 4764be3 commit 8003f8a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Software/LMSourceCode/ImageProcessing/gs_config.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ namespace golf_sim {
102102
return true;
103103
}
104104

105+
// Returns the valiue of the environment variable PITRAC_ROOT
106+
std::string GolfSimConfiguration::GetPiTracRootPath() {
107+
108+
std::string pi_trac_root = safe_getenv("PITRAC_ROOT");
109+
110+
if (pi_trac_root.empty()) {
111+
GS_LOG_MSG(warning, "Environment variable PITRAC_ROOT is not set.");
112+
}
113+
else {
114+
GS_LOG_MSG(trace, "Environment variable PITRAC_ROOT is: " + pi_trac_root + ".");
115+
}
116+
return pi_trac_root;
117+
}
105118

106119
// TBD - Will need to be improved to adapt to having two cameras on the same
107120
// Pi.

Software/LMSourceCode/ImageProcessing/gs_config.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ namespace golf_sim {
7474
// messaging system.
7575
static std::string GetSystemID();
7676

77+
// Returns the valiue of the environment variable PITRAC_ROOT
78+
static std::string GetPiTracRootPath();
79+
7780
protected:
7881

7982
static boost::property_tree::ptree configuration_root_;

0 commit comments

Comments
 (0)