操作
機能 #3886
完了機能 #3779: (シ)データポートのPortProfile/ConnectorProfileのプロパティ拡張作業
[FSM4RTC] データポートのタイムスタンプ打刻機能
開始日:
2017/01/25
期日:
進捗率:
100%
予定工数:
説明
[FSM4RTC] データポートのPortProfile/ConnectorProfileのプロパティ拡張作業に基づき、データポートにタイムスタンプの打刻機能を追加する。
win-ei さんがほぼ8年前に更新
dataport.timestamp_policy=on_writeについて¶
on_writeは、ConnectorDataListenerのON_BUFFER_WRITEのコールバックリスナーでタイムスタンプ打刻をしています。
サブスクリプション型がflushの接続の場合は、バッファがなく、直接、InPortへデータをpushしますので、ON_BUFFER_WRITEのコールバックイベントは発生しません。
そのため、サブスクリプション型がflushの接続の場合は、「dataport.timestamp_policy=on_write」は無効です。
dataport.timestamp_policy=on_sendについて¶
on_sendは、ConnectorDataListenerのON_SENDのコールバックリスナーでタイムスタンプ打刻をしています。
- データフロー型がPull接続の場合は、InPortでデータを取り込むために、ON_SENDのコールバックイベントは発生しません。
そのため、データフロー型がPullの接続の場合は、「dataport.timestamp_policy=on_send」は無効です。
- インターフェース型がdirect接続でデータフロー型がPush接続の場合、直接、OutPortは直接InPortへ書込むため、ON_SENDのコールバックイベントは発生しません。
そのため、「dataport.timestamp_policy=on_send」は無効です。
dataport.timestamp_policy=on_readについて¶
on_readは、ConnectorDataListenerのON_BUFFER_READのコールバックリスナーでタイムスタンプ打刻をしています。
- データフロー型がPull接続の場合は、OutPort側でバッファを保持するので、InPort側ではON_BUFFER_READのコールバックイベントは発生しません。
そのため、「dataport.timestamp_policy=on_read」は無効です。
- インターフェース型がdirect接続でデータフロー型がPush接続の場合、直接、OutPortは直接InPortへ書込むため、ON_BUFFER_READのコールバックイベントは発生しません。
そのため、「dataport.timestamp_policy=on_read」は無効です。
動作確認¶
別々のターミナルで ConsoleOut ConsoleIn を起動する。
rtcon でポートを接続する
on_received¶
- [corba_cdr][push][flush]
$ rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=flush --property dataport.timestamp_policy=on_received
- [corba_cdr][push][new][all]
$ rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=all --property dataport.timestamp_policy=on_received
- [corba_cdr][push][new][fifo]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=fifo --property dataport.timestamp_policy=on_received
- [corba_cdr][push][new][skip]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=skip --property dataport.publisher.skip_count=1 --property dataport.timestamp_policy=on_received
- [corba_cdr][push][new][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=new --property dataport.timestamp_policy=on_received
- [corba_cdr][push][periodic][all]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=all --property dataport.timestamp_policy=on_received
- [corba_cdr][push][periodic][fifo]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=fifo --property dataport.timestamp_policy=on_received
- [corba_cdr][push][periodic][skip]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=skip --property dataport.timestamp_policy=on_received
- [corba_cdr][push][periodic][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=new --property dataport.timestamp_policy=on_received
- [shared_memory][push][periodic][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.interface_type=shared_memory --property dataport.timestamp_policy=on_received
- [direct][push][new][][on_received]
- ConsoleInのrtc.confに以下を追加してConsoleInを起動する。
manager.modules.load_path:./RTMExamples/SimpleIO manager.modules.preload: ConsoleOut manager.components.precreate: ConsoleOut
- rtcon でポートを接続する
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.interface_type=direct --property dataport.dataflow_type=push --property dataport.timestamp_policy=on_received
- ConsoleInのrtc.confに以下を追加してConsoleInを起動する。
on_send¶
- [corba_cdr][push][flush]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=flush --property dataport.timestamp_policy=on_send
- [corba_cdr][push][new][all]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=all --property dataport.timestamp_policy=on_send
- [corba_cdr][push][new][fifo]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=fifo --property dataport.timestamp_policy=on_send
- [corba_cdr][push][new][skip]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=skip --property dataport.publisher.skip_count=1 --property dataport.timestamp_policy=on_send
- [corba_cdr][push][new][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=new --property dataport.timestamp_policy=on_send
- [corba_cdr][push][periodic][all]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=all --property dataport.timestamp_policy=on_send
- [corba_cdr][push][periodic][fifo]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=fifo --property dataport.timestamp_policy=on_send
- [corba_cdr][push][periodic][skip]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=skip --property dataport.timestamp_policy=on_send
- [corba_cdr][push][periodic][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=new --property dataport.timestamp_policy=on_send
- [shared_memory][push][periodic][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.interface_type=shared_memory --property dataport.timestamp_policy=on_send
- [direct][push][new][][on_received]
- ConsoleInのrtc.confに以下を追加してConsoleInを起動する。
manager.modules.load_path:./RTMExamples/SimpleIO manager.modules.preload: ConsoleOut manager.components.precreate: ConsoleOut
- rtcon でポートを接続する
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.interface_type=direct --property dataport.dataflow_type=push --property dataport.timestamp_policy=on_send
- ConsoleInのrtc.confに以下を追加してConsoleInを起動する。
on_read¶
- [corba_cdr][push][flush]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=flush --property dataport.timestamp_policy=on_read
- [corba_cdr][push][new][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=new --property dataport.timestamp_policy=on_read
- [corba_cdr][push][new][skip]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=skip --property dataport.publisher.skip_count=1 --property dataport.timestamp_policy=on_read
- [corba_cdr][push][new][all]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=all --property dataport.timestamp_policy=on_read
- [corba_cdr][push][new][fifo]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=fifo --property dataport.timestamp_policy=on_read
- [corba_cdr][push][periodic][all]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=all --property dataport.timestamp_policy=on_read
- [corba_cdr][push][periodic][fifo]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=fifo --property dataport.timestamp_policy=on_read
- [corba_cdr][push][periodic][skip]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=skip --property dataport.timestamp_policy=on_read
- [corba_cdr][push][periodic][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=new --property dataport.timestamp_policy=on_read
- [shared_memory][push]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.interface_type=shared_memory --property dataport.timestamp_policy=on_read
on_write¶
- [corba_cdr][push][new][all]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=all --property dataport.timestamp_policy=on_write
- [corba_cdr][push][new][fifo]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=fifo --property dataport.timestamp_policy=on_write
- [corba_cdr][push][new][skip]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=skip --property dataport.publisher.skip_count=1 --property dataport.timestamp_policy=on_write
- [corba_cdr][push][new][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=new --property dataport.publisher.push_policy=new --property dataport.timestamp_policy=on_write
- [corba_cdr][push][periodic][all]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=all --property dataport.timestamp_policy=on_write
- [corba_cdr][push][periodic][fifo]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=fifo --property dataport.timestamp_policy=on_write
- [corba_cdr][push][periodic][skip]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=skip --property dataport.timestamp_policy=on_write
- [corba_cdr][push][periodic][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.subscription_type=periodic --property dataport.push_rate=1 --property dataport.publisher.push_policy=new --property dataport.timestamp_policy=on_write
- [shared_memory][push][periodic][new]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.interface_type=shared_memory --property dataport.timestamp_policy=on_write
- [direct][push][new][][on_write]
- [direct][pull][new][][on_write]
- ConsoleInのrtc.confに以下を追加してConsoleInを起動する。
manager.modules.load_path:./RTMExamples/SimpleIO manager.modules.preload: ConsoleOut manager.components.precreate: ConsoleOut
- rtcon でポートを接続する
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.interface_type=direct --property dataport.dataflow_type=push --property dataport.timestamp_policy=on_write
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.interface_type=direct --property dataport.dataflow_type=pull --property dataport.timestamp_policy=on_write
- ConsoleInのrtc.confに以下を追加してConsoleInを起動する。
- [corba_cdr][pull][new][][on_write]
rtcon ./localhost/.host_cxt/ConsoleIn0.rtc:out ./localhost/.host_cxt/ConsoleOut0.rtc:in --property dataport.dataflow_type=pull --property dataport.timestamp_policy=on_write
操作