passing arguments at deployment (non-lua/lua)

hi,

I'm using a lua file to deploy an application.
I also have this script to get into the old school taskbrowser
(see below)

Is it possible to give extra arguments with it?
In both stages:
*terminal->ops file
*ops file->lua file

many thanks in advance!

nick

rosrun ocl deployer-gnulinux -lwarning -s run.ops
(I'm looking for something like: rosrun ocl deployer-gnulinux -lwarning -s run.ops -c anotherfile.lua)

with run.ops :

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

//execute your deployment file
Lua.exec_file("yourLuaDeploymentFile.lua")
(I'm looking for something like: Lua.exec_file("yourLuaDeploymentFile.lua -c anotherfile.lua")

passing arguments at deployment (non-lua/lua)

On Wed, Apr 24, 2013 at 09:01:38AM +0800, Dominick Vanthienen wrote:
> hi,
>
> I'm using a lua file to deploy an application.
> I also have this script to get into the old school taskbrowser
> (see below)
>
> Is it possible to give extra arguments with it?
> In both stages:
> *terminal->ops file
> *ops file->lua file
>
> many thanks in advance!
>
> nick
>
> rosrun ocl deployer-gnulinux -lwarning -s run.ops
> (I'm looking for something like: rosrun ocl deployer-gnulinux -lwarning -s run.ops -c anotherfile.lua)
>
> with run.ops :
>
> //load the lua service
> loadService ("Deployer","Lua")
>
> //execute your deployment file
> Lua.exec_file("yourLuaDeploymentFile.lua")
> (I'm looking for something like: Lua.exec_file("yourLuaDeploymentFile.lua -c anotherfile.lua")

exec_file does not support arguments. As a workaround, you can set
variables in the service's lua context containing the information you
want to pass through. For the example of your "anotherfile.lua"
parameter:

Deployer [S]> Lua.exec_str("myfile=" + "'anotherfile.lua'")
= true

After this your script can use the myfile global variable to access
the information.

Markus

passing arguments at deployment from terminal to deploy_file.ops

On 04/24/2013 04:38 PM, Markus Klotzbuecher wrote:
> On Wed, Apr 24, 2013 at 09:01:38AM +0800, Dominick Vanthienen wrote:
>> hi,
>>
>> I'm using a lua file to deploy an application.
>> I also have this script to get into the old school taskbrowser
>> (see below)
>>
>> Is it possible to give extra arguments with it?
>> In both stages:
>> *terminal->ops file
>> *ops file->lua file
>>
>> many thanks in advance!
>>
>> nick
>>
>> rosrun ocl deployer-gnulinux -lwarning -s run.ops
>> (I'm looking for something like: rosrun ocl deployer-gnulinux -lwarning -s run.ops -c anotherfile.lua)
>>
>> with run.ops :
>>
>> //load the lua service
>> loadService ("Deployer","Lua")
>>
>> //execute your deployment file
>> Lua.exec_file("yourLuaDeploymentFile.lua")
>> (I'm looking for something like: Lua.exec_file("yourLuaDeploymentFile.lua -c anotherfile.lua")
>
> exec_file does not support arguments. As a workaround, you can set
> variables in the service's lua context containing the information you
> want to pass through. For the example of your "anotherfile.lua"
> parameter:
>
> Deployer [S]> Lua.exec_str("myfile=" + "'anotherfile.lua'")
> = true
>
> After this your script can use the myfile global variable to access
> the information.

ok, thanks a lot!
is there also a way to get parameters from the terminal to the .ops file?

>
> Markus
>
>
>

passing arguments at deployment from terminal to deploy_file.ops

On Thu, Apr 25, 2013 at 12:06:52PM +0800, Dominick Vanthienen wrote:
>
>
> On 04/24/2013 04:38 PM, Markus Klotzbuecher wrote:
> >On Wed, Apr 24, 2013 at 09:01:38AM +0800, Dominick Vanthienen wrote:
> >>hi,
> >>
> >>I'm using a lua file to deploy an application.
> >>I also have this script to get into the old school taskbrowser
> >>(see below)
> >>
> >>Is it possible to give extra arguments with it?
> >>In both stages:
> >>*terminal->ops file
> >>*ops file->lua file
> >>
> >>many thanks in advance!
> >>
> >>nick
> >>
> >>rosrun ocl deployer-gnulinux -lwarning -s run.ops
> >>(I'm looking for something like: rosrun ocl deployer-gnulinux -lwarning -s run.ops -c anotherfile.lua)
> >>
> >>with run.ops :
> >>
> >>//load the lua service
> >>loadService ("Deployer","Lua")
> >>
> >>//execute your deployment file
> >>Lua.exec_file("yourLuaDeploymentFile.lua")
> >>(I'm looking for something like: Lua.exec_file("yourLuaDeploymentFile.lua -c anotherfile.lua")
> >
> >exec_file does not support arguments. As a workaround, you can set
> >variables in the service's lua context containing the information you
> >want to pass through. For the example of your "anotherfile.lua"
> >parameter:
> >
> >Deployer [S]> Lua.exec_str("myfile=" + "'anotherfile.lua'")
> > = true
> >
> >After this your script can use the myfile global variable to access
> >the information.
>
> ok, thanks a lot!
> is there also a way to get parameters from the terminal to the .ops file?

For this I would recommend a text editor :-)

Seriously, I think Peter added such a mechanism to the deployer,
search the archives...

Markus

passing arguments at deployment from terminal to deploy_file.ops

On Thu, Apr 25, 2013 at 9:01 AM, Markus Klotzbuecher <
markus [dot] klotzbuecher [..] ...> wrote:

> On Thu, Apr 25, 2013 at 12:06:52PM +0800, Dominick Vanthienen wrote:
> >
> >
> > On 04/24/2013 04:38 PM, Markus Klotzbuecher wrote:
> > >On Wed, Apr 24, 2013 at 09:01:38AM +0800, Dominick Vanthienen wrote:
> > >>hi,
> > >>
> > >>I'm using a lua file to deploy an application.
> > >>I also have this script to get into the old school taskbrowser
> > >>(see below)
> > >>
> > >>Is it possible to give extra arguments with it?
> > >>In both stages:
> > >>*terminal->ops file
> > >>*ops file->lua file
> > >>
> > >>many thanks in advance!
> > >>
> > >>nick
> > >>
> > >>rosrun ocl deployer-gnulinux -lwarning -s run.ops
> > >>(I'm looking for something like: rosrun ocl deployer-gnulinux
> -lwarning -s run.ops -c anotherfile.lua)
> > >>
> > >>with run.ops :
> > >>
> > >>//load the lua service
> > >>loadService ("Deployer","Lua")
> > >>
> > >>//execute your deployment file
> > >>Lua.exec_file("yourLuaDeploymentFile.lua")
> > >>(I'm looking for something like:
> Lua.exec_file("yourLuaDeploymentFile.lua -c anotherfile.lua")
> > >
> > >exec_file does not support arguments. As a workaround, you can set
> > >variables in the service's lua context containing the information you
> > >want to pass through. For the example of your "anotherfile.lua"
> > >parameter:
> > >
> > >Deployer [S]> Lua.exec_str("myfile=" + "'anotherfile.lua'")
> > > = true
> > >
> > >After this your script can use the myfile global variable to access
> > >the information.
> >
> > ok, thanks a lot!
> > is there also a way to get parameters from the terminal to the .ops file?
>
> For this I would recommend a text editor :-)
>
> Seriously, I think Peter added such a mechanism to the deployer,
> search the archives...
>

You need to load the 'os' service (present in ocl) and then you can inspect
the argv/argc variables or read an environment variable using the
operations of that service ('help os')

Peter

passing arguments at deployment from terminal to deploy_file.ops

hi,

On 04/25/2013 09:29 AM, Peter Soetens wrote:
>
> On Thu, Apr 25, 2013 at 9:01 AM, Markus Klotzbuecher <markus [dot] klotzbuecher [..] ... <mailto:markus [dot] klotzbuecher [..] ...>> wrote:
>
> On Thu, Apr 25, 2013 at 12:06:52PM +0800, Dominick Vanthienen wrote:
> >
> >
> > On 04/24/2013 04:38 PM, Markus Klotzbuecher wrote:
> > >On Wed, Apr 24, 2013 at 09:01:38AM +0800, Dominick Vanthienen wrote:
> > >>hi,
> > >>
> > >>I'm using a lua file to deploy an application.
> > >>I also have this script to get into the old school taskbrowser
> > >>(see below)
> > >>
> > >>Is it possible to give extra arguments with it?
> > >>In both stages:
> > >>*terminal->ops file
> > >>*ops file->lua file
> > >>
> > >>many thanks in advance!
> > >>
> > >>nick
> > >>
> > >>rosrun ocl deployer-gnulinux -lwarning -s run.ops
> > >>(I'm looking for something like: rosrun ocl deployer-gnulinux -lwarning -s run.ops -c anotherfile.lua)
> > >>
> > >>with run.ops :
> > >>
> > >>//load the lua service
> > >>loadService ("Deployer","Lua")
> > >>
> > >>//execute your deployment file
> > >>Lua.exec_file("yourLuaDeploymentFile.lua")
> > >>(I'm looking for something like: Lua.exec_file("yourLuaDeploymentFile.lua -c anotherfile.lua")
> > >
> > >exec_file does not support arguments. As a workaround, you can set
> > >variables in the service's lua context containing the information you
> > >want to pass through. For the example of your "anotherfile.lua"
> > >parameter:
> > >
> > >Deployer [S]> Lua.exec_str("myfile=" + "'anotherfile.lua'")
> > > = true
> > >
> > >After this your script can use the myfile global variable to access
> > >the information.
> >
> > ok, thanks a lot!
> > is there also a way to get parameters from the terminal to the .ops file?
>
> For this I would recommend a text editor :-)
>
> Seriously, I think Peter added such a mechanism to the deployer,
> search the archives...
>
>
> You need to load the 'os' service (present in ocl) and then you can inspect the argv/argc variables or read an environment variable using the operations of that service
> ('help os')
late reply:
thanks, this works indeed for the environment variables :)
I only wonder how to get and use argv/argc variables:
1) since rosrun ocl deployer-gnulinux [args] allows only the predefined argument options, everything else gives exception or it uses as the name for the deployer, so how to
get here something I want to give with it?
2) I don't get with os.argv the options that where given with it, so what is it exactly that it should return?
eg. rosrun ocl deployer-gnulinux -lwarning -s run.ops
OR
./deployer-gnulinux -lwarning
gives:
Deployer [S]> os.argv
= { [ ], size = 0, capacity = 0 }
Or am I mistaken about the meaning of argv/argc

thanks in advance!
nick

>
> Peter
>

Ruben Smits's picture

passing arguments at deployment from terminal to deploy_file.ops

Hi Nick,

On Wed, Jul 17, 2013 at 6:49 PM, Dominick Vanthienen <
dominick [dot] vanthienen [..] ...> wrote:

> hi,
>
> On 04/25/2013 09:29 AM, Peter Soetens wrote:
> >
> > On Thu, Apr 25, 2013 at 9:01 AM, Markus Klotzbuecher <
> markus [dot] klotzbuecher [..] ... <mailto:
> markus [dot] klotzbuecher [..] ...>> wrote:
> >
> > On Thu, Apr 25, 2013 at 12:06:52PM +0800, Dominick Vanthienen wrote:
> > >
> > >
> > > On 04/24/2013 04:38 PM, Markus Klotzbuecher wrote:
> > > >On Wed, Apr 24, 2013 at 09:01:38AM +0800, Dominick Vanthienen
> wrote:
> > > >>hi,
> > > >>
> > > >>I'm using a lua file to deploy an application.
> > > >>I also have this script to get into the old school taskbrowser
> > > >>(see below)
> > > >>
> > > >>Is it possible to give extra arguments with it?
> > > >>In both stages:
> > > >>*terminal->ops file
> > > >>*ops file->lua file
> > > >>
> > > >>many thanks in advance!
> > > >>
> > > >>nick
> > > >>
> > > >>rosrun ocl deployer-gnulinux -lwarning -s run.ops
> > > >>(I'm looking for something like: rosrun ocl deployer-gnulinux
> -lwarning -s run.ops -c anotherfile.lua)
> > > >>
> > > >>with run.ops :
> > > >>
> > > >>//load the lua service
> > > >>loadService ("Deployer","Lua")
> > > >>
> > > >>//execute your deployment file
> > > >>Lua.exec_file("yourLuaDeploymentFile.lua")
> > > >>(I'm looking for something like:
> Lua.exec_file("yourLuaDeploymentFile.lua -c anotherfile.lua")
> > > >
> > > >exec_file does not support arguments. As a workaround, you can
> set
> > > >variables in the service's lua context containing the
> information you
> > > >want to pass through. For the example of your "anotherfile.lua"
> > > >parameter:
> > > >
> > > >Deployer [S]> Lua.exec_str("myfile=" + "'anotherfile.lua'")
> > > > = true
> > > >
> > > >After this your script can use the myfile global variable to
> access
> > > >the information.
> > >
> > > ok, thanks a lot!
> > > is there also a way to get parameters from the terminal to the
> .ops file?
> >
> > For this I would recommend a text editor :-)
> >
> > Seriously, I think Peter added such a mechanism to the deployer,
> > search the archives...
> >
> >
> > You need to load the 'os' service (present in ocl) and then you can
> inspect the argv/argc variables or read an environment variable using the
> operations of that service
> > ('help os')
> late reply:
> thanks, this works indeed for the environment variables :)
> I only wonder how to get and use argv/argc variables:
> 1) since rosrun ocl deployer-gnulinux [args] allows only the predefined
> argument options, everything else gives exception or it uses as the name
> for the deployer, so how to
> get here something I want to give with it?
> 2) I don't get with os.argv the options that where given with it, so what
> is it exactly that it should return?
> eg. rosrun ocl deployer-gnulinux -lwarning -s run.ops
> OR
> ./deployer-gnulinux -lwarning
> gives:
> Deployer [S]> os.argv
> = { [ ], size = 0, capacity = 0 }
> Or am I mistaken about the meaning of argv/argc
>
>
you need a double dash to escape the pickup of standard arguments:

deployer-gnulinux -- -foo -bar
Deployer [S]> loadService("Deployer","os")
= true

Deployer [S]> os.argv
= { [deployer-gnulinux, -foo, -bar ], size = 3, capacity = 3 }

Deployer [S]>

Ruben

> thanks in advance!
> nick
>
> >
> > Peter
> >
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

passing arguments at deployment from terminal to deploy_file.ops

On 07/18/2013 09:09 AM, Ruben Smits wrote:
> Hi Nick,
>
>
>
>
> On Wed, Jul 17, 2013 at 6:49 PM, Dominick Vanthienen <dominick [dot] vanthienen [..] ... <mailto:dominick [dot] vanthienen [..] ...>> wrote:
>
> hi,
>
> On 04/25/2013 09:29 AM, Peter Soetens wrote:
> >
> > On Thu, Apr 25, 2013 at 9:01 AM, Markus Klotzbuecher <markus [dot] klotzbuecher [..] ... <mailto:markus [dot] klotzbuecher [..] ...>
> <mailto:markus [dot] klotzbuecher [..] ... <mailto:markus [dot] klotzbuecher [..] ...>>> wrote:
> >
> > On Thu, Apr 25, 2013 at 12:06:52PM +0800, Dominick Vanthienen wrote:
> > >
> > >
> > > On 04/24/2013 04:38 PM, Markus Klotzbuecher wrote:
> > > >On Wed, Apr 24, 2013 at 09:01:38AM +0800, Dominick Vanthienen wrote:
> > > >>hi,
> > > >>
> > > >>I'm using a lua file to deploy an application.
> > > >>I also have this script to get into the old school taskbrowser
> > > >>(see below)
> > > >>
> > > >>Is it possible to give extra arguments with it?
> > > >>In both stages:
> > > >>*terminal->ops file
> > > >>*ops file->lua file
> > > >>
> > > >>many thanks in advance!
> > > >>
> > > >>nick
> > > >>
> > > >>rosrun ocl deployer-gnulinux -lwarning -s run.ops
> > > >>(I'm looking for something like: rosrun ocl deployer-gnulinux -lwarning -s run.ops -c anotherfile.lua)
> > > >>
> > > >>with run.ops :
> > > >>
> > > >>//load the lua service
> > > >>loadService ("Deployer","Lua")
> > > >>
> > > >>//execute your deployment file
> > > >>Lua.exec_file("yourLuaDeploymentFile.lua")
> > > >>(I'm looking for something like: Lua.exec_file("yourLuaDeploymentFile.lua -c anotherfile.lua")
> > > >
> > > >exec_file does not support arguments. As a workaround, you can set
> > > >variables in the service's lua context containing the information you
> > > >want to pass through. For the example of your "anotherfile.lua"
> > > >parameter:
> > > >
> > > >Deployer [S]> Lua.exec_str("myfile=" + "'anotherfile.lua'")
> > > > = true
> > > >
> > > >After this your script can use the myfile global variable to access
> > > >the information.
> > >
> > > ok, thanks a lot!
> > > is there also a way to get parameters from the terminal to the .ops file?
> >
> > For this I would recommend a text editor :-)
> >
> > Seriously, I think Peter added such a mechanism to the deployer,
> > search the archives...
> >
> >
> > You need to load the 'os' service (present in ocl) and then you can inspect the argv/argc variables or read an environment variable using the operations of that service
> > ('help os')
> late reply:
> thanks, this works indeed for the environment variables :)
> I only wonder how to get and use argv/argc variables:
> 1) since rosrun ocl deployer-gnulinux [args] allows only the predefined argument options, everything else gives exception or it uses as the name for the deployer, so how to
> get here something I want to give with it?
> 2) I don't get with os.argv the options that where given with it, so what is it exactly that it should return?
> eg. rosrun ocl deployer-gnulinux -lwarning -s run.ops
> OR
> ./deployer-gnulinux -lwarning
> gives:
> Deployer [S]> os.argv
> = { [ ], size = 0, capacity = 0 }
> Or am I mistaken about the meaning of argv/argc
>
>
> you need a double dash to escape the pickup of standard arguments:
>
> deployer-gnulinux -- -foo -bar
> Deployer [S]> loadService("Deployer","os")
> = true
>
> Deployer [S]> os.argv
> = { [deployer-gnulinux, -foo, -bar ], size = 3, capacity = 3 }
>
> Deployer [S]>
>
> Ruben
ah, right, should have known this :)
thanks a lot!

nick
>
> thanks in advance!
> nick
>
> >
> > Peter
> >
> --
> Orocos-Users mailing list
> Orocos-Users [..] ... <mailto:Orocos-Users [..] ...>
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>
>
>
> --
> Ruben Smits, Phd
> Chief Technology Officer
> Intermodalics BVBA
> +32479511786
> www.intermodalics.eu <http://www.intermodalics.eu>