From f99baecf6c34053cb569ecf94ed529616e7a38b2 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Fri, 17 Sep 2021 16:49:39 +0100 Subject: [PATCH] Address PR comments Signed-off-by: Mauro Passerino --- .../rclcpp/detail/add_guard_condition_to_rcl_wait_set.hpp | 1 - rclcpp/src/rclcpp/node_interfaces/node_base.cpp | 2 +- rclcpp/src/rclcpp/node_interfaces/node_graph.cpp | 2 +- rclcpp/src/rclcpp/node_interfaces/node_services.cpp | 4 ++-- rclcpp/src/rclcpp/node_interfaces/node_timers.cpp | 2 +- rclcpp/src/rclcpp/node_interfaces/node_topics.cpp | 4 ++-- rclcpp/src/rclcpp/node_interfaces/node_waitables.cpp | 2 +- rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp | 2 +- rclcpp/test/rclcpp/node_interfaces/test_node_services.cpp | 4 ++-- rclcpp/test/rclcpp/node_interfaces/test_node_timers.cpp | 2 +- rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp | 4 ++-- rclcpp/test/rclcpp/node_interfaces/test_node_waitables.cpp | 2 +- 12 files changed, 15 insertions(+), 16 deletions(-) diff --git a/rclcpp/include/rclcpp/detail/add_guard_condition_to_rcl_wait_set.hpp b/rclcpp/include/rclcpp/detail/add_guard_condition_to_rcl_wait_set.hpp index 3f9c426f85..5f1a7e0df8 100644 --- a/rclcpp/include/rclcpp/detail/add_guard_condition_to_rcl_wait_set.hpp +++ b/rclcpp/include/rclcpp/detail/add_guard_condition_to_rcl_wait_set.hpp @@ -24,7 +24,6 @@ namespace detail /// Adds the guard condition to a waitset /** - * This function is thread-safe. * \param[in] wait_set reference to a wait set where to add the guard condition * \param[in] guard_condition reference to the guard_condition to be added */ diff --git a/rclcpp/src/rclcpp/node_interfaces/node_base.cpp b/rclcpp/src/rclcpp/node_interfaces/node_base.cpp index dd5248f671..c4727b7e1a 100644 --- a/rclcpp/src/rclcpp/node_interfaces/node_base.cpp +++ b/rclcpp/src/rclcpp/node_interfaces/node_base.cpp @@ -247,7 +247,7 @@ NodeBase::get_notify_guard_condition() { std::lock_guard notify_condition_lock(notify_guard_condition_mutex_); if (!notify_guard_condition_is_valid_) { - throw std::runtime_error("Trying to get invalid notify guard condition"); + throw std::runtime_error("failed to get notify guard condition because it is invalid"); } return notify_guard_condition_; } diff --git a/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp b/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp index e2a3010746..8c8c33ae1c 100644 --- a/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp +++ b/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp @@ -353,7 +353,7 @@ NodeGraph::notify_graph_change() node_gc.trigger(); } catch (const rclcpp::exceptions::RCLError & ex) { throw std::runtime_error( - std::string("Failed to notify wait set on graph change: ") + ex.what()); + std::string("failed to notify wait set on graph change: ") + ex.what()); } } diff --git a/rclcpp/src/rclcpp/node_interfaces/node_services.cpp b/rclcpp/src/rclcpp/node_interfaces/node_services.cpp index c28196dda7..14ab1c82c4 100644 --- a/rclcpp/src/rclcpp/node_interfaces/node_services.cpp +++ b/rclcpp/src/rclcpp/node_interfaces/node_services.cpp @@ -46,7 +46,7 @@ NodeServices::add_service( node_gc.trigger(); } catch (const rclcpp::exceptions::RCLError & ex) { throw std::runtime_error( - std::string("Failed to notify wait set on service creation: ") + ex.what()); + std::string("failed to notify wait set on service creation: ") + ex.what()); } } @@ -71,7 +71,7 @@ NodeServices::add_client( node_gc.trigger(); } catch (const rclcpp::exceptions::RCLError & ex) { throw std::runtime_error( - std::string("Failed to notify wait set on client creation: ") + ex.what()); + std::string("failed to notify wait set on client creation: ") + ex.what()); } } diff --git a/rclcpp/src/rclcpp/node_interfaces/node_timers.cpp b/rclcpp/src/rclcpp/node_interfaces/node_timers.cpp index a68dc40e36..b463e8a0e7 100644 --- a/rclcpp/src/rclcpp/node_interfaces/node_timers.cpp +++ b/rclcpp/src/rclcpp/node_interfaces/node_timers.cpp @@ -47,7 +47,7 @@ NodeTimers::add_timer( node_gc.trigger(); } catch (const rclcpp::exceptions::RCLError & ex) { throw std::runtime_error( - std::string("Failed to notify wait set on timer creation: ") + ex.what()); + std::string("failed to notify wait set on timer creation: ") + ex.what()); } TRACEPOINT( diff --git a/rclcpp/src/rclcpp/node_interfaces/node_topics.cpp b/rclcpp/src/rclcpp/node_interfaces/node_topics.cpp index 87139b6811..fa188a2f9a 100644 --- a/rclcpp/src/rclcpp/node_interfaces/node_topics.cpp +++ b/rclcpp/src/rclcpp/node_interfaces/node_topics.cpp @@ -65,7 +65,7 @@ NodeTopics::add_publisher( node_gc.trigger(); } catch (const rclcpp::exceptions::RCLError & ex) { throw std::runtime_error( - std::string("Failed to notify wait set on publisher creation: ") + ex.what()); + std::string("failed to notify wait set on publisher creation: ") + ex.what()); } } @@ -112,7 +112,7 @@ NodeTopics::add_subscription( node_gc.trigger(); } catch (const rclcpp::exceptions::RCLError & ex) { throw std::runtime_error( - std::string("Failed to notify wait set on subscription creation: ") + ex.what()); + std::string("failed to notify wait set on subscription creation: ") + ex.what()); } } diff --git a/rclcpp/src/rclcpp/node_interfaces/node_waitables.cpp b/rclcpp/src/rclcpp/node_interfaces/node_waitables.cpp index 6aa75e735f..6f243f6025 100644 --- a/rclcpp/src/rclcpp/node_interfaces/node_waitables.cpp +++ b/rclcpp/src/rclcpp/node_interfaces/node_waitables.cpp @@ -46,7 +46,7 @@ NodeWaitables::add_waitable( node_gc.trigger(); } catch (const rclcpp::exceptions::RCLError & ex) { throw std::runtime_error( - std::string("Failed to notify wait set on waitable creation: ") + ex.what()); + std::string("failed to notify wait set on waitable creation: ") + ex.what()); } } diff --git a/rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp b/rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp index 7b4bcc624a..81e485a886 100644 --- a/rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp +++ b/rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp @@ -328,7 +328,7 @@ TEST_F(TestNodeGraph, notify_graph_change_rcl_error) "lib:rclcpp", rcl_trigger_guard_condition, RCL_RET_ERROR); RCLCPP_EXPECT_THROW_EQ( node()->get_node_graph_interface()->notify_graph_change(), - std::runtime_error("Failed to notify wait set on graph change: error not set")); + std::runtime_error("failed to notify wait set on graph change: error not set")); } TEST_F(TestNodeGraph, get_info_by_topic) diff --git a/rclcpp/test/rclcpp/node_interfaces/test_node_services.cpp b/rclcpp/test/rclcpp/node_interfaces/test_node_services.cpp index a7607f5d76..ea55a1aac2 100644 --- a/rclcpp/test/rclcpp/node_interfaces/test_node_services.cpp +++ b/rclcpp/test/rclcpp/node_interfaces/test_node_services.cpp @@ -103,7 +103,7 @@ TEST_F(TestNodeService, add_service_rcl_trigger_guard_condition_error) "lib:rclcpp", rcl_trigger_guard_condition, RCL_RET_ERROR); RCLCPP_EXPECT_THROW_EQ( node_services->add_service(service, callback_group), - std::runtime_error("Failed to notify wait set on service creation: error not set")); + std::runtime_error("failed to notify wait set on service creation: error not set")); } TEST_F(TestNodeService, add_client) @@ -130,7 +130,7 @@ TEST_F(TestNodeService, add_client_rcl_trigger_guard_condition_error) "lib:rclcpp", rcl_trigger_guard_condition, RCL_RET_ERROR); RCLCPP_EXPECT_THROW_EQ( node_services->add_client(client, callback_group), - std::runtime_error("Failed to notify wait set on client creation: error not set")); + std::runtime_error("failed to notify wait set on client creation: error not set")); } TEST_F(TestNodeService, resolve_service_name) diff --git a/rclcpp/test/rclcpp/node_interfaces/test_node_timers.cpp b/rclcpp/test/rclcpp/node_interfaces/test_node_timers.cpp index d368e0e875..d038a4b44d 100644 --- a/rclcpp/test/rclcpp/node_interfaces/test_node_timers.cpp +++ b/rclcpp/test/rclcpp/node_interfaces/test_node_timers.cpp @@ -87,5 +87,5 @@ TEST_F(TestNodeTimers, add_timer_rcl_trigger_guard_condition_error) "lib:rclcpp", rcl_trigger_guard_condition, RCL_RET_ERROR); RCLCPP_EXPECT_THROW_EQ( node_timers->add_timer(timer, callback_group), - std::runtime_error("Failed to notify wait set on timer creation: error not set")); + std::runtime_error("failed to notify wait set on timer creation: error not set")); } diff --git a/rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp b/rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp index e727827f18..a99633bec6 100644 --- a/rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp +++ b/rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp @@ -129,7 +129,7 @@ TEST_F(TestNodeTopics, add_publisher_rcl_trigger_guard_condition_error) "lib:rclcpp", rcl_trigger_guard_condition, RCL_RET_ERROR); RCLCPP_EXPECT_THROW_EQ( node_topics->add_publisher(publisher, callback_group), - std::runtime_error("Failed to notify wait set on publisher creation: error not set")); + std::runtime_error("failed to notify wait set on publisher creation: error not set")); } TEST_F(TestNodeTopics, add_subscription) @@ -157,7 +157,7 @@ TEST_F(TestNodeTopics, add_subscription_rcl_trigger_guard_condition_error) "lib:rclcpp", rcl_trigger_guard_condition, RCL_RET_ERROR); RCLCPP_EXPECT_THROW_EQ( node_topics->add_subscription(subscription, callback_group), - std::runtime_error("Failed to notify wait set on subscription creation: error not set")); + std::runtime_error("failed to notify wait set on subscription creation: error not set")); } TEST_F(TestNodeTopics, resolve_topic_name) diff --git a/rclcpp/test/rclcpp/node_interfaces/test_node_waitables.cpp b/rclcpp/test/rclcpp/node_interfaces/test_node_waitables.cpp index 0043536786..a1f35c0cdc 100644 --- a/rclcpp/test/rclcpp/node_interfaces/test_node_waitables.cpp +++ b/rclcpp/test/rclcpp/node_interfaces/test_node_waitables.cpp @@ -96,5 +96,5 @@ TEST_F(TestNodeWaitables, add_waitable_rcl_trigger_guard_condition_error) "lib:rclcpp", rcl_trigger_guard_condition, RCL_RET_ERROR); RCLCPP_EXPECT_THROW_EQ( node_waitables->add_waitable(waitable, callback_group), - std::runtime_error("Failed to notify wait set on waitable creation: error not set")); + std::runtime_error("failed to notify wait set on waitable creation: error not set")); }