Need Examples

145 views
Skip to first unread message

Alejandro Duarte Sanchez

unread,
Mar 12, 2013, 6:08:38 PM3/12/13
to libfre...@googlegroups.com
hi,

I'm new on this 
I'm wondering if you have a program example and source-Code that use all of axis 

Merrill

unread,
Mar 13, 2013, 2:38:47 PM3/13/13
to libfre...@googlegroups.com
Hi Alejandro,

Thanks for the question.  The libfreespace-examples project contains several examples that show how to access the motion data available with the Freespace modules.


The game3d_example demonstrates how to obtain angular position data in the form of Euler angles (also available in quaternion form).  And the gameloop_examples show how to get Body Frame data in the form of linear acceleration (body frame also includes angular velocity).  If those do not show you what you need, what type of data are you interested in?  Thanks.

-Merrill
libfreespace moderator

Alejandro Duarte Sanchez

unread,
Mar 14, 2013, 2:32:33 PM3/14/13
to libfre...@googlegroups.com
sorry again
I 'm in troubles 
when the project was compiling I got this kind of error 1>LINK : fatal error LNK1104: cannot open file 'libfreespaced.lib'
and I put the library in every folder of the project.

thank you for your attention.

Merrill

unread,
Mar 18, 2013, 3:21:34 PM3/18/13
to libfre...@googlegroups.com
Hi Alejandro,

There are a couple things to check here.  The libfreespaced.lib (with a d at the end) is the Debug version.  You should confirm that you are using libfreespaced.lib and not libfreespace.lib.  Or, you can also change your project settings to be in Release mode rather than Debug mode.

You can also check your project settings to confirm that it is pulling in that library (probably under Linker -> Input).

Let me know if you get it working.  Thanks,

-Merrill
libfreespace moderator

Alejandro Duarte Sanchez

unread,
Mar 19, 2013, 1:48:13 PM3/19/13
to libfre...@googlegroups.com
yes, now it works !!
I put it into the system32 folder.
I've compiled it and run it, but I can't get the information about the axis (current accel)
I connected my HMD and I ran gameloop_example program but I've gotten this:

c:\Users\usuario\Desktop\VR-2000\libfreespace-examples-0.6\win\vs2008\Debug\gameloop_example.exe: Using libfreespace 0.6
0: Current accel = 0, 0, 0

** I've moved the HMD and it's always the same ***

Merrill

unread,
Mar 20, 2013, 11:54:01 AM3/20/13
to libfre...@googlegroups.com
Hi Alejandro,

There's an issue with the current libfreespace-examples and the FSRK-USB-2.  We use a function called freespace_isNewDevice() to determine which data control message to use.  The problem is that this freespace_isNewDevice() does not recognize the USB-2 as a new device and the USB-2 does not support the older message.  You can fix your code easily through one of two ways:

- Remove the conditionals in the examples so that you do not check for freespace_isNewDevice() and instead just send the DataModeControlV2Request message

- In the libfreespace library code, modify freespace_deviceTable.c as follows and rebuild the library:

     In freespace_newDeviceAPITable[] struct, add the following to the list:

     { "USB Freespace Module (MV)", 0x1d5a, 0xc080, 2 }

   So, the correct code for freespace_newDeviceAPITable[] is:

   const struct FreespaceDeviceInfo freespace_newDeviceAPITable[] = {

        { "Smart USB RF Transceiver v2 (MKCV)", 0x1d5a, 0xc0b3, 2 },

        { "USB Freespace Module (MV)", 0x1d5a, 0xc080, 2 }

   };


There's an open bug for this that should be resolved in the next release.

Thanks,
-Merrill

Alejandro Duarte Sanchez

unread,
Mar 20, 2013, 5:33:39 PM3/20/13
to libfre...@googlegroups.com
hi Merrill,

I'm very grateful for your help. I did the first solution you told me and it worked, now I can check all the body's values.

I have an different trouble, 
I'm part of a research team in a university , and our research is all about human behavior using virtual environments, so we need an HMD. When I connect it , it works as a computer mouse so we can use it in any virtual environment program, but as you know a computer mouse can't move in 'Z' axis, so my question is do you know how can I do this with my HMD in any virtual environment? moving all the axes, something like a driver or a program that we can use to use the 'Z' axis.

For example, we are working with 'Unity'( http://unity3d.com/ ), and when we connect the HMD , we can move in X and Y axes (as a computer mouse) but when we want to move in the 'Z' axis , we have to press a key to walk in  the 'Z' axis. We need to walk with the HMD instead 

Merrill

unread,
Mar 20, 2013, 7:01:51 PM3/20/13
to libfre...@googlegroups.com
Hi Alejandro,

Great news that you've got it up and running.

Regarding the z-axis question, are you referring the the position of the user in your virtual world (with X and Y being where the user is looking)?  If so, this is a common problem with inertial sensing.  The issue is that inertial modules like the FSM-6 are only able to detect rotations accurately.  This is why it works well for X and Y as you rotate your head around.  Z-axis, however, requires linear position tracking.  The challenge with linear position tracking is that the only way we can get that information without an optical reference source like a camera/IR is to double integrate the accelerometer data.  The noise on the accelerometer simply blows up into way too much error which means that linear position tracking is only accurate to within a second or so.

You can tell that the user is generally moving in a certain direction, but it will be difficult to get an exact linear position without an optical reference source.  Is knowing that the user is moving in a direction sufficient for your project?

If you are referring to a different type of motion let me know.

Thanks,
-Merrill

Alejandro Duarte Sanchez

unread,
Mar 21, 2013, 12:18:36 PM3/21/13
to libfre...@googlegroups.com
Hi Merril,
about your first question, that's exactly it. 
about the second question, we just  need to know if the user moves forward, back or stand still. The speed at which the user moves in the virtual environment is fixed anyways, so we aren't concerned with exact values.

the Z-axis problem,
are you refering to this specific program or to all programs in general? 

is there a way, such as in unity, for the Z-axis to be received as natively as the X and Y axes are for a mouse?

Alejandro Duarte Sanchez

unread,
Mar 21, 2013, 5:00:00 PM3/21/13
to libfre...@googlegroups.com
hi,
I noticed that your program is just for rotation,
is there anything for displacement or movement?

Merrill

unread,
Mar 22, 2013, 10:18:01 AM3/22/13
to libfre...@googlegroups.com
Hi Alejandro,

Displacement is what I was referring to when I discussed that inertial modules like the FSM are not able to track linear position accurately over a useful amount of time.  Unfortunately accurate linear position information typically requires an external absolute reference source like a camera or IR system.

Thanks,
-Merrill

Alejandro Duarte Sanchez

unread,
Mar 22, 2013, 3:03:56 PM3/22/13
to libfre...@googlegroups.com
Hi Merrill,

I really appreciate your help and time
Now I understand many things about this library

It was a pleasure

regards
Reply all
Reply to author
Forward
0 new messages