[choreonoid-users 00014] Re: [choreonoid-users-ja 00110] Proper way to load RTC Controller

Shin'ichiro Nakaoka s.nakaoka at aist.go.jp
Fri Nov 8 13:47:39 JST 2013


Hi Luis,

I'm sorry, I couldn't send replies because there have been some events
in the last two weeks.

> I tried to change the Periodic rate of the BodyRTC but it is still running
> at 500Hz. I was reading the RTC plugin and it seems that if the Periodic
> rate is 0.0 it will use the simulation period as the controller period
> correct? Maybe it is always loading 0 regardless if i write a value at the
> Periodic rate parameter.

First of all, the "Periodic rate" property of a BodyRTCItem only
specifies the periodic rate of the virtual robot RTC. The RTC basically
handles its ports to send and receive data, so the periodic rate of the
RTC does not affect the simulation so much. But if you add other RTCs to
the execution context of the virtual robot RTC, the periodic rate
property specifies that of the added RTCs.

Probably what you want to do is change the periodic rate of the
controller RTC specified by the "Controller module name" property.
Currently the periodic rate can be only specified by using the config
file specified by the "Configuration file name" property.

For example, if you build the OpenRTM samples, "PA10Picup.conf" is in
the "lib/choreonoid-1.x/rtc" directory. You can specify the periodic
rate of the "OpenRTM-PA10Pickup.cnoid" sample by adding the
"periodic-rate" property to this file as follows:

out-port = q:JOINT_VALUE
connection = q:q
out-port = u_out:HAND_R,HAND_L:JOINT_TORQUE
connection = u_out:u_in
in-port = u_in:JOINT_TORQUE
connection = u_in:u_out
periodic-rate = PA10PickupControllerRTC0:0.5

In this case, the controller's onExecute function is called once when
the simulation loop steps two times.

In this way, you can specify how much the controller RTC is executed.

Apparently this way of specifying the periodic rate is not good. The
property should be specified by using the RTC's built-in configuration
system such as rtc.conf. I'd like to consider this in the next version
of Choreonoid.

Please let me have a little more time to answer to your previous questions.


-- 
Shin'ichiro Nakaoka <s.nakaoka �� aist.go.jp>



More information about the choreonoid-users mailing list