OpenRTM / OpenRTM-aist-Python

OpenRTM-aist: RT-Middleware and OMG RTC implementation in Python implemented by AIST
Other
2 stars 7 forks source link

OpenRTM1.2.2+Ubuntu18.04でrtcd -d を実行すると「ModuleNotFoundError: No module named 'rtcprof_python'」となる #213

Closed n-kawauchi closed 4 years ago

n-kawauchi commented 4 years ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. debパッケージは下記テストリポジトリからaptでインストールする http://150.29.99.185/pub/Linux/ubuntu/dists/bionic/main/binary-amd64/ インストールスクリプトは、Python3対応に変更したものをダウンロードして使う

    $ wget https://raw.githubusercontent.com/n-kawauchi/OpenRTM-aist/ubuntu_install_script/scripts/pkg_install_ubuntu.sh
    $ vim pkg_install_ubuntu.sh
     :
    #default_reposerver="openrtm.org"
    #reposervers="openrtm.org"
    default_reposerver="150.29.99.185"
    reposervers="150.29.99.185"
    
    $ sudo sh pkg_install_ubuntu.sh -l all -d --yes
  2. 任意のディレクトリにrtc.confを用意し、ここでrtcd -dを実行する
    $ echo manager.modules.load_path: /usr/share/openrtm-1.2/components/c++/examples/rtc/,/usr/share/openrtm-1.2/components/python3/SimpleIO/,/usr/share/openrtm-1.2/components/java/RTMExamples/SimpleIO/> rtc.conf
    $ rtcd -d -f rtc.conf
  3. RTSEのName Service Viewのmangerをクリックすると、 LoadableModulesのValueにC++とJavaのコンポーネントリストしか表示されず、コマンドプロンプトに下記エラーがでている
    $ rtcd -d -f rtc.conf
    :
    Traceback (most recent call last):
    File "/usr/bin/rtcprof_python3", line 18, in <module>
    import rtcprof_python
    ModuleNotFoundError: No module named 'rtcprof_python'
  4. utils/rtcprof/rtcprof.py は、utils/rtcprof/rtcprof_python.pyにファイル名が変更になったので、/usr/lib/python3/dist-packages/OpenRTM_aist/utils/rtcprof/init.py(アンダーバーが表示されてません)も下記に変更後に rtcd -d を実行しても改善せず。
    from rtcprof.rtcprof import *
      ↓
    from rtcprof.rtcprof_python import *
  5. さらに/usr/bin/rtcprof_python3 を次のように2か所変更してみたら動作した
    import rtcprof_python
      ↓
    import rtcprof.rtcprof_python
    rtcprof_python.main()
      ↓
    rtcprof.rtcprof_python.main()

    これが正しい対応なのか判断できないので、よろしくお願いします。

Reproducibility 100%

Environment

Nobu19800 commented 4 years ago

4の変更は必要なのでしょうか?

n-kawauchi commented 4 years ago

「from rtcprof.rtcprof import *」の定義は、rtcprofディレクトリ下のrtcprof.py に対してのアクセス許可との理解です。よってファイル名が変更になっている現在では rtcprof_python と指定しないと機能しないのでは?と思ったから変更しました。この辺の理解も不十分です。

Nobu19800 commented 4 years ago

以前はrtcprofフォルダのinit.pyとrtcprof.pyのどちらをimportするのかよく分からなかったのが問題なので、今はrtcprof_python.pyに名前が変更しているので問題ないと思います。 4の変更なしでも動くのであれば5の変更だけで大丈夫だと思います。

n-kawauchi commented 4 years ago

了解しました。 対応、よろしくお願いします。

n-kawauchi commented 4 years ago

確認せずお返事しました。 5の修正が入っていれば、4のinit.pyでは何も定義しないと動作しました。