-
Notifications
You must be signed in to change notification settings - Fork 21
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
Velocity interpolation and small changes #8
Velocity interpolation and small changes #8
Conversation
…ectory If Val3 driver recieves default value from industrial_robot_client (0.1), it replaces it with new value interpolated from previous velocities. May slow down robot at the end of trajectory if incorrect max velocities/accelerations are used in arm URDF file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR 👍 very much appreciated.
Some minor comments and questions, with one or two things I believe should be changed.
Could you take a look at those?
And one additional comment: should velocity interpolation be done at a 'higher level'? Right now it's done in the message decoding functions, which doesn't seem like it would be the right place to do it: it's duplicated in both the traj pt files and it requires a bit of history, which I would expect to be handled at a higher level (of abstraction).
@gonzalocasas and @nilsmelchert: would you perhaps see any chance to test this PR? |
Would it be possible to split this into two PRs, one for the velocity smoothing (which looks good on a quick glance), and a second one for the small changes? EDIT: |
Tbh I'd rather not ask this of @marshallpowell97. He's already had to migrate his commits to this repository, after having worked on Could you perhaps cherry-pick the commits you'd be willing to test? |
Sure, I can do that. |
@marshallpowell97: would you have a chance to take a look at the outstanding comments? @gonzalocasas: have you had a chance to test the velocity/acceleration related changes? re: |
@marshallpowell97: once #9 is merged, could you rebase your PR on top? So we have CI info on this PR as well. |
@gavanderhoorn just to make sure, should I go ahead and split this into 2 PRs? |
I don't believe that would be needed. It won't make it really easier for others to test those changes, and we already have everything in separate commits. |
To clarify: @marshallpowell97: in order to merge this PR we'd need to address some of my outstanding comments/questions (see the review comments). Additionally it would be great if someone from the community (ie: @gonzalocasas or perhaps @nilsmelchert) could test it out. |
If you tell me exactly what you want me to test, I'll be happy to do it. |
I would say any normal trajectory, as you would normally execute. The idea of these changes is that they make regular use of the robots better, due to better processing of trajectories. I'm expecting the changes @marshallpowell97 introduces here together with reducing joint velocity limits to the Nominal ones (#2) to significantly improve the (perceived) quality of trajectory execution. |
@gavanderhoorn I am testing this changes now, and I don't seen a big difference, so either I'm looking at the wrong trajectory, or the effect is rather small. I would agree with @nilsmelchert that a reference trajectory to test on would be of help. |
Thanks for testing. Have you also updated the velocity limits of your model(s) to the Nominal values, instead of the maximum ones? I would expect the biggest differences at the end of the trajectory. |
Nope, I haven't. I'm running them with a minimal load (I haven't weighed it, but it's a very light end-effector that is not picking up anything), and if I understand correctly, that fits right in the definition of what "max" is for according to #2 (comment) |
I tested a bit more, with a larger set of trajectories; and I think I saw the effect at the end of some. Not a very scientific observation thou ;) |
Back on this after being MIA. @gonzalocasas The only difference that you should notice is at the very end of the trajectory. When using the maximum joint velocity limits, there is a "spike" in velocity on the very last point sent. It seems to be that the default velocity for |
Co-Authored-By: G.A. vd. Hoorn <g.a.vanderhoorn@tudelft.nl>
Change from indexing through array (nMsgState) to having individual variables as "constants"
Added `interpolateVel` program, called as a part of `pushMotion`
@marshallpowell97: it'd be really great if we could move the velocity averaging to a more appropriate place, as that is about the only thing keeping this PR from being merged. |
@gavanderhoorn anything else that needs to be fixed before merging? |
Similar to decTrajPt: this code has been moved to interpolateVel and motionControl. Ref: 7a51706.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a few minor fixup commits. @marshallpowell97: if you could verify everything still works (I don't have easy access to SRS here).
Also added a single in-line comment, and I'll open some issues to track remaining issues.
If/when you confirm the VAL 3 application still works @marshallpowell97, we can merge.
Big thanks for the improvements here 👍 your contributions are very much appreciated.
@@ -1,6 +1,6 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project xmlns="http://www.staubli.com/robotics/VAL3/Project/3"> | |||
<Parameters version="s7.7.2" stackSize="5000" millimeterUnit="true" /> | |||
<Parameters version="s7.11" stackSize="5000" millimeterUnit="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this affect compatibility with older OS versions in any way?
Hold on, I may have done this wrong. @gavanderhoorn Did I need to make a new commit or 'review changes' on the previous one? My apologies, still learning Git... |
To fix the identifier length limit problem you needed to commit. With the way the repository is configured right now, this leads to you dismissing the review. That was expected. As this is your own PR, you cannot review it. |
I can confirm that this does still work. |
GH merge button was set to rebase and merge, instead of regular merge. Manually fixed this by force-pushing to |
Thanks for iterating @marshallpowell97 👍 and thanks again for the PR. |
x_mMotion.mDesc.vel = x_mMotion.mDesc.vel / 10000 | ||
// Smooth last point in traj | ||
if((x_mMotion.mDesc.vel == 0.1) and (x_mMotion.nSequence != 0)) | ||
x_mMotion.mDesc.vel = (nVel[0] - (nVel[1] - nVel[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gavanderhoorn @marshallpowell97: Couldn't this end up in a negative velocity if nVel[0] == 0.0
? And if so, what would the controller do? Would it skip the point completely?
I am asking because I see a concrete problem on our setup: after I cherry picked this change to my private fork (*) I started noticing that the very last point of some trajectories is never reached, at all. I am not sure this change causes it, however, it is the main suspect at the moment.
(*disclaimer: my fork is not identical, however, the joint trajectory execution part should be untouched and matching what you have here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically it could become negative.
In practive however, iirc, 0 velocities are not used by the nodes in the IRC. Are you using a custom client as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marshallpowell97: could you comment on what the controller would do in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using a custom client as well?
I am using the industrial robot client (IRC) with the modifications for cartesian trajectories I showed you long ago. In principle, I haven't changed anything on the joint trajectory handling thou, and we've been used this modified IRC client for many months and this behavior only started occurring recently. After going through changes applied to the setup, this stands out as the most likely candidate, however, I cannot 100% rule out something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I'm not claiming the code is faultless. Could you perhaps share a .bag
/wireshark capture of a trajectory which exhibits the problem you're encountering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really a format @marshallpowell97 can directly use.
@gonzalocasas: it would be very much appreciated if you could convert this into something like this. That would make reproduction much easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also suggest to post both a .bag
(with the trajectory topics as well as /joint_states
) and a wireshark capture, so we have both the ROS side and the Simple Message side and can compare.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally: let's open a new issue, as a comment on a already merged PR is not very well suited for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the rosbag file to the gist (https://gist.github.com/gonzalocasas/a52a63b579d8a1d8fc4ad983a319b39d#file-unfinished-trajectory_2020-03-20-14-57-09-bag). The robot is namespaced under /microphone/
. The trajectory is sent directly to the service interface (joint_path_command
) so I guess it does not show up in this bag file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally: let's open a new issue, as a comment on a already merged PR is not very well suited for this.
Agree! Just created a new issue here #16 (I started off as comment, because I am unsure about the source of this, but now it is long enough to be an issue on its own)
Biggest change is using "velocity interpolation" to remove jerk at end of trajectories as described in #2
Small changes such as replacing magic numbers (#7) and check for VAL 3 version (#5)
Some edits to closer reflect official Staubli terminology