[openrtm-users 00399] Generated template code from RtcTemplate

2 posts / 0 new
Last post
root
Offline
Last seen: 4 days 13 hours ago
Joined: 2009-06-23 14:31
[openrtm-users 00399] Generated template code from RtcTemplate

Dear Sir or Madam,
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?
Should I add it manually or is there a way from RtcTemplate to generate it automatically?

Thank you for your kind attention.

Best regards,

Undefined
root
Offline
Last seen: 4 days 13 hours ago
Joined: 2009-06-23 14:31
[openrtm-users 00400] Generated template code from RtcTemplate

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.

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