From 9668b29f19a287d5a7df4588cffadc5476c94128 Mon Sep 17 00:00:00 2001 From: josegarcia Date: Wed, 19 Jun 2024 09:12:29 +0200 Subject: [PATCH] chore: dock database cleanup Signed-off-by: josegarcia --- nav2_bringup/params/nav2_params.yaml | 2 +- .../opennav_docking/src/dock_database.cpp | 17 +---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/nav2_bringup/params/nav2_params.yaml b/nav2_bringup/params/nav2_params.yaml index 4ef22f6d4ce..307eb2f37a6 100644 --- a/nav2_bringup/params/nav2_params.yaml +++ b/nav2_bringup/params/nav2_params.yaml @@ -407,7 +407,7 @@ docking_server: filter_coef: 0.1 # Dock instances - # The following example illustrates how you should configure the docks instances. + # The following example illustrates configuring dock instances. # docks: ['home_dock'] # Input your docks here # home_dock: # type: 'simple_charging_dock' diff --git a/nav2_docking/opennav_docking/src/dock_database.cpp b/nav2_docking/opennav_docking/src/dock_database.cpp index f115014ef96..83ef42cd676 100644 --- a/nav2_docking/opennav_docking/src/dock_database.cpp +++ b/nav2_docking/opennav_docking/src/dock_database.cpp @@ -84,7 +84,7 @@ void DockDatabase::reloadDbCb( { auto node = node_.lock(); DockMap dock_instances; - if (utils::parseDockFile(request->filepath, node_.lock(), dock_instances)) { + if (utils::parseDockFile(request->filepath, node, dock_instances)) { dock_instances_ = dock_instances; response->success = true; RCLCPP_INFO( @@ -92,10 +92,6 @@ void DockDatabase::reloadDbCb( "Dock database reloaded from file %s.", request->filepath.c_str()); return; } - - RCLCPP_ERROR( - node->get_logger(), - "Dock database reload failed from file %s.", request->filepath.c_str()); response->success = false; } @@ -118,17 +114,6 @@ Dock * DockDatabase::findDock(const std::string & dock_id) Dock * DockDatabase::findDockInstance(const std::string & dock_id) { - if (dock_instances_.empty()) { - auto node = node_.lock(); - RCLCPP_WARN( - node->get_logger(), - "Dock database filepath nor dock parameters set. " - "Docking actions can only be executed specifying the dock pose via the action request. " - "Or update the dock database via the reload_database service."); - - return nullptr; - } - auto it = dock_instances_.find(dock_id); if (it != dock_instances_.end()) { return &(it->second);