How to configure property value in XML configure file?

Hi,
In the rtt-exercise-1.6.1/controller-1-solution, when I deploy it with controller.cpf, it shows me
<code>
0.017 [ Info   ][PropertyLoader:configure] Configuring TaskContext 'Controller' with './deployment/controller.cpf'.

0.018 [ ERROR  ][refreshProperties] Could not find Property double Kp in source.
0.018 [ ERROR  ][DeploymentComponent::configureComponents] Failed to configure properties for component Controller
</code>


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?



Best,
Liu

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
>

> 0.017 [ Info   ][PropertyLoader:configure] Configuring TaskContext
> 'Controller' with './deployment/controller.cpf'.
> 0.018 [ ERROR  ][refreshProperties] Could not find Property double Kp in
> source.
> 0.018 [ ERROR  ][DeploymentComponent::configureComponents] Failed to
> configure properties for component Controller
> 

>
> 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
>

> 0.017 [ Info   ][PropertyLoader:configure] Configuring TaskContext
> 'Controller' with './deployment/controller.cpf'.
> 0.018 [ ERROR  ][refreshProperties] Could not find Property double Kp in
> source.
> 0.018 [ ERROR  ][DeploymentComponent::configureComponents] Failed to
> configure properties for component Controller
> 

>
> 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:

<?xml version="1.0" encoding="UTF-8"?>                                                                                 
<!DOCTYPE properties SYSTEM "cpf.dtd">                                                                                 
<properties>
 
<simple name="Kp" type="double"><value>10.0</value></simple>
 
</properties>

And list that file in application.cpf.

Peter

How to configure property value in XML configure file?

Hi,
Thanks a lot for replying. It works but I have another problem:
<code>
0.061 [ Info   ][ParserScriptingAccess::loadStateMachine] Parsing file statemachine.osd
0.064 [ Info   ][ParserScriptingAccess::loadStateMachine] Building int Constant 'TIMER_ID' with value 1

0.068 [ ERROR  ][ParserScriptingAccess::loadStateMachine] statemachine.osd :Parse error at line 50: Syntactic error: From TaskContext 'ModeSwitch': Task 'ModeSwitch' has no task or object 'ModeSwitch'.


</code>

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?

Best,
Liu


2009/2/9 Peter Soetens <span dir="ltr"><peter [dot] soetens [..] ...><span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

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

> <code>

> 0.017 [ Info   ][PropertyLoader:configure] Configuring TaskContext

> 'Controller' with './deployment/controller.cpf'.

> 0.018 [ ERROR  ][refreshProperties] Could not find Property double Kp in

> source.

> 0.018 [ ERROR  ][DeploymentComponent::configureComponents] Failed to

> configure properties for component Controller

> </code>

>

> 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:



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




And list that file in application.cpf.



Peter

<font color="#888888">--

Peter Soetens -- FMTC -- <http://www.fmtc.be>

<font><blockquote>


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:
>

> 0.061 [ Info   ][ParserScriptingAccess::loadStateMachine] Parsing file
> statemachine.osd
> 0.064 [ Info   ][ParserScriptingAccess::loadStateMachine] Building int
> Constant 'TIMER_ID' with value 1
> 0.068 [ ERROR  ][ParserScriptingAccess::loadStateMachine] statemachine.osd
>
> :Parse error at line 50: Syntactic error: From TaskContext 'ModeSwitch':
>
> Task 'ModeSwitch' has no task or object 'ModeSwitch'.
>
> 

>
> 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...



2009/2/9 Peter Soetens <span dir="ltr"><peter [dot] soetens [..] ...><span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

On Monday 09 February 2009 12:00:57 guoliang liu wrote:

> Hi,

> Thanks a lot for replying. It works but I have another problem:

> <code>

> 0.061 [ Info   ][ParserScriptingAccess::loadStateMachine] Parsing file

> statemachine.osd

> 0.064 [ Info   ][ParserScriptingAccess::loadStateMachine] Building int

> Constant 'TIMER_ID' with value 1

> 0.068 [ ERROR  ][ParserScriptingAccess::loadStateMachine] statemachine.osd

>

> :Parse error at line 50: Syntactic error: From TaskContext 'ModeSwitch':

>

> Task 'ModeSwitch' has no task or object 'ModeSwitch'.

>

> </code>

>

> 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



--

Peter Soetens -- FMTC -- <http://www.fmtc.be>

<blockquote>