accessing services with lua

Hi Nick,

I'm CC'ing the ML...

On Thu, Dec 08, 2011 at 06:24:51PM +0100, Dominick Vanthienen wrote:
> hi, don't you put the youbot in velocity mode somewhere in your stacking demo?
> I can't :(, and can't find it in your code

It is in youbot_master_rtt/lua/youbot_test.lua

function aset_cmode_vel() arm:setControllerMode(2) end

> I tried (in lua):
>
> print("control mode is" .. ApplicationSupPeertable.youbot_driver:Arm1:control_mode:last())
> ApplicationSupPeertable.youbot_driver:Arm1:setControllerMode(2)

You need to use provides() to access services:

ApplicationSupPeertable.youbot_driver:provides("Arm1"):setControllerMode(2)

> and also . before Arm1, but none worked
> (ApplicationSupPeertable.youbot_driver is ok...)
>
> I know also:
> that setControllerMode returns a boolean
> that setControllerMode accepts the 2

Markus

accessing services with lua

Hi,

On 12/09/2011 08:42 AM, Markus Klotzbuecher wrote:
> Hi Nick,
>
> I'm CC'ing the ML...
>
> On Thu, Dec 08, 2011 at 06:24:51PM +0100, Dominick Vanthienen wrote:
>> hi, don't you put the youbot in velocity mode somewhere in your stacking demo?
>> I can't :(, and can't find it in your code
>
> It is in youbot_master_rtt/lua/youbot_test.lua
>
> function aset_cmode_vel() arm:setControllerMode(2) end
>
>> I tried (in lua):
>>
>> print("control mode is" .. ApplicationSupPeertable.youbot_driver:Arm1:control_mode:last())
>> ApplicationSupPeertable.youbot_driver:Arm1:setControllerMode(2)
>
> You need to use provides() to access services:
>
> ApplicationSupPeertable.youbot_driver:provides("Arm1"):setControllerMode(2)
and how do I set a property from another component (a peer)?
in rtt there is a function setProperty ("propertyname", value)
but not in lua?
I tried:
CartesianMotionPeertable["CC_" .. ComponentName]:setProperty("use_pose",0)
but this fails

nick
>
>> and also . before Arm1, but none worked
>> (ApplicationSupPeertable.youbot_driver is ok...)
>>
>> I know also:
>> that setControllerMode returns a boolean
>> that setControllerMode accepts the 2
>
> Markus
>

accessing services with lua

On Fri, Dec 09, 2011 at 03:22:57PM +0100, Dominick Vanthienen wrote:
> Hi,
>
> On 12/09/2011 08:42 AM, Markus Klotzbuecher wrote:
> > Hi Nick,
> >
> > I'm CC'ing the ML...
> >
> > On Thu, Dec 08, 2011 at 06:24:51PM +0100, Dominick Vanthienen wrote:
> >> hi, don't you put the youbot in velocity mode somewhere in your stacking demo?
> >> I can't :(, and can't find it in your code
> >
> > It is in youbot_master_rtt/lua/youbot_test.lua
> >
> > function aset_cmode_vel() arm:setControllerMode(2) end
> >
> >> I tried (in lua):
> >>
> >> print("control mode is" .. ApplicationSupPeertable.youbot_driver:Arm1:control_mode:last())
> >> ApplicationSupPeertable.youbot_driver:Arm1:setControllerMode(2)
> >
> > You need to use provides() to access services:
> >
> > ApplicationSupPeertable.youbot_driver:provides("Arm1"):setControllerMode(2)
> and how do I set a property from another component (a peer)?
> in rtt there is a function setProperty ("propertyname", value)
> but not in lua?
> I tried:
> CartesianMotionPeertable["CC_" .. ComponentName]:setProperty("use_pose",0)
> but this fails

Try

CartesianMotionPeertable["CC_" .. ComponentName]:getProperty("use_pose"):set(0)

See also http://www.orocos.org/wiki/orocos/toolchain/luacookbook#toc21

Best regards
Markus