[openrtm-users 01117] Re: Managerのnamingformatの不具合

Ando Noriaki n-ando @ aist.go.jp
2010年 2月 16日 (火) 00:13:30 JST


ジェフさん

安藤です

Windowsで試しましたが、コンポーネントは別プロセスで起動できました。
netstatの出力結果は以下の通りです。タスクマネージャで見ても、
rtcdが2つ起動していました。

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Python26\Scripts>setns
C:\Python26\Scripts>set RTCTREE_NAMESERVERS=localhost
C:\Python26\Scripts>rtls
 [01;34mlocalhost/ [00m
C:\Python26\Scripts>rtcwd localhost
C:\Python26\Scripts>rtls
 [01;34mcf-y7.host_cxt/ [00m   [01;34mmanager.mgr/ [00m
C:\Python26\Scripts>rtmgr manager.mgr create "ConsoleIn?manager=localhost:42000&
instance_name=ConsoleIn42000"
C:\Python26\Scripts>netstat -a
Active Connections
  Proto  Local Address          Foreign Address        State
  TCP    cf-y7:epmap            cf-y7:0                LISTENING
  TCP    cf-y7:microsoft-ds     cf-y7:0                LISTENING
  TCP    cf-y7:902              cf-y7:0                LISTENING
  TCP    cf-y7:912              cf-y7:0                LISTENING
  TCP    cf-y7:2809             cf-y7:0                LISTENING
  TCP    cf-y7:2810             cf-y7:0                LISTENING
  TCP    cf-y7:2869             cf-y7:0                LISTENING
  TCP    cf-y7:3389             cf-y7:0                LISTENING
  TCP    cf-y7:5027             cf-y7:0                LISTENING
  TCP    cf-y7:6000             cf-y7:0                LISTENING
  TCP    cf-y7:42000            cf-y7:0                LISTENING
 略
C:\Python26\Scripts>

ちなみに、rtc.conf で
manager.modules.load_path: ../examples/C++/
のように、DLLやsoへのパスを通しておけば、loadしなくてもcreateできます。
あと、rtcd と rtcprof にパスが通っていますか?


rtcshell を Windows でいじってみたのですが、以下の部分を直さないと動きませんでした。
僕の環境だけでしょうか?
1) settmp.bat 内で環境変数をセットしてますが" が入ると動かない
 set RTCSH_CWD="/localhost" ・・・×
 set RTCSH_CWD=/localhost ・・・○

2) rtcwd.bat 内で引数を rtcwd.pyに渡していない。
3) rtmgr.py のmainの引数args?argv?が使われていない
 これはもしかして勘違いかもしれませんが。parsargs が直接 sys.argv から
 引数を取ってる?
4) Windowsとは関係ありませんが、Linuxでは環境変数をセットするのに
 export を使っていますね。csh系で動かないのは僕としてはちょっと悲しいです(笑

以下は差分です。Linuxでは動かないかもしれませんがとりあえず。。。

--- ../rtmgr.py 2010-02-15 23:30:51.000000000 +0900
+++ rtcshell-1.0.0/rtmgr        2010-02-08 15:40:30.000000000 +0900
@@ -127,7 +127,7 @@
     return 0


-def main(args):
+def main(argv):
     usage = '''Usage: %prog [options] <path> <command> [args]
 Control a manager, adding and removing shared libraries and components. To
 set a mananger's configuration, use rtconf.


--- rtcshell-1.0.0/rtcwd.py     2010-02-08 15:40:30.000000000 +0900
+++ ../rtcwd.py 2010-02-15 23:50:06.000000000 +0900
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!C:\Python26\python.exe
 # -*- Python -*-
 # -*- coding: utf-8 -*-

@@ -65,13 +65,13 @@
         print >>sys.stderr, 'rtcd: {0}: Not a directory'.format(cmd_path)
         return 1

-    print '{0} {1}="{2}"'.format(SET_CMD, ENV_VAR, full_path)
+    print '{0} {1}={2}'.format(SET_CMD, ENV_VAR, full_path)


 def main(argv):
     if len(argv) < 2:
         # Change to the root dir
-        print '{0} {1}="/"'.format(SET_CMD, ENV_VAR)
+        print '{0} {1}=/'.format(SET_CMD, ENV_VAR)
         return 0
     else:
         # Take the first argument only
@@ -80,20 +80,20 @@
         if cmd_path == '.' or cmd_path == './':
             # Special case for '.': do nothing
             if ENV_VAR in os.environ:
-                print '{0} {1}="{2}"'.format(SET_CMD, ENV_VAR,
os.environ[ENV_VAR])
+                print '{0} {1}={2}'.format(SET_CMD, ENV_VAR,
os.environ[ENV_VAR])
                 return 0
             else:
-                print '{0} {1}="{2}"'.format(SET_CMD, ENV_VAR, '/')
+                print '{0} {1}={2}'.format(SET_CMD, ENV_VAR, '/')
                 return 0
         elif cmd_path == '..' or cmd_path == '../':
             # Special case for '..': go up one directory
             if ENV_VAR in os.environ and os.environ[ENV_VAR] and \
                     os.environ[ENV_VAR] != '/':
-                print '{0} {1}="{2}"'.format(SET_CMD, ENV_VAR,
+                print '{0} {1}={2}'.format(SET_CMD, ENV_VAR,
                         os.path.dirname(os.environ[ENV_VAR]))
                 return 0
             else:
-                print '{0} {1}="{2}"'.format(SET_CMD, ENV_VAR, '/')
+                print '{0} {1}={2}'.format(SET_CMD, ENV_VAR, '/')
                 return 0

         # Build the full path by checking the RTCSH_CWD environment variable.

--- rtcshell-1.0.0/rtcwd.bat    2010-02-08 15:40:30.000000000 +0900
+++ ../rtcwd.bat        2010-02-08 15:41:59.000000000 +0900
@@ -9,7 +9,7 @@
 rem Licensed under the Eclipse Public License -v 1.0 (EPL)
 rem http://www.opensource.org/licenses/eclipse-1.0.txt

-rtcwd.py > settmp.bat
+rtcwd.py %* > settmp.bat
 settmp
 del settmp.bat

あと、最後の del settmp.bat で settmp.bat がなぜか削除されていないみたいです。



2010年2月15日22:40 Geoff Biggs <geoffrey.biggs @ aist.go.jp>:
> 安藤様
>
> ジェフです。
>
> やっぱりそうですね。(まだ時差ぼけあるでしょうか?;)
>
> $ rtmgr manager.mgr create
> 'ConsoleIn?manager=localhost:2811&instance_name=ConsoleIn1234'
> $ rtls ../
> odyssey.host_cxt/  ConsoleIn1234.rtc
>
> netstatにはポート2811はまだ出力されませんけど。スレーブマネージャはlistenしますか?
>
>
> On Mon, 15 Feb 2010 22:25 +0900, "Ando Noriaki" <n-ando @ aist.go.jp>
> wrote:
>> ジェフ様
>>
>> 安藤です
>>
>> > $ rtmgr manager.mgr create
>> > ConsoleIn?manager=localhost:2811&instance_name=ConsoleIn1234
>> > [1] 29698
>> > $
>> > [1]+  Done                    rtmgr manager.mgr create
>> > ConsoleIn?manager=localhost:2811
>> > $ rtls ../
>> > odyssey.host_cxt/  ConsoleIn0.rtc
>>
>> この部分ですが、?や&がshellでextractされてませんか?
>> single quote などで囲まないと、引数として正しく渡らないのでは?
>>
>> $ rtmgr manager.mgr create
>> 'ConsoleIn?manager=localhost:2811&instance_name=ConsoleIn1234'
>>
>>
>> --
>> 安藤慶昭@独立行政法人産業技術総合研究所 知能システム研究部門
>>     統合知能研究グループ 主任研究員, 博士(工学)
>>     〒305-8568 つくば市梅園1-1-1 中央第2
>>     e-mail: n-ando @ aist.go.jp, web: http://staff.aist.go.jp/n-ando
>>     OpenRTM-aist: http://www.openrtm.org
>
>
>



-- 
安藤慶昭@独立行政法人産業技術総合研究所 知能システム研究部門
    統合知能研究グループ 主任研究員, 博士(工学)
    〒305-8568 つくば市梅園1-1-1 中央第2
    e-mail: n-ando @ aist.go.jp, web: http://staff.aist.go.jp/n-ando
    OpenRTM-aist: http://www.openrtm.org

Noriaki Ando, Ph.D.
    Senior Research Scientist, RT-Synthesis R.G., ISRI, AIST
    AIST Tsukuba Central 2, Tsukuba, Ibaraki 305-8568 JAPAN
    e-mail: n-ando @ aist.go.jp, web: http://staff.aist.go.jp/n-ando
    OpenRTM-aist: http://www.openrtm.org



openrtm-users メーリングリストの案内