C# on Kinect

304 views
Skip to first unread message

Asim

unread,
Dec 19, 2010, 10:20:41 AM12/19/10
to OpenNI
Hey,

I have just moved to using OpenNi on Kinect (from PS). I had quite a
hard time getting it up and running (avin's posts were a big help!). I
had written some code earlier on C# using the sensor provided by
primesense (using ManagedNite.dll).

This might seem a little silly... but how do i make my project point
to the right XML file for the sensor. I tried creating a "Data
\SampleTracking.xml" in my Debug directory, but wasn't successful.

Any ideas?

Asim

unread,
Dec 19, 2010, 10:27:26 AM12/19/10
to OpenNI
[SOLVED]... as i said... it was a silly question :)

Woohoo... Kinect + NITE + C# = Its gonna be a long long night :)

Rui Marinho

unread,
Dec 20, 2010, 6:53:00 PM12/20/10
to OpenNI
How did u accomplish, when i try to use the wrapper i get that the xml
file is not found also...

mitchBCAA

unread,
Dec 20, 2010, 9:24:35 PM12/20/10
to OpenNI
any code sample to startwiht c# on openni ?

Joshua Blake

unread,
Dec 20, 2010, 9:33:41 PM12/20/10
to openn...@googlegroups.com
I uploaded this C# sample:
 
It just tracks sessions and hand points and outputs them to the console.

--
You received this message because you are subscribed to the Google Groups "OpenNI" group.
To post to this group, send email to openn...@googlegroups.com.
To unsubscribe from this group, send email to openni-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.


lukas...@arbuzz.eu

unread,
Dec 21, 2010, 3:49:10 AM12/21/10
to OpenNI
Hi Joshua,
I've got a problem running your app - I get ManagedNite.XnMException
when in context.Init(); .

Samples from Prime Sense and OpenNI works well.
> > openni-dev+...@googlegroups.com<openni-dev%2Bunsubscribe@googlegrou­ps.com>
> > .

Joshua Blake

unread,
Dec 21, 2010, 4:01:05 AM12/21/10
to openn...@googlegroups.com

Can you post a stacktrace?

> To unsubscribe from this group, send email to openni-dev+...@googlegroups.com.

lukas...@arbuzz.eu

unread,
Dec 21, 2010, 4:39:06 AM12/21/10
to OpenNI
Sure,

" w System.Environment.GetStackTrace(Exception e, Boolean
needFileInfo)\r\n w System.Environment.get_StackTrace()\r\n w
NITEconsole.Program.Main(String[] args) w D:\\OpenNI\\NITEconsole\
\Program.cs:wiersz 22\r\n w
System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
args)\r\n w System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)\r\n w
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r
\n w System.Threading.ThreadHelper.ThreadStart_Context(Object state)
\r\n w System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)\r\n w
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)\r\n w
System.Threading.ThreadHelper.ThreadStart()"

wiersz = line
w = in

Thanks for helping.


On 21 Gru, 10:01, Joshua Blake <joshbl...@gmail.com> wrote:
> Can you post a stacktrace?
> On Dec 21, 2010 3:49 AM, "lukasz.m...@arbuzz.eu" <lukasz.m...@arbuzz.eu>

Szymon Kobalczyk

unread,
Dec 21, 2010, 4:51:07 AM12/21/10
to OpenNI
Hi Łukasz,
Two common causes:
1. ManagedNite.dll is hard coded to look for the config file called
openni.xml in the data subfolder of directory where exe is run.
2. Make sure you have entered the NITE license number during installation.

Best,
-Szymon

-----Oryginalna wiadomość-----
From: lukas...@arbuzz.eu
Sent: Tuesday, December 21, 2010 10:39 AM
To: OpenNI
Subject: [OpenNI-dev] Re: C# on Kinect

Sure,

Thanks for helping.

openni-dev+...@googlegroups.com.

lukas...@arbuzz.eu

unread,
Dec 21, 2010, 5:39:08 AM12/21/10
to OpenNI
Hi Szymon,
I managed to pass ontext.Init(); line - Kinect's IR light strats to
glow when debugging, so I've got the connection. However I get an
error very next line :
sessionManager = new XnMSessionManager(context, "Wave", "RaiseHand");
(ManagedNite.XnMException again).

I think the problem might be in an XML file - there are no definitions
for production nodes (wave and raise hand).

My XML:

***
<OpenNI>
<Licenses>
<License vendor="PrimeSense" key="0KOIk2JeIBYClPWVnMoRKn5cdY4"/>
</Licenses>
<Log writeToConsole="true" writeToFile="false">
<LogLevel value="3"/>
<Masks>
<Mask name="ALL" on="false"/>
</Masks>
<Dumps>
</Dumps>
</Log>
<ProductionNodes>
<Node type="Image" name="Image1">
<Configuration>
<MapOutputMode xRes="640" yRes="480" FPS="30"/>
<Mirror on="true"/>
</Configuration>
</Node>
<Node type="Depth" name="Depth1">
<Configuration>
<MapOutputMode xRes="640" yRes="480" FPS="30"/>
<Mirror on="true"/>
</Configuration>
</Node>
</ProductionNodes>
</OpenNI>
***

I triad to add nodes

<Node type="Gesture" />
<Node type="Hands" />

but then program wont pass context.Init(); again.

Thanks for your help,
Łukasz


On 21 Gru, 10:51, "Szymon Kobalczyk" <skobalc...@gmail.com> wrote:
> Hi Łukasz,
> Two common causes:
> 1. ManagedNite.dll is hard coded to look for the config file called
> openni.xml in the data subfolder of directory where exe is run.
> 2. Make sure you have entered the NITE license number during installation.
>
> Best,
> -Szymon
>
> -----Oryginalna wiadomość-----
> From: lukasz.m...@arbuzz.eu

Rui Marinho

unread,
Dec 21, 2010, 5:47:11 AM12/21/10
to OpenNI
yap same here to. in another topic about some c# extensions to the
wrapper there's a sample that works.

On 21 Dez, 10:39, "lukasz.m...@arbuzz.eu" <lukasz.m...@arbuzz.eu>
wrote:
> > For more options, visit this group athttp://groups.google.com/group/openni-dev?hl=en.- Ocultar texto citado -
>
> - Mostrar texto citado -

Szymon Kobalczyk

unread,
Dec 21, 2010, 5:48:17 AM12/21/10
to OpenNI
Łukasz,
Below is the file I'm using. One difference I see is addition of the User
node (this loads the scene analyzer).
Did check if you entered the NITE license key during installation? You can
just run the setup again to make sure.

( Btw. Did you get the email I sent you directly ?)

<OpenNI>
<Licenses>
<License vendor="PrimeSense" key=""/>


</Licenses>
<Log writeToConsole="true" writeToFile="false">

<!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) -->


<LogLevel value="3"/>
<Masks>
<Mask name="ALL" on="false"/>
</Masks>
<Dumps>
</Dumps>
</Log>
<ProductionNodes>

<Node type="Depth">


<Configuration>
<MapOutputMode xRes="640" yRes="480" FPS="30"/>
<Mirror on="true"/>
</Configuration>
</Node>

<!--Node type="Scene" /-->
<Node type="User" />


<Node type="Gesture"/>
<Node type="Hands"/>

</ProductionNodes>
</OpenNI>

-----Oryginalna wiadomość-----
From: lukas...@arbuzz.eu
Sent: Tuesday, December 21, 2010 11:39 AM

lukas...@arbuzz.eu

unread,
Dec 22, 2010, 9:35:47 AM12/22/10
to OpenNI
Problem solved - during NITE Installation I entered license number
without last character ('='), which I've thought wasn't part of it.
I reinstalled it with correct license and it worked.

Thanks for help.

Davide Orazio Montersino

unread,
Dec 29, 2010, 5:01:29 AM12/29/10
to OpenNI
Ok, going to prove my ignorance here :)

So, I downloaded
http://www.google.com/url?sa=D&q=http://dl.dropbox.com/u/7911268/managed%2520OpenNI.zip&usg=AFQjCNE2PyPLvbJsSN4Aru4M9WIu17NjEw

There are two project: a brand new (empty) wpf project and a console
one.

I start the console and everything works fine, except the fact that
nothing does happen.

The IR rays start to glow, and in the several times I've been running
the project, I got the sessionManager_FocusStartDetected event fired.

However, trying to wave my hand or raise them I could not get other
events fired.

The real question is: How can I get some visualization? I'd like to
put the depth camera on a wpf image, for example.

Thanks in advance for help.

On Dec 22, 3:35 pm, "lukasz.m...@arbuzz.eu" <lukasz.m...@arbuzz.eu>
wrote:
Reply all
Reply to author
Forward
0 new messages