From 56bea97233f02a17dc830cc3c031ed029f933b3d Mon Sep 17 00:00:00 2001 From: Pooyan Jamshidi Date: Sat, 17 Mar 2018 00:49:39 -0400 Subject: [PATCH] Expanding user path --- src/config_plugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config_plugin.cpp b/src/config_plugin.cpp index cb0bc06..748ade4 100644 --- a/src/config_plugin.cpp +++ b/src/config_plugin.cpp @@ -19,6 +19,8 @@ protected: ros::ServiceClient power_load_client; protected: ros::ServiceServer set_bot_configuration; protected: boost::mutex lock; protected: Json::Value config_list; +private: const char * home = getenv("HOME"); + public: ConfigurationPlugin() { @@ -63,7 +65,8 @@ protected: Json::Value config_list; this->default_config = _sdf->Get("default_config"); this->current_config = this->default_config; - std::ifstream config_file(config_path, std::ifstream::binary); + + std::ifstream config_file(home + config_path, std::ifstream::binary); json_reader.parse(config_file, this->config_list, false); }