lua rfsm problem

Hello,

I'm trying to use rfsm with RTT as shown in the LuaCookbook (9th section) : http://www.orocos.org/wiki/orocos/toolchain/luacookbook

Unfortunately, i get the following errors :

- with deploy.ops

$ rosrun ocl rttlua-gnulinux -i deploy.lua OROCOS RTTLua 1.0-beta3 / Lua 5.1.4 (gnulinux) INFO: created undeclared connector root.initial 0.162 [ ERROR ][/opt/ros/diamondback/stacks/orocos_toolchain_ros/ocl/bin/rttlua-gnulinux::main()] LuaComponent 'Supervisor': error calling function configureHook: launch_fsm.lua:27: attempt to call field 'advise' (a nil value)

and

-with deploy.lua

$ rosrun ocl deployer-gnulinux -s deploy.ops INFO: created undeclared connector root.initial 0.199 [ ERROR ][ScriptingService] LuaComponent 'Supervisor': error calling function configureHook: launch_fsm.lua:27: attempt to call field 'advise' (a nil value)

Any idea to fix it?

Best regards,

Benoit

lua rfsm problem

On Tue, Jan 24, 2012 at 04:36:50PM +0000, goepfert [dot] benoit [..] ... wrote:
> Hello,
>
> I'm trying to use rfsm with RTT as shown in the LuaCookbook (9th section) :
> http://www.orocos.org/wiki/orocos/toolchain/luacookbook
>
> Unfortunately, i get the following errors :
>
> - with deploy.ops
>
> $ rosrun ocl rttlua-gnulinux -i deploy.lua
> [rosrun] You have chosen a non-unique executable, please pick one of the
> following:
> 1) /opt/ros/diamondback/stacks/orocos_toolchain_ros/ocl/bin/rttlua-gnulinux
> 2)
> /opt/ros/diamondback/stacks/orocos_toolchain_ros/ocl/install/bin/rttlua-gnulinux
> #? 1
> OROCOS RTTLua 1.0-beta3 / Lua 5.1.4 (gnulinux)
> INFO: created undeclared connector root.initial
> 0.162 [ ERROR
> ][/opt/ros/diamondback/stacks/orocos_toolchain_ros/ocl/bin/rttlua-gnulinux::main()]
> LuaComponent 'Supervisor': error calling function configureHook:
> launch_fsm.lua:27: attempt to call field 'advise' (a nil value)
>
> and
>
> -with deploy.lua
>
> $ rosrun ocl deployer-gnulinux -s deploy.ops
> INFO: created undeclared connector root.initial
> 0.199 [ ERROR ][ScriptingService] LuaComponent 'Supervisor': error calling
> function configureHook: launch_fsm.lua:27: attempt to call field 'advise' (a
> nil value)
> Switched to : Deployer
>
> Any idea to fix it?

The problem seems that your utils.lua is old, which versions of rfsm
and ocl are you using? Could you send me the output of

$ lua -l utils -e "print(utils.VERSION)"
0.92

The workaround suggested by Steven is OK, however it will cause
problems once you use other extensions such as time events or event
memory.

This issue will be fixed in the upcoming version by introducing a
dedicated API to install hooks by means of two functions
post_step_hook_add(fsm, hook, where) and pre_step_hook_add(fsm, hook,
where).

Best regards and sorry for the late reply!

Markus

lua rfsm problem

2012/1/24 <goepfert [dot] benoit [..] ...>:
> Hello,
>
> I'm trying to use rfsm with RTT as shown in the LuaCookbook (9th section) :
> http://www.orocos.org/wiki/orocos/toolchain/luacookbook
>
> Unfortunately, i get the following errors :
>
> - with deploy.ops
>
> $ rosrun ocl rttlua-gnulinux -i deploy.lua
> [rosrun] You have chosen a non-unique executable, please pick one of the
> following:
> 1) /opt/ros/diamondback/stacks/orocos_toolchain_ros/ocl/bin/rttlua-gnulinux
> 2)
> /opt/ros/diamondback/stacks/orocos_toolchain_ros/ocl/install/bin/rttlua-gnulinux
> #? 1
> OROCOS RTTLua 1.0-beta3 / Lua 5.1.4 (gnulinux)
> INFO: created undeclared connector root.initial
> 0.162 [ ERROR
> ][/opt/ros/diamondback/stacks/orocos_toolchain_ros/ocl/bin/rttlua-gnulinux::main()]
> LuaComponent 'Supervisor': error calling function configureHook:
> launch_fsm.lua:27: attempt to call field 'advise' (a nil value)
>
> and
>
> -with deploy.lua
>
> $ rosrun ocl deployer-gnulinux -s deploy.ops
> INFO: created undeclared connector root.initial
> 0.199 [ ERROR  ][ScriptingService] LuaComponent 'Supervisor': error calling
> function configureHook: launch_fsm.lua:27: attempt to call field 'advise' (a
> nil value)
>    Switched to : Deployer
>
> Any idea to fix it?

The line failing is

fsm.step_hook=utils.advise('before', fsm.step_hook,
rfsm_rtt.gen_write_fqn(fqn_out))

Can you try replacing it with

fsm.step_hook = rfsm_rtt.gen_write_fqn(fqn_out)

I know I had some problems with it before, and there is definitely a
difference in implementation, which I do not remember however. We'll
have to wait for the LUA expert to clarify it out, but replacing the
line solved it in my case.

Steven

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

lua rfsm problem

Thanks it works.