Checking connection before connecting two ports

4 posts / 0 new
Last post
Amigoshan
Offline
Last seen: 9 years 6 months ago
Joined: 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

English
Ando Noriaki
Offline
Last seen: 1 year 9 months ago
Joined: 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
Offline
Last seen: 9 years 6 months ago
Joined: 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
Offline
Last seen: 9 years 6 months ago
Joined: 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

Log in or register to post comments

Download

latest Releases : 2.0.0-RELESE

2.0.0-RELESE Download page

Number of Projects

Choreonoid

Motion editor/Dynamics simulator

OpenHRP3

Dynamics simulator

OpenRTP

Integrated Development Platform

AIST RTC collection

RT-Components collection by AIST

TORK

Tokyo Opensource Robotics Association

DAQ-Middleware

Middleware for DAQ (Data Aquisition) by KEK