Hi, I wrote a simple function in my run.ops script. The function is also listed in the operations of the Deployer. I can call the function from commandline "Deployer [R]> functionName()" but if I try to call the operation from another lua script (from itasc_supervisro.lua) I get "attempt to call field 'functionName' (a nil value)". To call the function from lua I use:
peertable.Deployer.createTopic()
Call an operation written in "run.ops" from a lua script
On Mon, May 06, 2013 at 04:11:05PM +0200, alain [dot] scialoja [..] ... wrote:
> Hi,
> I wrote a simple function in my run.ops script. The function is also listed
> in the operations of the Deployer. I can call the function from commandline
> "Deployer [R]> functionName()" but if I try to call the operation from
> another lua script (from itasc_supervisro.lua) I get "attempt to call field
> 'functionName' (a nil value)". To call the function from lua I use:
> peertable.Deployer.createTopic()
>
> and I'm sure the Deployer is in the peertable.
> What am I doing wrong?
How do you add this function? Please provide more detail.
Does printing the interface of the Deployer
>=peertable.Deployer
show your function?
Markus
Call an operation written in "run.ops" from a lua script
Thank you, I solved it using:
I still don't understand why with the Deployer I need to import the Operation while not with other components... but i works. :)
Alain
Call an operation written in "run.ops" from a lua script
The function is added as follow in the Orocos script:
If I print the interface from the lua state machine, the function is printed in the Operations. I used:
to call the function I use:
I just realized I can't call also the predefined Operations of the Deployer (e.g. getComponentTypes()) I already defined some Operations in custom Orocos Components (C++) and I'm calling these from the state machine without any problem.