LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you acquire the axis position data for a 3D Connexion SpaceNavigator joystick?

Hi,

I read through the post and am having a diffcult time figuring out the storing previous value using feedback node stuff.

I did what I believe does that but I fluctuate between the difference (initial -final) and the initial value of the joystick.

I am attaching a snippet of my VI, would anyone be able to comment if they see some rookie mistake there

ThanksSM_FB.PNG

0 Kudos
Message 11 of 18
(1,740 Views)

Intaris wrote:

1kHz is the max allowed response rate for a HID. (1ms Polling).

  

Shane.


It's a good thing I didn't know this when testing the maximum acquisition rate for a Logitech Joystick on my Win7 machine and found that it ran at 90KHz (a million samples took 10.5 seconds).

 

BS

 

 

0 Kudos
Message 12 of 18
(1,735 Views)

Since I didn't know what sort of device this was, I looked it up on the Web, and viewed their video.  I was struck by the notion that the Mouse basically doesn't move, which suggests it is not outputting position, but instead velocity.  The fact that you see the numbers increasing over time suggests that it might also be outputting acceleration.

 

If that's the case, you have a (relatively easy) solution -- don't try to differentiate the signal (which is noisy, as you noted), but integrate it, maybe even twice (you'll need to experiment a bit).  Since you have the device, you presumably have the manual (which I understand is installed with the Driver) -- does that give any clue?

 

Bob Schor  

0 Kudos
Message 13 of 18
(1,731 Views)

Thanks for your input.

I tried intergrating but noise is still there (multiple integration tried too)

now I try this approach where I just check for the lowest value among the noise (which essentially is my delta at any given moment)

My only problem is that I am unable to get the polarity which is important to me (I want to detetct when I go left-right or fwd-bkwd)
Partly the reason is the use of absolute value, I want to detect if the delta is +ve or -ve ( initial > final or vice-versa)

I looked at the SDK they have that ability in the C code and even have a zero button (so that you don't get any output for no interaction with the device)
I wonder if that is possible to do in Labview coz the feedback node just freezes at last iteration so there will always be a Delta present o or notSN_delta.png

0 Kudos
Message 14 of 18
(1,720 Views)

@Bob_Schor wrote:

@Intaris wrote:

1kHz is the max allowed response rate for a HID. (1ms Polling).

  

Shane.


It's a good thing I didn't know this when testing the maximum acquisition rate for a Logitech Joystick on my Win7 machine and found that it ran at 90KHz (a million samples took 10.5 seconds).

 

BS

 

 


 

 

Well then its either not a HID or it is in clear violation of the HID spec.

 

It is possible to retrieve data from a HID througb the default control pipe using the standard Get Report query and this may dxecute faster but thats not normal HID  operation.

 

 

0 Kudos
Message 15 of 18
(1,711 Views)

Your code is impossible to read.  Please do the following:

  1. Use the Cleanup Tool.  Go to your Block Diagram, type Ctrl-A (to select everything), then click the Broom icon just under the MenuBar, to the left of Search.
  2. While everything is selected, go to Edit, Create Snippet from Selection.  This not only saves a PNG file, but we can open it and execute it (magic!).
  3. If you want to show items from the Front Panel, make small images of them so they'll expand to readable size when you paste them in here.

I'm not sure (from the squinting I could do of your code) that you are, in fact, integrating the output from the Joystick.  I did try to go to the Space Mouse site to see what the mouse was doing, but I don't have access to the SDK (and shouldn't have to download it just to help you out ...).  See what it says about how to interpret the output(s) from the Joystick.  If there are relevant sections that, for example, say just what comes out of the Axes, and you tell us, we can provide "better than guessing" help.

 

BS

0 Kudos
Message 16 of 18
(1,701 Views)

Sorry for the trouble.
I did what you suggested & attaching the pics.

I am using a feedback node to check the change in value, however since the values remain constant the delta either goes up or down.
I am comparing the modulus at this point so that just to filter out lowest value (delta) as some axes start from -ve & others from +ve so hard to justify one rule for delta


For my application I need to understand if the delta is positive or negative which in turn gives me the direction the mouse is turned to.

I'm just starting off with LV so maybe don't know too many VI's that might already be there to sort this problem, help of  you guys is much appreciated.

ThanksSN_delta.pngFront panel.PNG

0 Kudos
Message 17 of 18
(1,678 Views)

For the sake of the people who view this post and are as lost as me, I would like to put my input as this thread seemed to go dead after my last post...

I figured out the stuff, not too difficult, needed to implement shift register in a correct way, key points:

  • Check for correct Space mouse index using get query
  • Take the difference between loop values using shift register; gives accurate rate of change
  • 50 ms wait in the loop worked perfect for me, any less than that I saw lag b/w motion and output on screen
  • To filter out values I used formula node VI

Hope it helps anyone who comes to this post searching for answers.

thanks

0 Kudos
Message 18 of 18
(1,627 Views)