ネームサーバー、マスターマネージャにIIOP以外でアクセスできるようにする手順¶
実行環境整備¶
- Ubuntu24.04デスクトップPCのホスト環境(hostname: zku2404)・・・VM環境ではないということ
- ソースビルドで作成したdebパッケージをインストールしている
- ソースは、最新masterソース(017dbb2)へ下記2つのPRをマージして使用
https://github.com/OpenRTM/OpenRTM-aist/pull/999
https://github.com/OpenRTM/OpenRTM-aist/pull/1003- この2つをマージするとManager.cppでコンフリクトが発生するので、PR1003の修正を優先させる
- ソースビルド時は、OpenRTM-aist/scripts/ubuntu_2404/Dockerfile.package を使用
- ビルドスクリプトは、下記を使用
https://github.com/n-kawauchi/RTM-src-pkgs-docker-build/blob/master/ubuntu_2404/build-cxx.sh- 実行時、RTM-src-pkgs-docker-build/blob/master/ubuntu_2404/下にマージした OpenRTM-aist を手動で配置
- build-cxx.shの下記★の2行をコメントアウトして、ソースをcloneしないようにして実行する
#----- OpenRTM-aist echo "${password}" | sudo -S rm -rf ${TARGET}-* #rm -rf OpenRTM-aist ・・・★コメントアウト #git clone https://github.com/OpenRTM/OpenRTM-aist ・・・★コメントアウト VERSION=`dpkg-parsechangelog --file OpenRTM-aist/packages/deb/debian/changelog --show-field Version | cut -b 1-5`
- ビルドが終了すると、カレントディレクトリの cxx-deb-pkgs下に生成されたdebパッケージが入っている
- cxx-deb-pkgsディレクトリをインストールする環境へコピーし、下記手順でインストールする
$ sudo dpkg -i openrtm2-idl_2.1.0-0_amd64.deb\ openrtm2-dev_2.1.0-0_amd64.deb\ openrtm2_2.1.0-0_amd64.deb\ openrtm2-naming_2.1.0-0_amd64.deb\ openrtm2-example_2.1.0-0_amd64.deb
HTTP¶
結果OK ・・・2025/08/20確認
- ターミナル1・・・ネームサーバ起動
- 自動起動しているomniNamesを停止させてからopenrtmNamesを起動する
$ systemctl status omniorb-nameserver.service $ sudo systemctl stop omniorb-nameserver.service $ export ORBtraceLevel=40 $ /usr/bin/openrtmNames -f /usr/etc/rtc.names.http.conf > openrtmNames-http.log 2>&1
- ログは右記ページ参照 ・・・ openrtmNames-http.log
- /usr/etc/rtc.names.http.confの内容
corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:http://localhost:2809/call
- 自動起動しているomniNamesを停止させてからopenrtmNamesを起動する
- ターミナル2 ・・・RTC起動
- サンプルRTCの実行
- ログを取りたいのでHOME下に /usr/share/openrtm-2.1/components/c++/examples をコピーして利用する
$ mkdir test0820 $ cd test0820/ $ cp -r /usr/share/openrtm-2.1/components/c++/examples/* . $ ./ConsoleOutComp -f /usr/etc/http/rtc.http.conf
- RTCのログは右記ページ参照 ・・・ rtc_http.log
- /usr/etc/http/rtc.http.confの内容
logger.enable: YES logger.log_level: DEBUG #logger.file_name: stdout naming.formats: %h.host_cxt/%n.rtc manager.modules.load_path: /usr/lib/x86_64-linux-gnu/openrtm-2.1/http manager.preload.modules: HTTPTransport.so corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:http:///call corba.nameservers: http://localhost:2809/call corba.master_manager: giop:http:http://localhost:2810/call
- ターミナル3 ・・・rtshell起動
$ export RTCTREE_HTTP_ENABLE=YES $ export RTCTREE_NAMESERVERS=http://localhost:2809/call $ export ORBserverTransportRule="* http" $ export ORBclientTransportRule="* http" $ export ORBendPoint=giop:http:http:///call $ export ORBtraceLevel=40 $ rtls /http://localhost:2809/call#`hostname`.host_cxt > rtls-http.log 2>&1 : ConsoleOut0.rtc
- ログは右記ページ参照 ・・・ rtls-http.log
- ログをファイルに落とさない場合、rtlsの結果として ConsoleOut0.rtc が返ってきた
HTTPS¶
結果OK ・・・2025/08/22確認
- ターミナル1・・・ネームサーバ起動
- 起動しているomniNames、openrtmNamesが無いことを確認してからhttps向けを起動
$ export ORBtraceLevel=40 $ /usr/bin/openrtmNames -f /usr/etc/rtc.names.https.conf > openrtmNames-https.log 2>&1
- ログは右記ページ参照 ・・・ openrtmNames-https.log
- /usr/etc/rtc.names.https.confの内容
corba.http.certificate_authority_file:/usr/etc/ssl/root.crt corba.http.key_file:/usr/etc/ssl/server.pem corba.http.key_file_password:password corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:https://localhost:2809/call
- 起動しているomniNames、openrtmNamesが無いことを確認してからhttps向けを起動
- ターミナル2 ・・・RTC起動
- サンプルRTCの実行
$ ./ConsoleOutComp -f /usr/etc/http/rtc.https.conf
- RTCのログは右記ページ参照 ・・・ rtc-https.log
- /usr/etc/http/rtc.https.confの内容
logger.enable: YES logger.log_level: DEBUG #logger.file_name: stdout naming.formats: %h.host_cxt/%n.rtc manager.modules.load_path: /usr/lib/x86_64-linux-gnu/openrtm-2.1/http manager.preload.modules: HTTPTransport.so corba.http.certificate_authority_file:/usr/etc/ssl/root.crt corba.http.key_file:/usr/etc/ssl/server.pem corba.http.key_file_password:password corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:https:///call corba.nameservers: https://localhost:2809/call corba.master_manager: giop:http:https://localhost:2810/call
- サンプルRTCの実行
- ターミナル3 ・・・rtshell起動
- 環境変数設定項目が多いので、シェルスクリプトで定義しておく
- rtls_export.sh
#!/bin/bash export RTCTREE_HTTP_ENABLE=YES export RTCTREE_NAMESERVERS=https://localhost:2809/call export ORBendPoint=giop:http:https://localhost:2811/call export ORBhttpsCAFile=/usr/etc/ssl/root.crt export ORBhttpsKeyFile=/usr/etc/ssl/server.pem export ORBhttpsKeyPassword=password export ORBserverTransportRule="* http" export ORBclientTransportRule="* http" export ORBtraceLevel=40
- 現在のシェルに反映させたいので、sourceで実行後にrtlsコマンドを実行する
$ source rtls_export.sh $ rtls /https://localhost:2809/call#`hostname`.host_cxt > rtls-https.log 2>&1 : ConsoleOut0.rtc
- ログは右記ページ参照 ・・・ rtls-https.log
- 変更点(1)
- ネームサーバ起動時に出た「Unable to open new connection: giop:tcp:127.0.0.1:0」の対応で、ORBendPointはホスト名付きに変更した
- https:///call のようにホスト名が抜けた形は、不正と解釈されている可能性があるとChatGPTに言われたため
export ORBendPoint=giop:http:https:///call ↓ export ORBendPoint=giop:http:https://localhost:2811/call
- 変更点(2)
- ORBendPointで指定するポート番号を2809から空いている2811に変更した
- ネームサーバと同じ2809指定で実行すると下記エラーが出たため
omniORB: (0) 2025-08-20 17:02:57.224934: Failed to bind to address 127.0.0.1 port 2809. Address in use? omniORB: (0) 2025-08-20 17:02:57.224954: Error: Unable to create an endpoint of this description: giop:http:https://localhost:2809/call
- これは、すでに別のプロセス(おそらく先に起動したopenrtmNames)がポート2809を占有しているため、rtlsが内部で自分のORBをバインドしようとして失敗している状況
- rtlsコマンド実行時に、名前サービスに接続するだけであれば、自身がポート2809を使う必要はないため、空いている2811ポートを使用した
- 変更点(3)
- rtlsのログに下記が出力されたため、環境変数でTransportRuleを追加した
omniORB: (0) 2025-08-05 18:54:10.152467: Client attempt to connect to giop:tcp:127.0.0.1:0 omniORB: (0) 2025-08-05 18:54:10.152487: Unable to open new connection: giop:tcp:127.0.0.1:0
- 下記TransportRuleの追加により、IIOPを明示的に拒否し、http/https モジュールだけを使うようにした
$ export ORBserverTransportRule="* http" $ export ORBclientTransportRule="* http"
- rtlsのログに下記が出力されたため、環境変数でTransportRuleを追加した
WS¶
- 2025/08/25のミーティングで、宮本君に教えてもらったこと
- RTC起動時に指定しているrtc.ws.confで、TransportRuleにtcpを追加しているが、これは外す
"* http,tcp" ↓ "* http"
- RTC起動時に指定しているrtc.ws.confで、TransportRuleにtcpを追加しているが、これは外す
結果OK ・・・2025/09/05確認
- ターミナル1・・・ネームサーバ起動
- 起動しているomniNames、openrtmNamesが無いことを確認してからwss向けを起動
$ export ORBtraceLevel=40 $ /usr/bin/openrtmNames -f /usr/etc/rtc.names.ws.conf > openrtmNames-ws.log 2>&1
- ログは右記ページ参照 ・・・ openrtmNames-ws.log
- /usr/etc/rtc.names.ws.confの内容
corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:ws://localhost:2809/ws
- 起動しているomniNames、openrtmNamesが無いことを確認してからwss向けを起動
- ターミナル2 ・・・RTC起動
- サンプルRTCの実行
$ ./ConsoleOutComp -f /usr/etc/http/rtc.ws.conf
- RTCのログは右記ページ参照 ・・・ rtc_ws.log
- /usr/etc/http/rtc.ws.confの内容
logger.enable: YES logger.log_level: DEBUG #logger.file_name: stdout naming.formats: %h.host_cxt/%n.rtc manager.modules.load_path: /usr/lib/x86_64-linux-gnu/openrtm-2.1/http manager.preload.modules: HTTPTransport.so corba.args:-ORBserverTransportRule "* http" -ORBclientTransportRule "* http" -ORBendPoint giop:http:ws:///ws -ORBendPoint giop:tcp:: corba.nameservers: ws://localhost:2809/ws corba.master_manager: giop:http:ws://localhost:2810/ws
- サンプルRTCの実行
- ターミナル3 ・・・rtshell起動
- 環境変数設定項目が多いので、シェルスクリプトで定義しておく
- rtls_export.sh
#!/bin/bash # WS export RTCTREE_HTTP_ENABLE=YES export RTCTREE_NAMESERVERS=ws://localhost:2809/ws export ORBendPoint=giop:http:ws:///ws export ORBserverTransportRule="* http" export ORBclientTransportRule="* http" export ORBtraceLevel=40
- 現在のシェルに反映させたいので、sourceで実行後にrtlsコマンドを実行する
$ source rtls_export.sh $ rtls /ws://localhost:2809/ws#`hostname`.host_cxt > rtls-ws.log 2>&1 : ConsoleOut0.rtc
- ログは右記ページ参照 ・・・ rtls-ws.log
- 変更点(1)
- 環境変数でTransportRuleを指定しないと下記となってしまう
omniORB: clientTransportRule = * unix,ssl,tcp omniORB: serverTransportRule = * unix,ssl,tcp : omniORB: (0) 2025-08-22 16:23:44.994349: Client attempt to connect to giop:tcp:127.0.0.1:0 omniORB: (0) 2025-08-22 16:23:44.994362: Unable to open new connection: giop:tcp:127.0.0.1:0 : rtls: Invalid CORBA naming service: ws://localhost:2809/ws
- 環境変数でTransportRuleを指定しないと下記となってしまう
WSS¶