Description
On my robot I have a gripper that is publishing its joint_states on the topic /my_gripper/joint_states and this information is relayed down the the /joint_states topic. I have recently found that I am randomly receiving errors from the industrial_robot_client stating:
isWithinRange::Key vectors are not similar
and my trajectory being rejected.
I did some digging and found that in joint_trajectory_interface.cpp in the jointStateCB the software blindly accepts the incoming message on the /joint_states topic as the robots cur_joint_pos_
. I added a simple check if(this->all_joint_names_.size() != msg->position.size())
then just return from the callback without updating the robots cur_joint_pos_
and it fixed my errors.
I am happy to put in a pull request with a fix for this error but wanted to get your guy's feedback on how you would like to ensure the received JointState message is for the robot arm we are connected to.
Should we check to make sure that all of the names in the all_joint_names_
variable are included in the msg->name
list? Should we check to make sure that the JointState message includes some minimum level of information (i.e. the name, position and velocity vectors all have the same length)? Anything else you would like it to check?
Another option would be to launch the node in a namespace and we would get /motoman/joint_states but users would be required to relay that topic down to /joint_states for the PlanningSceneMonitor and RobotStatePublisher.