-
Notifications
You must be signed in to change notification settings - Fork 195
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
driver: persistent (and incorrect) "Trajectory start position doesn't match current robot position" #111
Comments
tl;dr: ROS side of driver (incorrectly) assumes order of joint data in incoming goals is identical to what it is configured for / the joint order motoros expects, leading to all trajectories being refused because It would appear the code in at least JointTrajectoryAction::goalCB(JointTractoryActionServer::GoalHandle gh) makes an assumption about the ordering of joint names in a The current implementation essentially does this in the following way:
I've emphasised the problematic parts. This is a dangerous assumption to make in any case, and for instance MoveIt appears to happily re-order joints when submitting goals, making looking for the 'first joint' completely pointless (as there is no guarantee that the order of joint target values in the goal now corresponds to anything on the robot side). A correct(er?) approach would seem to be to perform the mapping for each joint individually, every time a goal is received. That would mean As the order of the joint targets in the |
This was reported by @jettan, @mbharatheesha and @de-vri-es. |
I'm not sure, but I think the above described assumption (about joint name ordering) is (at least partly) why the joints and links in fi the |
@thiagodefreitas: any input? |
I think this is a serious bug, and am considering adding a warning / notice to the wiki page telling prospective users about it. Thoughts @shaun-edwards ? |
Just thought I'd add this: this exact issue seems to also have been reported by @thiagodefreitas in #42 (comment):
That would seem to suggest the assumption about |
hi @gavanderhoorn , I believe I am experiencing this issue using a Yaskawa GP8 and YRC1000 micro controller w/ MoveIt. "A correct(er?) approach would seem to be to perform the mapping for each joint individually, every time a goal is received. That would mean std::find(..)ing N joints again and again, but there is no requirement for Action clients to maintain the same order of joints as those the server is configured with. It would appear the mapping can also not be cached (at least not be re-used for future incoming goals), as clients could potentially randomise the order in which they specify the joint data every submitted goal." |
@tanimfresh: first thing to make sure is you get this error from the driver and not from MoveIt itself. MoveIt has added a similar check. I would suggest to check the origin of the error first, before thinking about changing the driver' source. If you add this line to your export ROSCONSOLE_FORMAT='[${severity}] [${time}] [${node}] [${logger}]: ${message}' |
Hi @gavanderhoorn, I believe after adding this logging that the error is indeed coming from the driver:
In this case, is the only solution at the moment the method you proposed of changing the driver source? |
No. The right thing to do would be to diagnose what causes the error to be printed. There's no point in haphazardly starting to edit files without knowing the cause. First thing to check: are you using motoman_gp8_support/urdf/gp8_macro.xacro as URDF, or something you created yourself? If you're using something you created yourself, you'll want to compare with motoman_gp8_support/urdf/gp8_macro.xacro, specifically how the joint names are defined. You'll also want to make sure you use the same joint names in your MoveIt configuration, and make sure to use the correct joint names there as well. For single group setups with a known-good robot model, the error reported in the OP here should not occur, provided the work-around (including a nr in the joint names) is used. That's the reason I'd like to understand why you are running into this. Besides checking which
No, that's not going to help. And please be aware of #219 and #252. |
Hi @gavanderhoorn , I am indeed using a different urdf generated by MoveIt. I compared it with the typical gp8_macro.xacro and it looks like the MoveIt setup assistant just appends additional information to this URDF; the joint names are identical. I have included an example of a JointState message below:
Can you please elaborate this workaround? I did not catch this explanation. |
This confuses me: MoveIt does not generate any urdfs. You'll have to clarify. And taking a step back, please:
|
Sure thing. I am referring to the following section of the MoveIt setup assistant: HW: ROS: Support package: Goal:
Start process: |
I would advise you to never use that functionality of the MSA. Due to the fact I have experience with the manual method, I may be biased, but it's not a very nice implementation and unless you are using Gazebo, there is no need to do any of that in the first place.
That repository does not actually contain a urdf for the GP8. It uses the GP8 model from Please clarify whether you have made any local changes to these packages.
Due to the very tight threshold, I'm not confident this will work, but you can certainly try.
That should not happen, unless you are using the multi-group code-path and the joint names don't use the "numbers trick". If you use the RViz MoveIt plugin to plan and execute motions, does it still complain? I'll try to take a look with the robot we have here tomorrow, but in the meantime a Wireshark capture of the SimpleMessage traffic between the ROS PC and the YRC1000 when MotoROS returns the error would be good to have.
I still don't understand how adding infinite trajectory mode would help with incorrect joint orders (which is what this issue is about) or start state deviation. And tracking would be possible with #215, but again please be aware of what is written in #219 and #252. |
Hm. I will heed that advice moving forward. We will eventually need to implement this GP8 as part of a combined system that operates primarily in Gazebo, however, so hopefully this part is ok. -My mistake, I should have mentioned I also have the motoman package you listed. -I believe the plan stitching method I have implemented works (theoretically), as it works in simulation consistently and works intermittently on hardware. I.e I do not have any issues in RViz in either implementation (pre-plan and execute all plans, or plan/execute/plan/execute). -I ran the standard implementation (plan/execute) again to check, and I do indeed see the error: -It seems that if I put a rospy.sleep() between executions, it helps more often. I still cannot reliably run executions, but if I put a large sleep betweeen execute commands it will finish the poses more often than with a non-existent or small (0.1sec) sleep. -I will work on getting a wireshark capture ready. -I think I was taking to heart too much the note on the first post of #217 where the user mentioned that PR 215 was a 'known solution' and you mentioned it was just another implementation. Thinking about it longer I realize that you are right, I'm also not sure why it would help. I am aware of the latency introduced by the MotoPlus filtering and aware that it is unavoidable. As this is the closest implementation of closed loop control I have found, I am hoping to see what type of results it will yield in our end application. Anywho, this topic is unrelated to the post at hand, so I will refrain from mentioning it as an option any further. |
For future comments: could you please avoid posting screenshots of code or terminals? It's all text. Just copy-paste it into the comment and use proper code highlighting.
As I wrote: I know how to do it manually, and this makes me say I would never use the output of the MSA. If only for the reason it flattens a Furthermore: adding Gazebo compatibility is trivial. I don't need the MSA for that. But if it works for you then by all means use it.
Results in simulation or RViz kinematic playout do not say anything about whether this will work on real hw and with the real driver. Neither RViz nor simulation uses the driver, so it cannot run into this issue.
I was more interested in whether the MoveIt RViz plugin works. It's a known-good interface to both MoveIt (and eventually the driver), which your script/code isn't. So drag the marker, press Plan, check the motion and press Execute. Wait for completion, try to plan and execute another motion. Please try and report.
This sounds like what was reported earlier by users trying to plan / execute back-to-back: you have to make sure the robot has finished executing the previous motion. Check the
The OP in #217 writes that #215 "is a known solution to this problem". I don't (and didn't) agree with him. What he is implying there is that because of the infinite trajectory, you only run the risk of seeing this error "once" (ie: at the start of the streaming session). But what he forgets is that you cannot send regular trajectories to the driver any more without stopping the streaming. And at that point you'd be back to where you started. Unless you implement another node which executes trajectories by sending points to the streaming topic (but at this point you're essentially reimplementing the driver). If you could make sure The wireshark capture would also help. |
Also: if you could share your own versions of the packages you linked to that would help. Right now I don't have a clear picture of what you changed or where. That makes it difficult to help you. |
-I don't have the interactive markers, which I was hoping was a separate issue... but I am able to plan and execute random poses through RViz just fine.
I have also attached the Wireshark capture, please let me know if this is not the format that is helpful. I am trying to look into how to translate the data of the packets. On a similar note, is there a preferred method of sharing my packages over compressing and attaching the folder containing them? |
I should mention I'm not able to share a github repo of my code because it is on our work repo, which I am not able to publicly post. |
This comment makes me believe there is actually not a problem with the driver (other than the ones we already know about), but with your particular setup. That doesn't mean it's not a problem, but it does change the scope of your support request. Please open a new issue clearly describing what is going on, and refer to this one. My first suggestion would be to go back to basics and use the bare Let's not post more comments here as it starts to look like it seems your issue is only tangentially connected to this one.
well this will make it (very) difficult for me to figure out what is going on. At the very least, an MWE would be needed. |
I've just checked your wireshark capture but it does not seem to contain a message exchange for a failed attempt at trajectory execution. Is this the correct capture @tanimfresh? |
Hello, I took some time to start a fresh work space and restart the process. This time I was not getting the OP error, so I am inclined to believe I must have made an incorrect edit along the way in my original workspace. I'm not able to pinpoint one specific change that caused the error for me, as despite trying to edit my initial setup piece by piece to replicate my fresh workspace I have not been able to remove the error from my initial setup. One interesting point I noticed is that I did start seeing the same error in the new workspace when I tried to scale my motion plans to a set duration (by scaling the velocity, acc, and time_from_start of the planned trajectory). I saw a new error mentioning trajectory splicing was not implemented yet. After seeing this error, the OP error would appear more frequently on subsequent launch/execution of the system. Only after I rebooted the controller did the error stop appearing, and after adding the "inMotion" check I no longer see the trajectory splicing or OP error. Again, I tried to take these lessons to my initial workspace with no luck. Thank you for all of your efforts and assistance. |
this suggests your code submitted new trajectory goals before the previous one had finished executing. But good to hear you got things to work in the end. And finally: the fact you got it to work does not mean the issue described in the OP (and subsequent comments here) is fixed. It just means there are known work-arounds available. |
Yes, after adding the inmotion check back I was good to go. I agree, not solved, but a good troubleshooting step for those who may be reading this. |
We had the same issue on a Motoman MH50 with a DX100 controller. It seems that the tolerance value |
observed behaviour: when trying to execute a trajectory through the
motoman_driver
providedjoint_trajectory_action
node, the motoros application persistently returns aMotionReplySubcodes::Invalid::DATA_START_POS
error, even iftarget_pos == current_pos
for all joints. Analysis of the simple message traffic between motoros and the ROS PC confirmed the receipt of theDATA_START_POS
error message.Starting the servos before commanding a motion does not help (to avoid running into issues with
START_MAX_PULSE_DEVIATION
and gravity).The work-around for #91 also does not influence this.
expected: execution of the trajectory
The text was updated successfully, but these errors were encountered: