[openrtm-users 01597] knowing the LifeCycleState of service provider

2 個の投稿 / 0 new
最終投稿
root
オフライン
Last seen: 22時間 3分 前
登録日: 2009-06-23 14:31
[openrtm-users 01597] knowing the LifeCycleState of service provider

Dear Sirs,

I'd like to know how to get the lifecycle state of a service provider
component from one of its consumer.

I've got the following issue : One of my component, during his
onExecuted function, calls a service from another component. During the
activation of the complete set of components, if this component is
activated before the service provider, the service call will fail,
setting the component in a error state. I'd like to avoid any order in
the component's activation, thus I'd like to check 1-if a service
provider is connected (done using getObject) and 2-then also check if it
has been activated (LifeCycleState == ACTIVE).

Could you explain me how to handle this issue ?

Thank you very much,
Best regards,

Matthieu

未定義
root
オフライン
Last seen: 22時間 3分 前
登録日: 2009-06-23 14:31
[openrtm-users 01607] knowing the LifeCycleState of service pro

Dear Matthieu-san

> Dear Sirs,
>
> I'd like to know how to get the lifecycle state of a service provider
> component from one of its consumer.
>
> I've got the following issue : One of my component, during his onExecuted
> function, calls a service from another component. During the activation of
> the complete set of components, if this component is activated before the
> service provider, the service call will fail, setting the component in a
> error state. I'd like to avoid any order in the component's activation, thus
> I'd like to check 1-if a service provider is connected (done using
> getObject) and 2-then also check if it has been activated (LifeCycleState ==
> ACTIVE).
>
> Could you explain me how to handle this issue ?

Currently we are not providing easy way to get status of other end of
RTC on the port.
But if you already have the RTC 's reference on the port
you might get the status in the following code.

const char* stateName[] = {
"CREATED_STATE", "INACTIVE_STATE", "ACTIVE_STATE", "ERROR_STATE" };
RTC::ExecutionContextList_var ec = rtc->get_owned_contexts();
for (CORBA::ULong i(0); i < ec.length(); ++i)
{
LifeCycleState state = ec[i]->get_component_state(rtc);
std::cout << "State on EC" << i << " is " << stateName[state] << std::endl;
}

See the following IDL reference
http://www.openrtm.org/OpenRTM-aist/documents/IDLReference-en/namespaces.html

I would like to discuss to provide such kind of operation in the next
version of OpenRTM.
e.g. PortBase::getConnectedRtcs(), getConnectedRtcsState(), etc...

But the easiest way would be just calling the service and catching
the exception. If you want to avoid the side effect of operation call,
you can call CORBA::Object::_non_existent() operation.
But this method cannot distinguish whether the other RTC is
dead and whether it is just inactive state.

Best regards,
Noriaki Ando

>
>
> Thank you very much,
> Best regards,
>
> Matthieu
>
>
>

Log in or register to post comments

ダウンロード

最新バージョン : 2.1.0-RELESE

統計

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

OpenRTM@Github

OpenRTM-aist GitHubサイト

ROS

Robot Operating System

Choreonoid

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

DAQ-Middleware

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

産総研が提供するRTC集

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