Skip to content

Commit

Permalink
driver: log (more) appropriate msgs when topic_list is not found
Browse files Browse the repository at this point in the history
In most cases this is not necessarily a problem, as single-group systems fi are not expected to not have that parameter.

So log an INFO message and continue trying to read the single-group config from the 'controller_joint_names' parameter (if that can't be found, we have a good reason to complain / refuse to continue).

Keep the WARN for one particular case: users starting the multi-group version of the JTA, but then *not* correctly setting the 'topic_list' parameter should be warned.

Thanks to @cjue who proposed the initial fix (in #483), which I've slightly expanded upon here.
  • Loading branch information
gavanderhoorn committed Mar 25, 2022
1 parent b4f0459 commit 02afc3e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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 @@ -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 02afc3e

Please sign in to comment.