Asti kinect control example

Typically: "How do I... ", "How can I... " questions
Post Reply
jesdefer
Posts: 9
Joined: 28 Jun 2016, 16:04

Asti kinect control example

Post by jesdefer » 21 May 2017, 11:15

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

coppelia
Site Admin
Posts: 7445
Joined: 14 Dec 2012, 00:25

Re: Asti kinect control example

Post by coppelia » 22 May 2017, 13:43

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

jesdefer
Posts: 9
Joined: 28 Jun 2016, 16:04

Re: Asti kinect control example

Post by jesdefer » 22 May 2017, 18:46

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.

jesdefer
Posts: 9
Joined: 28 Jun 2016, 16:04

Re: Asti kinect control example

Post by jesdefer » 23 May 2017, 19:01

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

Post Reply