Giter Club home page Giter Club logo

Comments (14)

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 19, 2012 04:04:20

interrpolator::load()はbufferに一旦動作を貯めるので、現状のinterpolator::getとは共存できない

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 19, 2012 05:18:06

問題の再現手順を教えてもらえませんか?

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 19, 2012 05:47:33

clear()しても、get()すると続きの動作がとれてしまいます。
hiro用コードで起こっておりますが、hiro特有ではないと思います。
良いサンプルがないので、後ほどお知らせします。

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 19, 2012 17:33:16

添付ファイルにある以下の関数を作成しました。
seqplay::clear(1)しても、何もクリアせず帰ってきます。
現状のしくみをあまり変えずに
playPatterns
load
setJointAngles
を有効にするには、
setJointAnglesを実行する場合にもバッファqに動作を貯める方が良いと思います。

155 uint32_t
156 seqplayClearTest()
157 {
158 int dof = 1;
159 double dt = 0.005;
160
161 seqplay s(dof, dt);
162 double p[] = {0.1};
163 s.setJointAngles(p, 1);
164
165 //s.clear(); // <---- can not return
166 s.clear(1); // <---- do not work clear anything
167
168 uint32_t ret = 0;
169 for (int i=0; !s.isEmpty(); i++)
170 {
171 double v[] = {0.0};
172 double dummy[3];
173 s.get(v, dummy, dummy, dummy, dummy);
174 cout << v[0] << endl;
175
176 // judge
177 if ( v[0] != 0.0 )
178 ret = 1;
179 }
180
181 return ret;
182 }

Attachment: SequencePlayerTest.cpp

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 19, 2012 18:03:34

以下の修正で、テストは通るようになりました。
実機でも試してみます。

 1 *** interpolator.cpp 2012-01-20 11:01:13.645795251 +0900
2 --- interpolator.cpp.mod 2012-01-20 11:01:00.145795007 +0900
3 ***************
4 *** 250,255 ****
5 --- 250,258 ----
6 memcpy(x, gx, sizeof(double)*dim);
7 }
8 }
9 +
10 + if (remain_t > 0)
11 + remain_t -= dt;
12 }
13
14 void interpolator::set(const double *angle)

Attachment: interpolator.cpp.patch

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 20, 2012 17:12:57

clear()が呼ばれたときにremain_tが0でなければ0にすればいいのではないかと思ったのですが、どうでしょう?

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 23, 2012 04:02:03

なるほど。
確かにそうですね。

現状、
seqplay->clear() --> interpolator->pop_back()
と呼ばれた中で、

243 void interpolator::pop_back()
244 {
245 if (length > 0) {
...    /バッファを利用している場合のpop処理/
255 }
256
257 if (remain_t > 0)
258 remain_t -= dt;
259 }

としている所を、
258     remain_t = 0;
にするという理解で良いでしょうか?

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 23, 2012 04:09:05

おっと、一つ前のコードの257,258行目は、まだ未コミットでした。

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 23, 2012 04:13:49

はい、それで問題なければコミットしちゃって下さい。

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 23, 2012 04:52:52

では遠慮なくw

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 23, 2012 04:56:05

修正しました。
257 if (remain_t > 0)
258 remain_t -= dt;
の状態では、テストコードと実機(HIRO)上でテスト済みです。
remain_t = 0
にしてからはまだテストは実施していません。

Status: Fixed
Owner: [email protected]

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 26, 2012 18:35:19

すみません、
if (remain_t > 0)
ではなく、
else if (remain_t > 0)
に修正してコミットしました。

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 27, 2012 22:22:07

remain_t=0にした後にget()する場合、
期待する値はclear()直前の値ですが、
ゴールの値が帰ります。
現在対策中。

from hrpsys-base.

fkanehiro avatar fkanehiro commented on August 25, 2024

From [email protected] on January 27, 2012 23:07:19

255 } else if (remain_t > 0) {
256 interpolate(remain_t);
257 memcpy(gx, x, sizeof(double)*dim);
258 remain_t = 0;
259 }

このように修正して(256,257追加)テストコードではうまくいったので、実機でもテストしてみます。

from hrpsys-base.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.