Skip to content

Commit

Permalink
Add debugging log statement for a common error (#2509)
Browse files Browse the repository at this point in the history
add debugging informative log statement for a common error

Co-authored-by: Peter Mitrano <pmitrano@armstorm>
  • Loading branch information
2 people authored and tylerjw committed May 3, 2021
1 parent 8cd6d7b commit e3beb96
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1612,8 +1612,14 @@ bool moveit::planning_interface::MoveGroupInterface::setNamedTarget(const std::s

bool moveit::planning_interface::MoveGroupInterface::setJointValueTarget(const std::vector<double>& joint_values)
{
if (joint_values.size() != impl_->getJointModelGroup()->getVariableCount())
auto const n_group_joints = impl_->getJointModelGroup()->getVariableCount();
if (joint_values.size() != n_group_joints)
{
ROS_DEBUG_STREAM_NAMED(LOGNAME, "Provided joint value list has length " << joint_values.size() << " but group "
<< impl_->getJointModelGroup()->getName()
<< " has " << n_group_joints << " joints");
return false;
}
impl_->setTargetType(JOINT);
impl_->getJointStateTarget().setJointGroupPositions(impl_->getJointModelGroup(), joint_values);
return impl_->getJointStateTarget().satisfiesBounds(impl_->getJointModelGroup(), impl_->getGoalJointTolerance());
Expand Down

0 comments on commit e3beb96

Please sign in to comment.