[openrtm-users 03225] Re: Waypoint2D型のデータタイプがおかしい

Yuki Suga ysuga @ ysuga.net
2015年 10月 7日 (水) 21:45:13 JST


河内様:
菅です

すみません.並行してTwitterでもつぶやいてしまい,安藤さんはtrunkのコードの対応をしていただいたようです.

maxSpeedは,waypointに割り当てられた最大「速度」ですので,
Velocity2D型となるのが自然です.
C++版ではVelocity2Dになっていますが,Python版のtrunkのコードはPose2Dになっていました.

安藤さんの対応だと,コードからインストールするとVelocity2Dになります.

現状,幸い,と言っていいかどうかわかりませんが,Pose2DもVelocity2Dもdouble型3つなので,
pose.position.x -> velocity.vx
pose.position.y -> velocity.vy
pose.heading -> velocity.va
のように対応しているみたいで,PythonとC++で通信できました.

Python側からPath2Dを送る場合は,
path.waypoints[i].maxSpeed = RTC.Pose2D(RTC.Point2D(1.0, 1.0), 1.0)
のようにしなければならず,C++からは
path.waypoints[i].maxSpeed = RTC::Velocity2D(vx, vy, va)
のようにアクセスする,という不健全な状態ですが動きました.

バイナリインストールは便利なので,
早めに時期の修正リリースがあるといいな,と思っています・・・

ではでは

2015年10月7日(水) 13:21 河内のぶ <n.kawauchi @ aist.go.jp>:

> 菅様
>
> 河内です。ご連絡、ありがとうございます。
>
> 下記ページからダウンロードする32/64bit版のmsiファイルを確認致したとこ
> ろ、site-packages\OpenRTM_aist\RTM_IDL\InterfaceDataTypes.idl では
> 「Pose2D maxSpeed;」と定義されています。
> http://openrtm.org/openrtm/ja/content/openrtm-aist-python-110-release
>
> ------
>     /*!
>      * @struct Waypoint2D
>      * @brief A waypoint in 2D space, including constraints.
>      */
>     struct Waypoint2D
>     {
>         /// Location of the waypoint.
>         Pose2D target;
>         /// How far away from the waypoint is considered success (radius
> in metres).
>         double distanceTolerance;
>         /// How much off the target heading is considered success (in
> radians).
>         double headingTolerance;
>         /// Target time to arrive at the waypoint by.
>         Time timeLimit;
>         /// Maximum sped to travel at while heading to the waypoint.
>         Pose2D maxSpeed; ←★
>     };
> ------
>
> これとは別の問題でしょうか。 理解不足でしたら申し訳ございません。
> よろしくお願い致します。
>
> On Wed, 7 Oct 2015 02:10:00 +0000
> Yuki Suga <ysuga @ ysuga.net> wrote:
>
> > ML各位:
> > SSRの菅です.
> >
> > 環境:Windows 7 x64 OpenRTM-aist Python版 1.1.0 RELEASE 32bit版
> > Python2.7 32bit
> >
> > 表題の通り,バイナリからインストールしたOpenRTM-aistに含まれる
> > データ型がおかしいです.
> > Waypoint2D型ですが,IDLでは
> >
> > ########### ここから
> >     /*!
> >      * @struct Waypoint2D
> >      * @brief A waypoint in 2D space, including constraints.
> >      */
> >     struct Waypoint2D
> >     {
> >         /// Location of the waypoint.
> >         Pose2D target;
> >         /// How far away from the waypoint is considered success (radius
> in
> > metres).
> >         double distanceTolerance;
> >         /// How much off the target heading is considered success (in
> > radians).
> >         double headingTolerance;
> >         /// Target time to arrive at the waypoint by.
> >         Time timeLimit;
> >         /// Maximum sped to travel at while heading to the waypoint.
> >         Velocity2D maxSpeed;
> >     };
> > ########### ここまで
> >
> > ですが,site-packages/OpenRTM_aist/RTM_IDL/InterfaceDataType_idl.pyでは
> >
> > ########### ここから
> > # struct Waypoint2D
> > _0_RTC.Waypoint2D = omniORB.newEmptyClass()
> > class Waypoint2D (omniORB.StructBase):
> >     _NP_RepositoryId = "IDL:RTC/Waypoint2D:1.0"
> >
> >     def __init__(self, target, distanceTolerance, headingTolerance,
> > timeLimit, maxSpeed):
> >         self.target = target
> >         self.distanceTolerance = distanceTolerance
> >         self.headingTolerance = headingTolerance
> >         self.timeLimit = timeLimit
> >         self.maxSpeed = maxSpeed
> >
> > _0_RTC.Waypoint2D = Waypoint2D
> > _0_RTC._d_Waypoint2D  = (omniORB.tcInternal.tv_struct, Waypoint2D,
> > Waypoint2D._NP_RepositoryId, "Waypoint2D", "target",
> > omniORB.typeMapping["IDL:RTC/Pose2D:1.0"], "distanceTolerance",
> > omniORB.tcInternal.tv_double, "headingTolerance",
> > omniORB.tcInternal.tv_double, "timeLimit",
> > omniORB.typeMapping["IDL:RTC/Time:1.0"], "maxSpeed",
> > omniORB.typeMapping["IDL:RTC/Pose2D:1.0"])
> > _0_RTC._tc_Waypoint2D =
> > omniORB.tcInternal.createTypeCode(_0_RTC._d_Waypoint2D)
> > omniORB.registerType(Waypoint2D._NP_RepositoryId, _0_RTC._d_Waypoint2D,
> > _0_RTC._tc_Waypoint2D)
> > del Waypoint2D
> > ########### ここまで
> >
> > となっています.maxSpeedメンバのマッピングがPose2Dになっており,
> > このためにうまく通信できません.
> > バイナリに固めるときに使っているIDLが違うのでしょうか?
> >
> > 確認をお願いします.
> >
> > それでは
>
> ---------------------------------------------------
> 河内 のぶ n.kawauchi @ aist.go.jp
> 産業技術総合研究所 ロボットイノベーション研究センター
> ディペンダブルシステム研究チーム
>
>
>
> _______________________________________________
> openrtm-users mailing list
> openrtm-users @ openrtm.org
> http://www.openrtm.org/mailman/listinfo/openrtm-users
>
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
URL: <http://www.openrtm.org/pipermail/openrtm-users/attachments/20151007/976832e5/attachment.html>


More information about the openrtm-users mailing list