1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-10 18:10:47 +02:00

Extend error messages

Extends error message to print invalid joint names.
Adds max_velocity as parameter descriptor in error message.
This commit is contained in:
Henning Kayser
2017-07-21 17:34:58 +02:00
parent 54a852305c
commit 63691e038e

View File

@@ -145,7 +145,11 @@ bool ActionServer::validateJoints(GoalHandle& gh, Result& res)
return true; return true;
res.error_code = Result::INVALID_JOINTS; res.error_code = Result::INVALID_JOINTS;
res.error_string = "Invalid joint names for goal"; res.error_string = "Invalid joint names for goal\n";
res.error_string += "Expected: ";
std::for_each(goal_joints.begin(), goal_joints.end(), [&res](std::string joint){res.error_string += joint + ", ";});
res.error_string += "\nFound: ";
std::for_each(joint_set_.begin(), joint_set_.end(), [&res](std::string joint){res.error_string += joint + ", ";});
return false; return false;
} }
@@ -183,7 +187,7 @@ bool ActionServer::validateTrajectory(GoalHandle& gh, Result& res)
} }
if (std::fabs(velocity) > max_velocity_) if (std::fabs(velocity) > max_velocity_)
{ {
res.error_string = "Received a goal with velocities that are higher than " + std::to_string(max_velocity_); res.error_string = "Received a goal with velocities that are higher than max_velocity_ " + std::to_string(max_velocity_);
return false; return false;
} }
} }
@@ -338,4 +342,4 @@ void ActionServer::trajectoryThread()
has_goal_ = false; has_goal_ = false;
lk.unlock(); lk.unlock();
} }
} }