How to configure property value in XML configure file?

Hi,<br>In the rtt-exercise-1.6.1/controller-1-solution, when I deploy it with controller.cpf, it shows me <br>&lt;code&gt;<br>0.017 [ Info&nbsp;&nbsp; ][PropertyLoader:configure] Configuring TaskContext &#39;Controller&#39; with &#39;./deployment/controller.cpf&#39;.<br>
0.018 [ ERROR&nbsp; ][refreshProperties] Could not find Property double Kp in source.<br>0.018 [ ERROR&nbsp; ][DeploymentComponent::configureComponents] Failed to configure properties for component Controller<br>&lt;/code&gt; <br><br>
But in fact Kp is in source file &quot;Controller.hpp&quot; and that file said &quot;the Kp property should have been read from an xml file &quot;controller.cpf&quot;&quot;.<br><br>What&#39;s that meanning? Should I load Kp in &quot;controller.cpf&quot;, but how?<br>
<br><br>Best,<br>Liu<br>

How to configure property value in XML configure file?

On Monday 09 February 2009 11:00:30 guoliang liu wrote:
> Hi,
> In the rtt-exercise-1.6.1/controller-1-solution, when I deploy it with
> controller.cpf, it shows me
> &#10;&gt; 0.017 [ Info   ][PropertyLoader:configure] Configuring TaskContext&#10;&gt; &#039;Controller&#039; with &#039;./deployment/controller.cpf&#039;.&#10;&gt; 0.018 [ ERROR  ][refreshProperties] Could not find Property double Kp in&#10;&gt; source.&#10;&gt; 0.018 [ ERROR  ][DeploymentComponent::configureComponents] Failed to&#10;&gt; configure properties for component Controller&#10;&gt;
>
> But in fact Kp is in source file "Controller.hpp" and that file said "the
> Kp property should have been read from an xml file "controller.cpf"".
>
> What's that meanning? Should I load Kp in "controller.cpf", but how?

I've prepared a new rtt-exercises release v1.6.2. You can find it on the
webpage or here:

http://people.mech.kuleuven.be/~orocos/pub/stable/examples/rtt/tutorial/

Peter

How to configure property value in XML configure file?

On Monday 09 February 2009 11:00:30 guoliang liu wrote:
> Hi,
> In the rtt-exercise-1.6.1/controller-1-solution, when I deploy it with
> controller.cpf, it shows me
> &#10;&gt; 0.017 [ Info   ][PropertyLoader:configure] Configuring TaskContext&#10;&gt; &#039;Controller&#039; with &#039;./deployment/controller.cpf&#039;.&#10;&gt; 0.018 [ ERROR  ][refreshProperties] Could not find Property double Kp in&#10;&gt; source.&#10;&gt; 0.018 [ ERROR  ][DeploymentComponent::configureComponents] Failed to&#10;&gt; configure properties for component Controller&#10;&gt;
>
> But in fact Kp is in source file "Controller.hpp" and that file said "the
> Kp property should have been read from an xml file "controller.cpf"".
>
> What's that meanning? Should I load Kp in "controller.cpf", but how?

It's an error in the exercise. Don't use controller.cpf: that file only loads a
component, it does not configure its properties. Create a file Controller.cpf
with the Kp property:

&#10;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;                                                                                 &#10;&lt;!DOCTYPE properties SYSTEM &quot;cpf.dtd&quot;&gt;                                                                                 &#10;&lt;properties&gt;&#10;&#10;&lt;simple name=&quot;Kp&quot; type=&quot;double&quot;&gt;&lt;value&gt;10.0&lt;/value&gt;&lt;/simple&gt;&#10;&#10;&lt;/properties&gt;&#10;

And list that file in application.cpf.

Peter

How to configure property value in XML configure file?

Hi,<br>Thanks a lot for replying. It works but I have another problem:<br>&lt;code&gt;<br>0.061 [ Info&nbsp;&nbsp; ][ParserScriptingAccess::loadStateMachine] Parsing file statemachine.osd<br>0.064 [ Info&nbsp;&nbsp; ][ParserScriptingAccess::loadStateMachine] Building int Constant &#39;TIMER_ID&#39; with value 1<br>
0.068 [ ERROR&nbsp; ][ParserScriptingAccess::loadStateMachine] statemachine.osd :Parse error at line 50: Syntactic error: From TaskContext &#39;ModeSwitch&#39;: Task &#39;ModeSwitch&#39; has no task or object &#39;ModeSwitch&#39;.<br>
<br>&lt;/code&gt;<br><br>In the file &quot;statemachine.osd&quot;,the line 50 is <br>&quot;transition ModeSwitch.switchMode(new_mode)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (new_mode == &quot;manual&quot;) select Manual;<br>&quot;<br><br>I can not see anything is wrong here...<br>
Can you give me some hint on it?<br><br>Best,<br>Liu<br><br><div class="gmail_quote">2009/2/9 Peter Soetens <span dir="ltr">&lt;<a href="mailto:peter [dot] soetens [..] ...">peter [dot] soetens [..] ...</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Monday 09 February 2009 11:00:30 guoliang liu wrote:<br>
&gt; Hi,<br>
&gt; In the rtt-exercise-1.6.1/controller-1-solution, when I deploy it with<br>
&gt; controller.cpf, it shows me<br>
&gt; &lt;code&gt;<br>
&gt; 0.017 [ Info &nbsp; ][PropertyLoader:configure] Configuring TaskContext<br>
&gt; &#39;Controller&#39; with &#39;./deployment/controller.cpf&#39;.<br>
&gt; 0.018 [ ERROR &nbsp;][refreshProperties] Could not find Property double Kp in<br>
&gt; source.<br>
&gt; 0.018 [ ERROR &nbsp;][DeploymentComponent::configureComponents] Failed to<br>
&gt; configure properties for component Controller<br>
&gt; &lt;/code&gt;<br>
&gt;<br>
&gt; But in fact Kp is in source file &quot;Controller.hpp&quot; and that file said &quot;the<br>
&gt; Kp property should have been read from an xml file &quot;controller.cpf&quot;&quot;.<br>
&gt;<br>
&gt; What&#39;s that meanning? Should I load Kp in &quot;controller.cpf&quot;, but how?<br>
<br>
</div></div>It&#39;s an error in the exercise. Don&#39;t use controller.cpf: that file only loads a<br>
component, it does not configure its properties. Create a file Controller.cpf<br>
with the Kp property:<br>
<br>
&lt;br&gt;&#10;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br&gt;&#10;&amp;lt;!DOCTYPE properties SYSTEM &amp;quot;cpf.dtd&amp;quot;&amp;gt;&lt;br&gt;&#10;&amp;lt;properties&amp;gt;&lt;br&gt;&#10;&lt;br&gt;&#10;&amp;lt;simple name=&amp;quot;Kp&amp;quot; type=&amp;quot;double&amp;quot;&amp;gt;&amp;lt;value&amp;gt;10.0&amp;lt;/value&amp;gt;&amp;lt;/simple&amp;gt;&lt;br&gt;&#10;&lt;br&gt;&#10;&amp;lt;/properties&amp;gt;&lt;br&gt;&#10;<br>
<br>
And list that file in application.cpf.<br>
<br>
Peter<br>
<font color="#888888">--<br>
Peter Soetens -- FMTC -- &lt;<a href="http://www.fmtc.be" target="_blank">http://www.fmtc.be</a>&gt;<br>
</font></blockquote></div><br>

How to configure property value in XML configure file?

On Monday 09 February 2009 12:00:57 guoliang liu wrote:
> Hi,
> Thanks a lot for replying. It works but I have another problem:
> &#10;&gt; 0.061 [ Info   ][ParserScriptingAccess::loadStateMachine] Parsing file&#10;&gt; statemachine.osd&#10;&gt; 0.064 [ Info   ][ParserScriptingAccess::loadStateMachine] Building int&#10;&gt; Constant &#039;TIMER_ID&#039; with value 1&#10;&gt; 0.068 [ ERROR  ][ParserScriptingAccess::loadStateMachine] statemachine.osd&#10;&gt;&#10;&gt; :Parse error at line 50: Syntactic error: From TaskContext &#039;ModeSwitch&#039;:&#10;&gt;&#10;&gt; Task &#039;ModeSwitch&#039; has no task or object &#039;ModeSwitch&#039;.&#10;&gt;&#10;&gt;
>
> In the file "statemachine.osd",the line 50 is
> "transition ModeSwitch.switchMode(new_mode)
> if (new_mode == "manual") select Manual;
> "
>
> I can not see anything is wrong here...
> Can you give me some hint on it?

The tutorial seems to be in pretty bad shape. The Error is that you're already
in the ModeSwitch component, so you need to omit the 'ModeSwitch.' before
switchMode. There were other errors in there as well.

I tested and uploaded a new version, 1.6.3. I moved statemachine.osd to the
deployment/ subdirectory, fixed the application.cpf file and the compilation
errors you warned about.

Thanks for testing,
Peter

How to configure property value in XML configure file?

Thanks a lot ..In the end I finish this exercise...<br><br><br><div class="gmail_quote">2009/2/9 Peter Soetens <span dir="ltr">&lt;<a href="mailto:peter [dot] soetens [..] ...">peter [dot] soetens [..] ...</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Monday 09 February 2009 12:00:57 guoliang liu wrote:<br>
&gt; Hi,<br>
&gt; Thanks a lot for replying. It works but I have another problem:<br>
&gt; &lt;code&gt;<br>
&gt; 0.061 [ Info &nbsp; ][ParserScriptingAccess::loadStateMachine] Parsing file<br>
&gt; statemachine.osd<br>
&gt; 0.064 [ Info &nbsp; ][ParserScriptingAccess::loadStateMachine] Building int<br>
&gt; Constant &#39;TIMER_ID&#39; with value 1<br>
&gt; 0.068 [ ERROR &nbsp;][ParserScriptingAccess::loadStateMachine] statemachine.osd<br>
&gt;<br>
&gt; :Parse error at line 50: Syntactic error: From TaskContext &#39;ModeSwitch&#39;:<br>
&gt;<br>
&gt; Task &#39;ModeSwitch&#39; has no task or object &#39;ModeSwitch&#39;.<br>
&gt;<br>
&gt; &lt;/code&gt;<br>
&gt;<br>
&gt; In the file &quot;statemachine.osd&quot;,the line 50 is<br>
&gt; &quot;transition ModeSwitch.switchMode(new_mode)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (new_mode == &quot;manual&quot;) select Manual;<br>
&gt; &quot;<br>
&gt;<br>
&gt; I can not see anything is wrong here...<br>
&gt; Can you give me some hint on it?<br>
<br>
</div>The tutorial seems to be in pretty bad shape. The Error is that you&#39;re already<br>
in the ModeSwitch component, so you need to omit the &#39;ModeSwitch.&#39; before<br>
switchMode. There were other errors in there as well.<br>
<br>
I tested and uploaded a new version, 1.6.3. I moved statemachine.osd to the<br>
deployment/ subdirectory, fixed the application.cpf file and the compilation<br>
errors you warned about.<br>
<br>
Thanks for testing,<br>
<div><div></div><div class="Wj3C7c">Peter<br>
<br>
--<br>
Peter Soetens -- FMTC -- &lt;<a href="http://www.fmtc.be" target="_blank">http://www.fmtc.be</a>&gt;<br>
</div></div></blockquote></div><br>