load a lua script in a

2012/2/7 <goepfert [dot] benoit [..] ...>

> I tried the following instructions :
>
> In my file ComponentA.cpp :
> ...
> this->getProvider("scripting")->runScript("deploy.ops");
> ...
>
> and in deploy.ops (as shown by willy) :
> loadService("Deployer","Lua")
> Lua.exec_file("deploy.lua")
>
> but it doesn't work and I get the following errors :
>
> #rosrun ocl deployer-gnulinux -s connect.xml
> 0.186 [ ERROR ][ScriptingService] deploy.ops :Parse error at line 1: No
> method "loadService" registered for the object or task "ComponentA".
>
> What's the problem?
>

You can only do this in a deployer component !
I already opened a thread about the possibility to use loadService in
"normal" component. People are shared on it.

>
> Best regards,
>
> Benoit
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

load a lua script in a

On Tue, Feb 7, 2012 at 9:41 PM, Willy Lambert <lambert [dot] willy [..] ...> wrote:
>
>
> 2012/2/7 <goepfert [dot] benoit [..] ...>
>
>> I tried the following instructions :
>>
>> In my file ComponentA.cpp :
>> ...
>> this->getProvider("scripting")->runScript("deploy.ops");
>> ...
>>
>> and in deploy.ops (as shown by willy) :
>> loadService("Deployer","Lua")
>> Lua.exec_file("deploy.lua")
>>
>> but it doesn't work and I get the following errors :
>>
>> #rosrun ocl deployer-gnulinux -s connect.xml
>> 0.186 [ ERROR  ][ScriptingService] deploy.ops :Parse error at line 1: No
>> method "loadService" registered for the object or task "ComponentA".
>>
>> What's the problem?
>
>
> You can only do this in a deployer component !
> I already opened a thread about the possibility to use loadService in
> "normal" component. People are shared on it.

Adding this is trivial, as the attachment shows. Is it such a common
use case ? Others ?

Peter

load a lua script in a cpp component

I've added the method loadService in my TaskContext.cpp but then, what should I do in my cpp component to load the LUA script?