Page 1 of 1

Asti kinect control example

Posted: 21 May 2017, 11:15
by jesdefer
Hi!

I have connected my kinnect to my pc and checked that interface to kinect.ttm works. But, when I have runned astiKinectControl.ttt example without modifying nothing, it appears the following errors:

Code: Select all

Lua runtime error: [string "SCRIPT Asti"]:26: attempt to index local 'client' (a nil value)
stack traceback:
	[string "SCRIPT Asti"]:256: in function <[string "SCRIPT Asti"]:256>
	[string "SCRIPT Asti"]:26: in function 'writeSocketData'
	[string "SCRIPT Asti"]:69: in function <[string "SCRIPT Asti"]:63>
	[C]: in function 'xpcall'
	[string "SCRIPT Asti"]:256: in main chunk
It seems like client varible is not defined, but it is:

Code: Select all

local client=socket.tcp()
What is it going wrong?
Thanks!

Jesus

Re: Asti kinect control example

Posted: 22 May 2017, 13:43
by coppelia
Hello

Not sure about your full code, but client seems to be a local. So are you in the same scope as where the local was defined?

Cheers

Re: Asti kinect control example

Posted: 22 May 2017, 18:46
by jesdefer
Hi Coppelia,

I haven't modified the sample code. I am not pretty sure what are you trying to say about being in the same scope.
Thanks!

Jesus.

Re: Asti kinect control example

Posted: 23 May 2017, 19:01
by jesdefer
Hi again Coppelia,

I have finally understood what you was meanning. In sample code lines 233 and 234 client and socket are defined as local, but they aren't:

Code: Select all

socket=require("socket")
 client=socket.tcp()
Thanks!

Jesus