-
Notifications
You must be signed in to change notification settings - Fork 14
ロードするモジュールのパスに環境変数を設定可能にする #1010
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
Conversation
n-kawauchi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最新masterへマージしたところコンフリクトしました。
>git merge feature/config_replace_env
Auto-merging src/lib/rtm/ModuleManager.cpp
CONFLICT (content): Merge conflict in src/lib/rtm/ModuleManager.cpp
Automatic merge failed; fix conflicts and then commit the result.
|
manager.modules.load_path の確認のため、managerのLoadableModulesのパスを表示させたところJavaのRTCのみパスが見えません。
|
|
manager.modules.load_path、manager.preload.modules、manager.modules..load_paths、logger.plugins のそれぞれで環境変数を使用したパスで指定してみたところ、logger.plugins のみがエラーになります。
以下は動作OKだったパスの確認結果です。
|
|
修正したのでこれで試してみてください。 |
|
修正して頂いたソースで動作確認しましたが、これまでOKだった動作がNGとなりました。
|
|
再度修正したので試してください。 |
|
修正して頂いたソースで確認しましたが、全部OKになりません。
|
|
修正したので確認をお願いします。 |
n-kawauchi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ubuntu24.04環境で動作OKを確認できました。確認内容は以下の通りです。
- 1)logger.plugins の確認
- HOME下にRTCと対象confファイルをコピーして確認
- rtc.fluentbit_stream.confを下記とする
logger.plugins: ${RTM_LIB}/logger/FluentBit.so - 環境変数を指定してRTC実行
$ export RTM_LIB=/usr/lib/x86_64-linux-gnu/openrtm-2.1 $ export LD_PRELOAD=/usr/lib/fluent-bit/libfluent-bit.so $ ./ConsoleOutComp -f rtc.fluentbit_stream.conf - この時のRTCログで、FluentBit.soのフルパスは問題なく展開されている
Oct 14 06:53:02.991 DEBUG: ModuleManager: Finding function symbol: FluentBitInit in /usr/lib/x86_64-linux-gnu/openrtm-2.1/logger/FluentBit.so Oct 14 06:53:02.999 INFO: manager: Logstream fluentd created. Oct 14 06:53:03.009 INFO: manager: Logstream fluentd added.
- 2)manager.modules.load_path
- マスターマネージャーからC++のスレーブマネージャー経由でRTCを起動する動作で確認
- rtc.confを次のように指定
manager.modules.load_path: ${RTM_ROOT}/c++/examples/rtc/,${RTM_ROOT}/python3/SimpleIO/,${RTM_ROOT}/java/RTMExamples/SimpleIO/ - 以下を実行し、RTSEのManagerのプロパティでのLoadableModulesのコンポーネントリストを確認
$ export RTM_ROOT=/usr/share/openrtm-2.1/components $ rtcd2 -d -f rtc.conf
- 3)manager.modules. [lang] .load_paths
- マスターマネージャーからC++のスレーブマネージャー経由でRTCを起動する動作で確認
- rtc.confを次のように指定し、2)と同様に rtcd2 -d -f rtc.conf を実行
manager.modules.load_path: manager.modules.C++.load_paths: ${RTM_ROOT}/c++/examples/rtc/ manager.modules.Python.load_paths: ${RTM_ROOT}/python3/SimpleIO/ manager.modules.Java.load_paths: ${RTM_ROOT}/java/RTMExamples/SimpleIO/
- 4)manager.preload.modules
- HTTP通信で使用する /usr/etc/http/rtc.http.conf をコピーして次のように修正して確認
manager.modules.load_path: manager.preload.modules: ${RTM_LIB}/http/HTTPTransport.so - 以下を実行
$ /usr/bin/openrtmNames -f /usr/etc/rtc.names.http.conf $ export RTM_LIB=/usr/lib/x86_64-linux-gnu/openrtm-2.1 $ ./ConsoleOutComp -f rtc.http.conf - rtlsでRTC起動を確認
- rtls実行に必要な環境変数を定義しているrtls_export.shを読み込んでからrtlsを実行
$ source rtls_export.sh $ rtls /http://localhost:2809/call#`hostname`.host_cxt ConsoleOut0.rtc
- HTTP通信で使用する /usr/etc/http/rtc.http.conf をコピーして次のように修正して確認
Identify the Bug
manager.modules.load_path、manager.preload.modules、manager.modules.<lang>.load_paths、logger.pluginsで設定したモジュールを絶対パスで設定した場合、他の環境に移植する場合にパスが変わるため修正の必要がある。Description of the Change
manager.modules.load_path、manager.preload.modules、manager.modules.<lang>.load_paths、logger.pluginsに以下のように環境変数を設定できるようにした。この例ではWindowsインストーラーで
RTM_ROOTとRTM_VC_VERSIONが設定されるため、他の環境でも同じモジュールをロードできる。Verification