Skip to content

Commit

Permalink
downgrade undeserved error log for empty JointState.position
Browse files Browse the repository at this point in the history
as per the JointState message doc, the ``position`` member must be
either empty OR have the same size as the ``name`` member.

In case it is empty, the message is valid, but will still warn
we won't use it.
  • Loading branch information
sbarthelemy authored and Sébastien Barthélémy committed Oct 18, 2016
1 parent 07fb946 commit b213fbd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/joint_state_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ void JointStateListener::callbackFixedJoint(const ros::TimerEvent& e)
void JointStateListener::callbackJointState(const JointStateConstPtr& state)
{
if (state->name.size() != state->position.size()){
ROS_ERROR("Robot state publisher received an invalid joint state vector");
if (state->position.empty()){
ROS_WARN_THROTTLE(300, "Robot state publisher ignored a JointState message whose position member was empty");
} else {
ROS_ERROR("Robot state publisher ignored an invalid JointState message");
}
return;
}

Expand Down

0 comments on commit b213fbd

Please sign in to comment.