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

fix minjerk interpolation sometimes returns large acceleration #596

Merged
merged 7 commits into from
Nov 24, 2021

Conversation

k-okada
Copy link
Member

@k-okada k-okada commented Jan 21, 2021

closes jsk-ros-pkg/jsk_pr2eus#457

  1. you need to set velocity and acceleration to run interpolation, specially if your input data is something like #f(0) #f(1) #f(2) #f(3), if your data is #f(0) #f(1) #f(0) #f(1), veocity of all sample point is #f(0), so default velocity/acceleration data works.

↓ without velocity and acceleration data
Screenshot from 2021-01-21 23-37-38

↓ with velocity and acceleration data
Screenshot from 2021-01-21 23-43-05

  1. fixed the case when your time-list is not algined with dt,

(draw-grph 0.001), (draw-grph 0.0013), (draw-grph 0.005) of
https://gist.github.com/k-okada/c575606258a822971e3dc6dbe3eb337e is as follows.

Screenshot from 2021-01-21 23-49-57
Screenshot from 2021-01-21 23-50-25
Screenshot from 2021-01-21 23-50-55

note: @708yamaguchi

  • I think it is better to use [deg] and [msesc], to avoid the precision problem
  • the graph still have large acceleration, and I'm not confident with this result, please check with your robot
  • I suppose you create angle-vector-sequence with MoveIt! and then use minjerk interpolator to create the data, but did you try create interpolated data from normal euslisp style input like (send *ri* :angle-vector (send *robot* :reset-pose))?. I think we should test this case as a first try, because it is a much simpler case.

c.f. https://github.com/jsk-ros-pkg/jsk_pr2eus/blob/a228cc7d3bb5b26b92ed25c7d55f32a64d9d7825/pr2eus/robot-interface.l#L567-L576, RethinkRobotics/baxter_interface#72

@k-okada
Copy link
Member Author

k-okada commented Jan 22, 2021

@708yamaguchi, please compare (draw-graph 0.0005) and (draw-graph 0.0015). I think both outputs a negative acceleration value at the beginning (t = 0.00150 with acceleration -125000.0) , In case of dt = 0.0015 it just skips large positive value when t is 0.0005 and 0.00100. So I think this is the limitation of the interpolation method, you need to small dt against input data time series.

Screenshot from 2021-01-22 16-50-11

0.00000   0.000           0.0           0.0
0.00050   0.352        1453.1     1375000.0
0.00100   1.000        1000.0      500000.0
0.00150   1.508         984.4     -125000.0
0.00200   2.000        1000.0           0.0
0.00250   2.500        1000.0           0.0
0.00300   3.000        1000.0          -0.0
0.00350   3.500        1000.0           0.0
0.00400   4.000        1000.0          -0.0
0.00450   4.500        1000.0           0.0
0.00500   5.000        1000.0          -0.0
0.00550   5.500        1000.0          -0.0
0.00600   6.000        1000.0           0.0
0.00650   6.500        1000.0          -0.0
0.00700   7.000        1000.0           0.0
0.00750   7.492         984.4      125000.0
0.00800   8.000        1000.0     -500000.0
0.00850   8.648        1453.1    -1375000.0
0.00900   9.000          -0.0           0.0

Screenshot from 2021-01-22 16-50-42

0.00000   0.000           0.0           0.0
0.00150   1.508         984.4     -125000.0
0.00300   3.000        1000.0           0.0
0.00450   4.500        1000.0          -0.0
0.00600   6.000        1000.0           0.0
0.00750   7.492         984.4      125000.0
0.00900   9.000          -0.0           0.0

@708yamaguchi
Copy link
Member

708yamaguchi commented Jan 26, 2021

@k-okada

Thank your very much for your debugging!

I understand that we need to set default velocity/acceleration data.
I also understand that some data is skipped when we set big dt.
I checked that this PR improves minjerk interpolation performance.

With your commits, I can move kinova arm with/without MoveIt!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minjerk interpolation sometimes returns large acceleration
2 participants