[openrtm-users 00400] Re: Generated template code from RtcTemplate

Masayuki Shimizu masayuki.shimizu @ aist.go.jp
2008年 3月 25日 (火) 20:54:25 JST


Hello.

> I see that OpenRTM-aist only has several generated RTC classes such as on_initialize, on_finalize, and so on on its template.
> If I want to add another RTC class  such as the class from RTObject interface or another class from another interface, what should I do?

RtcTemplate provides the following interface definitions on the header file.

virtual ReturnCode_t 	onInitialize ()
virtual ReturnCode_t 	onFinalize ()
virtual ReturnCode_t 	onStartup (RTC::UniqueId ec_id)
virtual ReturnCode_t 	onShutdown (RTC::UniqueId ec_id)
virtual ReturnCode_t 	onActivated (RTC::UniqueId ec_id)
virtual ReturnCode_t 	onDeactivated (RTC::UniqueId ec_id)
virtual ReturnCode_t 	onExecute (RTC::UniqueId ec_id)
virtual ReturnCode_t 	onAborting (RTC::UniqueId ec_id)
virtual ReturnCode_t 	onError (RTC::UniqueId ec_id)
virtual ReturnCode_t 	onReset (RTC::UniqueId ec_id)
virtual ReturnCode_t 	onStateUpdate (RTC::UniqueId ec_id)
virtual ReturnCode_t 	onRateChanged (RTC::UniqueId ec_id)

I think these are enough to write your components in most cases. 
To use them, uncomment the definition on .h file and implement the function on .cpp file. 

> Should I add it manually or is there a way from RtcTemplate to generate it automatically?

If you want to use other interfaces, you have to write them manually. 
But, I do not recommend to override virtual interfaces except the above ones 
even if they can be overridden, because unexpected troubles might occur. 

--------------------
Masayuki Shimizu

Postdoctoral Fellow
Task Intelligence Research Group
Intelligent Systems Research Institute
National Institute of 
Advanced Industrial Science and Technology (AIST)
Central 2, 1-1-1, Umezono, Tsukuba, Ibaraki 305-8568, JAPAN
Tel: +81-29-861-5952
Fax: +81-29-861-5971
Email: masayuki.shimizu @ aist.go.jp
       chaser @ ieee.org
URL: http://unit.aist.go.jp/is/taskint/



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