Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

motoman_driver accepting joint_states that are not from the robot arm controller #326

Open
MarqRazz opened this issue May 8, 2020 · 4 comments · May be fixed by #506
Open

motoman_driver accepting joint_states that are not from the robot arm controller #326

MarqRazz opened this issue May 8, 2020 · 4 comments · May be fixed by #506
Labels
more-info-needed Waiting on additional information from poster

Comments

@MarqRazz
Copy link

MarqRazz commented May 8, 2020

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.

@gavanderhoorn
Copy link
Member

So I believe the reason this is not such an issue (or at least not in the systems I use this driver with) is that I typically remap joint_states to more narrow topics. That way the driver only sees the JointStates it's supposed to.

This connects to a larger design discussion about whether consumers should be capable of dealing with "any" incoming message (of the same type) and be responsible for picking out the parts they are interested in, or whether by configuration (by an external entity) they should be able to rely on receiving only messages meant for them specifically.

See gavanderhoorn#1 (comment) for an earlier discussion I've had about this.

gavanderhoorn@e369ddc would be a fix for what you describe I believe.

I'm still not happy with having to do that here in this driver, but it does help make things more robust, so a PR with that change ported to current kinetic-devel would be something we can merge.

@gavanderhoorn
Copy link
Member

@MarqRazz: would you have any updates?

There appears to be quite some activity in your fork, is any of that related to this issue?

@gavanderhoorn gavanderhoorn added the more-info-needed Waiting on additional information from poster label Oct 5, 2020
@MarqRazz
Copy link
Author

MarqRazz commented Oct 9, 2020

@gavanderhoorn I have been adding new robots to my repo (I am planning on making PR's for each bot after everything is working and verified). When I run on hardware I add this fix...
image

So this is still an issue for me but I am assuming that we can get this change permanently added to the repo, I just haven't had time to make a PR.

@simonschmeisser
Copy link
Contributor

We just had the same issue and I feel dump for not reading this here ...

cjue added a commit to isys-vision/motoman that referenced this issue Jun 10, 2022
cjue added a commit to isys-vision/motoman that referenced this issue Jun 10, 2022
cjue added a commit to isys-vision/motoman that referenced this issue Aug 29, 2022
cjue added a commit to isys-vision/motoman that referenced this issue Mar 22, 2023
cjue added a commit to isys-vision/motoman that referenced this issue Mar 29, 2023
cjue added a commit to isys-vision/motoman that referenced this issue Aug 15, 2023
cjue added a commit to isys-vision/motoman that referenced this issue Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-needed Waiting on additional information from poster
Development

Successfully merging a pull request may close this issue.

3 participants