Click here to Skip to main content
14,363,159 members
Rate this:
Please Sign up or sign in to vote.
See more:
I'm currently working on a c# program that uses Kinect to check the position of a person's hand. It then "moves" an image of a table that is displayed on a canvas according to the person's hand (x,y) to 4 positions: up, down, left or right.
I’d like to know if I can transfer the program I have already created using Visual C# 2010 and Kinect SDK to interact with NXT directly or via Microsoft Robotics Studio.
I want my code to communicate with NXT and activate a servomotor instead of changing the image position on the NUI. Would that be possible?

It doesn't have to be Lego NXT but any other system that would allow me to move servo motors via my program. I'd appreciate any ideas!

e.g: in this code Kinect tracks my right hand and if the conditions are met it displaces the image in Y (for up movement). Instead of that I'd like to know if I can write a code to send a signal to a servo motor via NXT in a not too complicated way.

if (wristRight.Z > shoulderRight.Z - 0.20 && wristRight.Z < shoulderRight.Z + 0.20)
                {
                    if (sideAngle >= 285 && sideAngle <= 320)
                    {
                        speed = 4;
                        positionY = positionY - speed;
                    }
                 .
                 .
                 .

Canvas.SetLeft(Table, positionX - Table.Width / 2);
Canvas.SetTop(Table, positionY - Table.Height / 2);
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Hi There,

Yes you can! And I have an article that details how to control your robot from C# here on CodeProject. Have a look here:

Basic Robot Control using NKH Mindsqualls Libraries[^]

It uses the NKH Mindsqualls library, you may wish to see if there is a new version. It works really well and my article shows how to do the basics which includes running motors.

Hope this helps,
Ed

Edit: Have a look at this page for a quick start guide to getting working with the library, it has all the essentials:
http://www.mindsqualls.net/QuickStart_2_0.aspx[^]

(There is also v2.2 of the library available that I think you may want to download.)
   
v3
Comments
petite_paola 1-Jun-12 3:37am
   
Thanks a lot, it's really helpful.
Ed Nutting 1-Jun-12 3:39am
   
Glad I could help :) By the way that NKH Mindsqualls library is open source so if you need to look at the exact bytes that it sends you can :)

Ed

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100