From 4b173e7e549b3fc1e1d1e97544727f7648c6dc6e Mon Sep 17 00:00:00 2001 From: Sebastian Jahr Date: Mon, 26 Aug 2024 14:00:52 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Robert Haschke --- .../src/bullet_integration/contact_checker_common.cpp | 2 +- moveit_core/robot_model/src/robot_model.cpp | 2 +- moveit_core/robot_state/src/robot_state.cpp | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/moveit_core/collision_detection_bullet/src/bullet_integration/contact_checker_common.cpp b/moveit_core/collision_detection_bullet/src/bullet_integration/contact_checker_common.cpp index 3d99b7187c..0a505458bd 100644 --- a/moveit_core/collision_detection_bullet/src/bullet_integration/contact_checker_common.cpp +++ b/moveit_core/collision_detection_bullet/src/bullet_integration/contact_checker_common.cpp @@ -116,7 +116,7 @@ collision_detection::Contact* processResult(ContactTestData& cdata, collision_de return &(dr.back()); } - RCLCPP_ERROR(getLogger(), "Result cannot be processed. Returning nullptr, this should never happen!"); + RCLCPP_DEBUG(getLogger(), "Result cannot be processed. Returning nullptr, this should never happen!"); return nullptr; } diff --git a/moveit_core/robot_model/src/robot_model.cpp b/moveit_core/robot_model/src/robot_model.cpp index 4c7651cf87..04c244204e 100644 --- a/moveit_core/robot_model/src/robot_model.cpp +++ b/moveit_core/robot_model/src/robot_model.cpp @@ -1368,7 +1368,7 @@ const LinkModel* RobotModel::getRigidlyConnectedParentLinkModel(const LinkModel* { if (!link) { - RCLCPP_ERROR(getLogger(), "Cannot determine rigidly connected parent link because input link is nullptr"); + RCLCPP_DEBUG(getLogger().get_child("getRigidlyConnectedParentLink", "Link is NULL"); return link; } const moveit::core::LinkModel* parent_link = link->getParentLinkModel(); diff --git a/moveit_core/robot_state/src/robot_state.cpp b/moveit_core/robot_state/src/robot_state.cpp index 7d0fdb7ace..f52d6c71a8 100644 --- a/moveit_core/robot_state/src/robot_state.cpp +++ b/moveit_core/robot_state/src/robot_state.cpp @@ -926,18 +926,15 @@ const LinkModel* RobotState::getRigidlyConnectedParentLinkModel(const std::strin std::string object{ frame.substr(0, idx) }; if (!hasAttachedBody(object)) { - RCLCPP_DEBUG(getLogger(), - "Cannot find rigidly connected parent link for frame '%s' because there is no attached body.", - frame.c_str()); + RCLCPP_DEBUG(getLogger().get_child("getRigidlyConnectedParentLink", + "Attached object '%s' for frame '%s' does not exist.", object.c_str(), frame.c_str()); return nullptr; } auto body{ getAttachedBody(object) }; if (!body->hasSubframeTransform(frame)) { - RCLCPP_DEBUG(getLogger(), - "Cannot find rigidly connected parent link for frame '%s' because the transformation to the parent " - "link is unknown.", - frame.c_str()); + RCLCPP_DEBUG(getLogger().get_child("getRigidlyConnectedParentLink", + "Body '%s' does not have subframe '%s', object.c_str(), frame.c_str()); return nullptr; } link = body->getAttachedLink();