Skip to content

Commit

Permalink
Merge pull request #485 from gavanderhoorn/improve_warn_no_topic_list
Browse files Browse the repository at this point in the history
Improve WARN and INFO msgs when topic_list parameter isn't found
  • Loading branch information
gavanderhoorn authored Mar 27, 2022
2 parents 46b1d92 + 02afc3e commit 4c5e6af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@ JointTrajectoryAction::JointTrajectoryAction() :
pn.param("constraints/goal_threshold", goal_threshold_, DEFAULT_GOAL_THRESHOLD_);

std::map<int, RobotGroup> robot_groups;
getJointGroups("topic_list", robot_groups);
if (!getJointGroups("topic_list", robot_groups))
{
// this is a WARN as this class is the multi-group version of the regular JTA,
// and we're actually expecting to find the 'topic_list' parameter, as using
// this multi-group version with a single-group system is unnecessary and also
// doesn't make much sense.
// It probably also won't work.
ROS_WARN("Expecting/assuming single motion-group controller configuration");
}

for (size_t i = 0; i < robot_groups.size(); i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ bool JointTrajectoryInterface::init(SmplMsgConnection* connection)
}
else
{
ROS_INFO("Expecting/assuming single motion-group controller configuration");
this->version_0_ = true;
std::vector<std::string> joint_names;
if (!getJointNames("controller_joint_names", "robot_description", joint_names))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ bool getJointGroups(const std::string topic_param, std::map<int, RobotGroup> & r
}
else
{
ROS_ERROR_STREAM("Failed to find " << topic_param << " parameter");
ROS_INFO_STREAM("Failed to find '" << topic_param << "' parameter");
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ bool RobotStateInterface::init(SmplMsgConnection* connection)
}
else
{
ROS_INFO("Expecting/assuming single motion-group controller configuration");
this->version_0_ = true;
std::vector<std::string> joint_names;
if (!getJointNames("controller_joint_names", "robot_description", joint_names))
Expand Down

0 comments on commit 4c5e6af

Please sign in to comment.