From 19e66235f9e6a35fb49502b98222d477363f09e6 Mon Sep 17 00:00:00 2001 From: Sascha Jongebloed Date: Fri, 23 May 2025 15:48:41 +0200 Subject: [PATCH] Added correct configuration for logger --- src/ROSInterface.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ROSInterface.cpp b/src/ROSInterface.cpp index a5591aa..8ee0e95 100644 --- a/src/ROSInterface.cpp +++ b/src/ROSInterface.cpp @@ -41,6 +41,8 @@ ROSInterface::ROSInterface(const boost::property_tree::ptree &config) this, _1), false), tell_action_server_(nh_, "knowrob/tell", boost::bind(&ROSInterface::executeTellCB, this, _1), false), kb_(KnowledgeBase::create(config)) { + + // Start all action servers askall_action_server_.start(); askone_action_server_.start(); @@ -358,9 +360,16 @@ int main(int argc, char **argv) { InitKnowRob(argc, argv); // Load settings files + boost::property_tree::ptree config = InterfaceUtils::loadSettings(); + // configure logging + auto log_config = config.get_child_optional("logging"); + if (log_config) { + Logger::loadConfiguration(log_config.value()); + } + try { ros::init(argc, argv, "knowrob_node"); - ROSInterface ros_interface(InterfaceUtils::loadSettings()); + ROSInterface ros_interface(config); KB_INFO("[KnowRob] ROS node started."); ros::spin(); }