Using deploye with lua

Hi

I am using a ROS/Orocos envirronment.

If I do rosrun ocl deployer and try to load my component then things work:

Deployer [S]> import ("two")
= true

Deployer [S]> loadComponent("Alpha", "TWO::Alpha_Impl")
Alpha constructed !
= true

---
folliwing the Lua Cookbook:

rosrun ocl deployer -s deploymentDriver.ops
----

import("ocl")

//load the lua service
loadService ("Deployer","Lua")

//execute your deployment file
Lua.exec_file("luaDeploymentScript.lua")
----

and "luaDeploymentScript.lua" =

Using deploye with lua

Hi Hugo,

I suggest you to try the following:

tc = rtt.getTC()

--get import and loadComponent
import = depl:getOperation("import")
loadComponent = depl:getOperation("loadComponent")

--import the packages (you don't need to do "depl:import" at this point)
import("two")

Using deploye with lua

Sorry, I forgot to copy this line:

depl = tc

or you can also directly call:

import = tc:getOperation("import")
loadComponent = tc:getOperation("loadComponent")

Nicola

2013/7/26 Nicola Preda <nicola [dot] preda [..] ...>

> Hi Hugo,
>
> I suggest you to try the following:
>
> tc = rtt.getTC()
>
> --get import and loadComponent
> import = depl:getOperation("import")
> loadComponent = depl:getOperation("loadComponent")
>
> --import the packages (you don't need to do "depl:import" at this point)
> import("two")

Using deploye with lua

it works

thank you

On Fri, Jul 26, 2013 at 4:07 PM, Nicola Preda <nicola [dot] preda [..] ...> wrote:
> Sorry, I forgot to copy this line:
>
> depl = tc
>
> or you can also directly call:
>
> import = tc:getOperation("import")
> loadComponent = tc:getOperation("loadComponent")
>
> Nicola
>
>
> 2013/7/26 Nicola Preda <nicola [dot] preda [..] ...>
>>
>> Hi Hugo,
>>
>> I suggest you to try the following:
>>
>> tc = rtt.getTC()
>>
>> --get import and loadComponent
>> import = depl:getOperation("import")
>> loadComponent = depl:getOperation("loadComponent")
>>
>> --import the packages (you don't need to do "depl:import" at this point)
>> import("two")

Using deploye with lua

You don't need to explicitly get these operations if you import the
`rttlib` lua module at the beginning of your lua script:

```
import("rttlib")
```

-j

On Sat, Jul 27, 2013 at 10:57 AM, Hugo A Garcia <hugo [dot] a [dot] garcia [..] ...>
wrote:

> it works
>
> thank you
>
> On Fri, Jul 26, 2013 at 4:07 PM, Nicola Preda <nicola [dot] preda [..] ...>
> wrote:
> > Sorry, I forgot to copy this line:
> >
> > depl = tc
> >
> > or you can also directly call:
> >
> > import = tc:getOperation("import")
> > loadComponent = tc:getOperation("loadComponent")
> >
> > Nicola
> >
> >
> > 2013/7/26 Nicola Preda <nicola [dot] preda [..] ...>
> >>
> >> Hi Hugo,
> >>
> >> I suggest you to try the following:
> >>
> >> tc = rtt.getTC()
> >>
> >> --get import and loadComponent
> >> import = depl:getOperation("import")
> >> loadComponent = depl:getOperation("loadComponent")
> >>
> >> --import the packages (you don't need to do "depl:import" at this point)
> >> import("two")
> >> -- create components
> >> loadComponent("Alpha", "TWO::Alpha_Impl")
> >>
> >> I suppose that in this case (mixed ops/lua deployment) you can't
> directly
> >> access the methods of the Deployer and so you need to get them
> manually: I
> >> don't know if this can be considered a bug.
> >>
> >> I hope this can be helpful.
> >>
> >> Have a nice day,
> >> Nicola
> >>
> >>
> >> 2013/7/26 Hugo A Garcia <hugo [dot] a [dot] garcia [..] ...>
> >>>
> >>> Hi
> >>>
> >>> I am using a ROS/Orocos envirronment.
> >>>
> >>> If I do rosrun ocl deployer and try to load my component then things
> >>> work:
> >>>
> >>> Deployer [S]> import ("two")
> >>> = true
> >>>
> >>> Deployer [S]> loadComponent("Alpha", "TWO::Alpha_Impl")
> >>> Alpha constructed !
> >>> = true
> >>>
> >>> ---
> >>> folliwing the Lua Cookbook:
> >>>
> >>> rosrun ocl deployer -s deploymentDriver.ops
> >>> ----
> >>>
> >>> import("ocl")
> >>>
> >>> //load the lua service
> >>> loadService ("Deployer","Lua")
> >>>
> >>> //execute your deployment file
> >>> Lua.exec_file("luaDeploymentScript.lua")
> >>> ----
> >>>
> >>> and "luaDeploymentScript.lua" =
> >>>
> >>> -- deploy_app.lua
> >>> tc = rtt.getTC()
> >>> -- depl = tc:getPeer("Deployer")
> >>> depl = tc
> >>>
> >>> -- import components, requires correctly setup RTT_COMPONENT_PATH or
> >>> -- ROS_PACKAGE_PATH
> >>> -- depl:import("ocl")
> >>>
> >>> depl:import("two")
> >>>
> >>> -- create components
> >>> depl:loadComponent("Alpha", "TWO::Alpha_Impl")
> >>>
> >>> ----
> >>>
> >>> I get the following error:
> >>>
> >>> hacker@hacker-VirtualBox:~/modelling/workspace/two/deployment$ rosrun
> >>> ocl deployer -s deploymentDriver.ops
> >>> Real-time memory: 517904 bytes free of 524288 allocated.
> >>> 0.081 [ ERROR ][ScriptingService] LuaService 'Deployer':
> >>> luaDeploymentScript.lua:10: attempt to call method 'import' (a nil
> >>> value)
> >>> Switched to : Deployer
> >>>
> >>> ----
> >>>
> >>> Help please.
> >>>
> >>> -H
> >>> --
> >>> Orocos-Users mailing list
> >>> Orocos-Users [..] ...
> >>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
> >>
> >>
> >
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

Using deploye with lua

By which I mean:

```
require("rttlib")
```

On Tue, Oct 7, 2014 at 11:17 PM, Jonathan Bohren <jonathan [dot] bohren [..] ...>
wrote:

> You don't need to explicitly get these operations if you import the
> `rttlib` lua module at the beginning of your lua script:
>
> ```
> import("rttlib")
> ```
>
> -j
>
> On Sat, Jul 27, 2013 at 10:57 AM, Hugo A Garcia <hugo [dot] a [dot] garcia [..] ...>
> wrote:
>
>> it works
>>
>> thank you
>>
>> On Fri, Jul 26, 2013 at 4:07 PM, Nicola Preda <nicola [dot] preda [..] ...>
>> wrote:
>> > Sorry, I forgot to copy this line:
>> >
>> > depl = tc
>> >
>> > or you can also directly call:
>> >
>> > import = tc:getOperation("import")
>> > loadComponent = tc:getOperation("loadComponent")
>> >
>> > Nicola
>> >
>> >
>> > 2013/7/26 Nicola Preda <nicola [dot] preda [..] ...>
>> >>
>> >> Hi Hugo,
>> >>
>> >> I suggest you to try the following:
>> >>
>> >> tc = rtt.getTC()
>> >>
>> >> --get import and loadComponent
>> >> import = depl:getOperation("import")
>> >> loadComponent = depl:getOperation("loadComponent")
>> >>
>> >> --import the packages (you don't need to do "depl:import" at this
>> point)
>> >> import("two")
>> >> -- create components
>> >> loadComponent("Alpha", "TWO::Alpha_Impl")
>> >>
>> >> I suppose that in this case (mixed ops/lua deployment) you can't
>> directly
>> >> access the methods of the Deployer and so you need to get them
>> manually: I
>> >> don't know if this can be considered a bug.
>> >>
>> >> I hope this can be helpful.
>> >>
>> >> Have a nice day,
>> >> Nicola
>> >>
>> >>
>> >> 2013/7/26 Hugo A Garcia <hugo [dot] a [dot] garcia [..] ...>
>> >>>
>> >>> Hi
>> >>>
>> >>> I am using a ROS/Orocos envirronment.
>> >>>
>> >>> If I do rosrun ocl deployer and try to load my component then things
>> >>> work:
>> >>>
>> >>> Deployer [S]> import ("two")
>> >>> = true
>> >>>
>> >>> Deployer [S]> loadComponent("Alpha", "TWO::Alpha_Impl")
>> >>> Alpha constructed !
>> >>> = true
>> >>>
>> >>> ---
>> >>> folliwing the Lua Cookbook:
>> >>>
>> >>> rosrun ocl deployer -s deploymentDriver.ops
>> >>> ----
>> >>>
>> >>> import("ocl")
>> >>>
>> >>> //load the lua service
>> >>> loadService ("Deployer","Lua")
>> >>>
>> >>> //execute your deployment file
>> >>> Lua.exec_file("luaDeploymentScript.lua")
>> >>> ----
>> >>>
>> >>> and "luaDeploymentScript.lua" =
>> >>>
>> >>> -- deploy_app.lua
>> >>> tc = rtt.getTC()
>> >>> -- depl = tc:getPeer("Deployer")
>> >>> depl = tc
>> >>>
>> >>> -- import components, requires correctly setup RTT_COMPONENT_PATH or
>> >>> -- ROS_PACKAGE_PATH
>> >>> -- depl:import("ocl")
>> >>>
>> >>> depl:import("two")
>> >>>
>> >>> -- create components
>> >>> depl:loadComponent("Alpha", "TWO::Alpha_Impl")
>> >>>
>> >>> ----
>> >>>
>> >>> I get the following error:
>> >>>
>> >>> hacker@hacker-VirtualBox:~/modelling/workspace/two/deployment$ rosrun
>> >>> ocl deployer -s deploymentDriver.ops
>> >>> Real-time memory: 517904 bytes free of 524288 allocated.
>> >>> 0.081 [ ERROR ][ScriptingService] LuaService 'Deployer':
>> >>> luaDeploymentScript.lua:10: attempt to call method 'import' (a nil
>> >>> value)
>> >>> Switched to : Deployer
>> >>>
>> >>> ----
>> >>>
>> >>> Help please.
>> >>>
>> >>> -H
>> >>> --
>> >>> Orocos-Users mailing list
>> >>> Orocos-Users [..] ...
>> >>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>> >>
>> >>
>> >
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>
>