Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
[src] Edit configure from file
Browse files Browse the repository at this point in the history
  • Loading branch information
AnaBatinovic committed Mar 21, 2023
1 parent ba3e013 commit 8fd5d58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
8 changes: 2 additions & 6 deletions src/BestFrontier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@ namespace best_frontier
{
ros::NodeHandle private_nh {ros::NodeHandle("~")};

string username = "/home/";
username = username + getenv("USER") + "";
m_logfile.open(username + "/log_best_frontier.txt");
m_logfile.open("/log_best_frontier.txt");
m_logfile << "This is a log file for BestFrontier" << endl;

// Read from yaml file
private_nh.param("exploration_config_filename", m_configFilename, m_configFilename);
size_t found = m_configFilename.find(username);
if (found != string::npos) configureFromFile(m_configFilename);
else configureFromFile(username + m_configFilename);
configureFromFile(m_configFilename);
}

bool BestFrontier::configureFromFile(string config_filename)
Expand Down
8 changes: 2 additions & 6 deletions src/FrontierServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ namespace frontier_server

// Read from yaml file
private_nh.param("exploration_config_filename", m_configFilename, m_configFilename);
string username = "/home/";
username = username + getenv("USER") + "";
size_t found = m_configFilename.find(username);
if (found != string::npos) configureFromFile(m_configFilename);
else configureFromFile(username + m_configFilename);
configureFromFile(m_configFilename);

m_logfile.open(username + "/log_frontier.txt");
m_logfile.open("/log_frontier.txt");
m_logfile << "This is a log file for 3D-Frontier" << endl;

// Initialize publishers
Expand Down
8 changes: 2 additions & 6 deletions src/OctomapServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ namespace octomap_server

// Read from yaml file
private_nh.param("exploration_config_filename", m_configFilename, m_configFilename);
string username = "/home/";
username = username + getenv("USER") + "";
size_t found = m_configFilename.find(username);
if (found != string::npos) configureFromFile(m_configFilename);
else configureFromFile(username + m_configFilename);
configureFromFile(m_configFilename);

m_logfile.open(username + "/log_octomap.txt");
m_logfile.open("log_octomap.txt");
m_logfile << "This is a log file for OctomapServer." << endl;

// Initialize octomap object and params
Expand Down

0 comments on commit 8fd5d58

Please sign in to comment.