Skip to content

Commit a151491

Browse files
rhaschkemergify[bot]
authored andcommitted
Fix RobotState::getRigidlyConnectedParentLinkModel() (#2985)
Simplify function using getFrameInfo() to yield the link corresponding to the given frame. The order of frame resolution was wrong here: If a link frame containing a slash was given, the code was expecting an attached body with a subframe. As these didn't exist, the function falsely returned NULL. (cherry picked from commit 1f23344) # Conflicts: # moveit_core/robot_state/src/robot_state.cpp
1 parent c9079e9 commit a151491

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

moveit_core/robot_state/src/robot_state.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ void RobotState::updateStateWithLinkAt(const LinkModel* link, const Eigen::Isome
801801

802802
const LinkModel* RobotState::getRigidlyConnectedParentLinkModel(const std::string& frame) const
803803
{
804+
<<<<<<< HEAD
804805
const moveit::core::LinkModel* link{ nullptr };
805806

806807
size_t idx = 0;
@@ -821,6 +822,13 @@ const LinkModel* RobotState::getRigidlyConnectedParentLinkModel(const std::strin
821822
else if (getRobotModel()->hasLinkModel(frame))
822823
link = getLinkModel(frame);
823824

825+
=======
826+
bool found;
827+
const LinkModel* link{ nullptr };
828+
getFrameInfo(frame, link, found);
829+
if (!found)
830+
RCLCPP_ERROR(getLogger(), "Unable to find link for frame '%s'", frame.c_str());
831+
>>>>>>> 1f23344de (Fix RobotState::getRigidlyConnectedParentLinkModel() (#2985))
824832
return getRobotModel()->getRigidlyConnectedParentLinkModel(link);
825833
}
826834

0 commit comments

Comments
 (0)