Checking connection before connecting two ports

4 個の投稿 / 0 new
最終投稿
Amigoshan
オフライン
Last seen: 9年 6ヶ月 前
登録日: 2011-12-01 14:18
Checking connection before connecting two ports

Dear All:

There’s one problem bothering me for months.

I’d like to connect two ports by programming with Java API. This is no problem. The problem is I want to check whether these two ports have already been connected before I do the connecting.

Here’s my way.

1. I can get the connection information by this method: ConnectorProfile PortService.get_connector_profiles();

2. I can get the two ports: PortService ConnectorProfile.ports;

3. Each ports’ name, profile, owner, etc.

The key problem is how to decide whether two PortServices are identical, or whether two RTObjects are indentical. So that I can decide whether the port has been connected or not.

Due to there could be different RT-components with the same name under different path, it makes this problem more complicated.

Please help me out. Thanks a lot!

Wenshan

英語
Ando Noriaki
オフライン
Last seen: 1年 9ヶ月 前
登録日: 2011-09-04 17:20
[openrtm-users 02811] Checking connection before connecting two

Hello,

You can know whether a port is identical by using
CORBA::Object::is_equivalent() method.

For example,

if (this_port.is_equivalent(that_port)) {
// this_port is that_port
}

Best regards,
Noriaki Ando

2013/6/1 :
> Dear All: There’s one problem bothering me for months. I’d like to
> connect two ports by programming with Java API. This is no problem. The
> problem is I want to check whether these two ports have already been
> connected before I do the connecting. Here’s my way. 1. I can get the
> connection information by this method: ConnectorProfile
> PortService.get_connector_profiles(); 2. I can get the two ports:
> PortService
> ConnectorProfile.ports; 3. Each ports’ name, profile, owner, etc. The key
> problem is how to decide whether two PortServices are identical, or whether
> two RTObjects are indentical. So that I can decide whether the port has been
> connected or not. Due to there could be different RT-components with the
> same
> name under different path, it makes this problem more complicated. Please
> help me out. Thanks a lot! Wenshan
>
> _______________________________________________
> openrtm-users mailing list
> openrtm-users@openrtm.org
> http://www.openrtm.org/mailman/listinfo/openrtm-users
_______________________________________________
openrtm-users mailing list
openrtm-users@openrtm.org
http://www.openrtm.org/mailman/listinfo/openrtm-users

Amigoshan
オフライン
Last seen: 9年 6ヶ月 前
登録日: 2011-12-01 14:18
[openrtm-users 02811] Checking connection before connecting two

Mr. Noriaki: Thank you so much! How could I have not notice this method before. Great thanks!

Wenshan

Amigoshan
オフライン
Last seen: 9年 6ヶ月 前
登録日: 2011-12-01 14:18
[openrtm-users 02812] (no subject)

Mr. Noriaki: Thank you so much! How could I have not notice this method
before. Great thanks! Wenshan

_______________________________________________
openrtm-users mailing list
openrtm-users@openrtm.org
http://www.openrtm.org/mailman/listinfo/openrtm-users

コメントを投稿するにはログインまたはユーザー登録を行ってください

ダウンロード

最新バージョン : 2.0.1-RELESE

統計

Webサイト統計
ユーザ数:2195
プロジェクト統計
RTコンポーネント307
RTミドルウエア35
ツール22
文書・仕様書2

Choreonoid

モーションエディタ/シミュレータ

OpenHRP3

動力学シミュレータ

OpenRTP

統合開発プラットフォーム

産総研RTC集

産総研が提供するRTC集

TORK

東京オープンソースロボティクス協会

DAQ-Middleware

ネットワーク分散環境でデータ収集用ソフトウェアを容易に構築するためのソフトウェア・フレームワーク