PC USB Communication Through C++

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

PC USB Communication Through C++

Postby Starky » Fri Nov 18, 2011 11:58 am

First of all, since this is my first post, let me say just how much I love this software. I've been using the RCX and NXT over the last could years with LeJOS to do some cool projects in University with AI and vision systems and the simplicity of the implementation has been so helpful.

I'm currently working with the NXT, a BeagleBoard and a Kinect sensor. The idea is that the BeagleBoard will use OpenKinect to access data from the Kinect and use that data data to decide where to move. The BeagleBoard and Kinect are both mounted to the NXT so the Beagleboard will control the NXT over USB.

I currently have a Java program for the NXT and another for the controller that lets me remote control the robot. However, the OpenKinect software we are using is based on C++ so I cannot use the host program. Is it possible for me to create a wrapper for my Java class which will allow the methods to be called? I've researched this a little and it seems like quite a bad idea. I've also looked at the nxtOSEK API but I want to check here before I go that route. Firstly it would mean using that API (which doesn't have neat things like differential pilot) and secondly I don't see a PC API described on their website for communicating over USB like NXJ has.
Starky
New User
 
Posts: 7
Joined: Fri Nov 18, 2011 11:37 am

Re: PC USB Communication Through C++

Postby skoehler » Sat Nov 19, 2011 2:29 pm

You could write a C++ program which sends the kinect data to the java program via TCP/IP.
You can also write a JNI wrapper to exchange data between C++ and Java.

However, there are some google hits for "kinect java" which seem to provide an API for java to use the kinect.
skoehler
leJOS Team Member
 
Posts: 1350
Joined: Thu Oct 30, 2008 4:54 pm

Re: PC USB Communication Through C++

Postby Starky » Sat Nov 19, 2011 3:41 pm

Thanks for your reply skoehler - the TCP/IP idea sounds interesting, I was also thinking of a way of doing some sort of message passing between the Java and C++ programs where they both poll the message box. Will let everyone know how I get on.

With regards to the Java Kinect stuff - the core of our project is to do some object recognition with the Kinect and this will be using the OpenKinect and OpenCV frameworks. There aren't currently any complete Java implementations of those and we need the robotic stuff to be flexible around the Kinect software rather than the other way around.
Starky
New User
 
Posts: 7
Joined: Fri Nov 18, 2011 11:37 am


Return to NXJ Software

Who is online

Users browsing this forum: 9guquaox and 1 guest

cron
more stuff