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

sequenceplayerの補間queueについて #1261

Open
hsnuhayato opened this issue Dec 18, 2018 · 3 comments
Open

sequenceplayerの補間queueについて #1261

hsnuhayato opened this issue Dec 18, 2018 · 3 comments

Comments

@hsnuhayato
Copy link
Contributor

hsnuhayato commented Dec 18, 2018

sequenceplayの補間queueについての質問です。
当方は、ロボットの制御周期dt = 0.005[s]、0.01[s]毎にsetJointAnglesOfGroupを呼び出し(目標角度への目標到達時間i_tm=0.5[s])という操作を行っているが、sequenceplayの補間queueのサイズがどんどん溜まっていくことが分かりました。そのため、setJointAnglesOfGroupの呼出しをやめてもロボットの動きが0.5[s]後に停止しません。
ソースコード解読し、自分の理解だと

  1. state=working時に、setJointAnglesOfGroupを呼ばれる度にinterpolateが行われ、queueが+1されます。
  2. onExecute内のget呼ばれる度にinterpolateが行われ、queueが+1されるが、後にpopされます。
    なので、一回のonExecute実行の間に、setJointAnglesOfGroupの呼ばれる回数分だけqueueのサイズが増えます という理解は合っているでしょうか。
    i->inter->get(x, v, false);

    この行のpopの引数をtrueにするとqueueの増大を防げるが、軌道が一個分欠けるため少し不連続になります。

このような運用の仕方で、補間queueが増大せず、かつ連続的な軌道を保つ方法はあるのでしょうか。
よろしくお願いします。

@fkanehiro
Copy link
Owner

  1. state=working時に、setJointAnglesOfGroupを呼ばれる度にinterpolateが行われ、queueが+1されます。

は、どの部分を指しているでしょうか?

@hsnuhayato
Copy link
Contributor Author

seqplay.cppのsetJointAnglesOfGroupが呼ばれると->interのgetを呼ぶ->interpolateを呼ぶ->pushを呼ぶ

i->inter->get(x, v, false);

interpolate(remain_t);

するとこのinterpolatorインスタンス内のqueue(q, dq, ddq)のサイズがそれぞれ一個増えます。ということをお伝えしたかったです。
説明が不十分で申し訳ございません。

@fkanehiro
Copy link
Owner

なるほど、理解しました。
setJointAnglesOfGroup内でget()を呼ぶのは #162 への対応として @k-okada さんが導入されたようですが、これってなぜ必要なのでしたか?

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

No branches or pull requests

2 participants