A simple C++ class for Kinect Motor and LED

864 views
Skip to first unread message

Heresy

unread,
Feb 24, 2012, 7:53:28 AM2/24/12
to openn...@googlegroups.com
I make a C++ class KinectControl that can control the motor and LED of Kinect. Also, can get the information, about current angle, motor status of Kinect.

The source code is in: https://skydrive.live.com/?cid=E0070FB8ECF9015F&id=E0070FB8ECF9015F%2113558&sc=documents, only one header file, with a simple usage example.

This is based on the post "Easy way to control Kinect motor through OpenNI", and reference the USB protocol from OpenKinect.

This class only use the first Kinect now.
I hope  that I can identify different Kinect device (mapping to xn::Device), but have no idea how to do that...
Does any one know how to do this?


The blog about this in Chinese:

エルマン 「Herman」

unread,
Feb 28, 2012, 2:28:25 AM2/28/12
to openn...@googlegroups.com
Hi Heresy.

Before all, thanks for sharing the code.

I'm Trying to use it with my kinect, but in the example.cpp,
xKinectControl.Create() is always != XN_STATUS_OK.

I have been trying to understand how to know what is the problem, but
I really don't understand how to start.

I'm working in ubuntu 10.10 32 bits

I compiled it with:

g++ example.cpp -I/home/herman/Tesis/Development/Kinect/OpenNI/Include -lOpenNI

When i run it, it always shows:

libusb couldn't open USB device /dev/bus/usb/001/024: Permission denied.
libusb requires write access to USB device nodes.

So, I tryied sudo:

sudo ./a.out

but xKinectControl.Create() is always diferetnt than XN_STATUS_OK


I am really interested in rotating my kinect for some test for my
thesis project.


Thanks for your time.

I appreciate your help. Thanks in advance

> --
> You received this message because you are subscribed to the Google Groups
> "OpenNI" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/openni-dev/-/t3hK31sKWycJ.
> 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.

Heresy

unread,
Feb 28, 2012, 7:22:37 AM2/28/12
to openn...@googlegroups.com
sorry...
I only use it in Windows...
I am not sure if the method works on Linux.

hben8814於 2012年2月28日星期二UTC+8下午3時28分25秒寫道:


> For more options, visit this group at
> http://groups.google.com/group/openni-dev?hl=en.


hben8814於 2012年2月28日星期二UTC+8下午3時28分25秒寫道:

> openni-dev+unsubscribe@googlegroups.com.

Longman

unread,
Feb 28, 2012, 8:10:05 AM2/28/12
to openn...@googlegroups.com
Does it have to be targeted at x64? I am getting linker errors like this: https://groups.google.com/d/msg/openni-dev/T_CeVW_d8ig/l6ngof3sUIkJ
using Visual Studio 2010 on Win7 x64

Heresy

unread,
Feb 28, 2012, 9:02:14 PM2/28/12
to openn...@googlegroups.com
This code should work with MSVC 2010 on Windows 7 x64 with OpenNI64.lib.

Longman於 2012年2月28日星期二UTC+8下午9時10分05秒寫道:

RonX

unread,
Mar 2, 2012, 4:53:58 PM3/2/12
to OpenNI
Did you ever figure this out? i have the same problem.
> > in: https://skydrive.live.com/?cid=E0070FB8ECF9015F&id=E0070FB8ECF9015F%2...,
> > only one header file, with a simple usage example.
>
> > This is based on the post "Easy way to control Kinect motor through OpenNI",
> > and reference the USB protocol from OpenKinect.
>
> > This class only use the first Kinect now.
> > I hope that I can identify different Kinect device (mapping to xn::Device),
> > but have no idea how to do that...
> > Does any one know how to do this?
>
> > The blog about this in Chinese:
> >http://kheresy.wordpress.com/2012/02/24/control_kinect_hardware_under...
Reply all
Reply to author
Forward
0 new messages