#1
|
|||
|
|||
Integrating InertiaCube and Vicon data
Hello, I'm working on a project a part of which requires tracking the user's movements using both Vicon and InterSense InertiaCube data.
The reason is the fact that the orientational data coming from the Vicon system has a lag of ~100 ms which is actually enough to make a significant difference in a virtual world and even has the potential for generating motion sickness. The InertiaCube, on the other hand, has little to no lag and can correct the orientation that Vicon is displaying with respect to a certain time. I was wondering if there is a ready solution for integrating these two data sources? This feature is essential to the project I'm working on, any help would be greatly appreciated. I am using Vizard 3.00.2701 and InertiaCube2 Pro (DLL-compatible). |
#2
|
|||
|
|||
Vizard has built-in support for connecting to Intersense devices and a Vicon server. If you are asking if there is a built-in way to combine the data from these devices, the answer is no.
How do you want the data to be combined? Do you want to use the Vicon data to correct for the drift in the Intersense data? If so, you can setup a timer in your script that periodically updates the heading of the Intersense using the heading from Vicon. |
#3
|
|||
|
|||
Thank you for such a lightning-fast reply!
Too bad there's no built-in feature to do this. What I'm trying to do is to correct Vicon by InertiaCube. Vicon is a 6-DOF system it has both positional and orientational data while InertiaCube has 3 DOF and cannot detect position. I'm hoping to, so to say, get the best of both worlds and form the final data stream from: 1) Vicon's positional data; 2) Vicon's orientational data (which lags ~100 ms behind) corrected by InertiaCube's orientational data which has a much smaller lag and hence is more accurate. |
#4
|
|||
|
|||
Well, you can blend between the two orientations. For example, your final orientation can be composed of 75% Intersense data and 25% Vicon data. However, you should be aware that the Intersense might accumulate some drift depending on your physical environment (metallic interference etc..). Here is some sample code that will accomplish this:
Code:
q1 = isenseOri.getQuat() q2 = viconOri.getQuat() # 'q' will contain quaternion rotation with 75% Intersense data and 25% Vicon data q = vizmat.slerp(q1,q2,0.25) |
#5
|
|||
|
|||
Thanks again farshizzo. Your tip doesn't seem to help in my case though - "slerp" somehow disables position tracking. I think I am going to go with a manual solution (coding this data integration from scratch).
I don't know if this is related, but here goes: what is this error message I get every run? Code:
intersense.dls Intersense Driver v2.1 ********** InterSense Tracker Information *********** Type: IS Precision Series device on port 5 Model: InertiaCube2 Pro Station Time State Cube Enhancement Sensitivity Compass Prediction 1 ON ON 1 2 3 2 0 PPT: cannot open serial port: No such file or directory PPT: cannot open serial port: No such file or directory PPT: cannot open serial port: No such file or directory PPT: cannot open serial port: No such file or directory ** ERROR: Failed to connect to PPT vizppt.dls WorldViz PPT v3.0 AFAIK "vizppt.dls" is a plugin for "Precision Optical Tracker", the line adding it was present in "gallery.py" example script which I'm using. Is it another tracking device I simply do not have? Is it safe to remove the lines referencing it then? |
#6
|
|||
|
|||
I really don't see how using the slerp command could disable position tracking. There is probably something wrong with your script, but I can't tell without seeing your code.
The vizppt.dls plugin is for connecting to the WorldViz PPT optical tracking device. If you are not using that device then you can remove remove the plugin from your script. |
#7
|
|||
|
|||
pre/post Trans/Quat functions
I hope it's okay to ask a completely different question here regarding the same project..
I am now trying to get position tracking to work properly. Simply doing something along these lines in mytimer callback function doesn't work as expected, as I found out: Code:
... def mytimer(num):if (num == ANIMATE):...... viz.MainView.setPosition(vicon.getPosition()) viz.MainView.setQuat(inertiaCube.getQuat()) ... Code:
... def mytimer(num):if (num == ANIMATE):... mainViewMtx.postTrans(subLists(vicon.getPosition(), prevPosition)) mainViewMtx.postQuat(inertiaCube.getQuat()) viz.MainView.setMatrix(mainViewMtx) ... mainViewMtx = vicon.getMatrix() prevPosition = vicon.getPosition()
As of now, position tracking actually works (that is to say, MainView moves forward as I move forward, etc.), but looking up or down has severe side effects of translating the view in some direction, rotating or tilting of it. Rotating left/right works but also translates the view. Now I can finally ask the question itself: the underlined bits of code in the second listing seem to me as the source of this problem. What exactly am I doing wrong? Is it their order (i.e., deal with quats before I apply the change in position)? Is it using preTrans/preQuat rather than postTrans/postQuat (by the way, what is the difference in terms of the effect on MainView?)? Is it both? And another question: I assume the calls vicon.getPosition() and vicon.getMatrix() do not block, that is to say, the execution is not suspended to get the data from Vicon but rather a pre-fetched cached data is used. Is this correct? Otherwise, given that we estimate our Vicon system has a lag of 100 ms, my entire script is WRONG. In short, I'm lost. I kind of postponed my efforts of integrating Vicon and InertiaCube data in favor of getting this position tracking to work and I seem to be walking into another problem. Any help would be appreciated.. Last edited by roman_suvorov; 05-16-2008 at 02:39 PM. |
#8
|
|||
|
|||
Applying a post rotation to a matrix which already has position data will cause the position data to be rotated as well. So if the position is 1 meter forward and you post rotate the matrix 90 degrees around the Y-axis, the new position will be 1 meter to the right. It seems like you just want to set the rotation of the matrix to the intersense rotation. In that case use setQuat instead.
Code:
mainViewMtx.setQuat(inertiaCube.getQuat()) |
#9
|
|||
|
|||
Thanks farshizzo! This seems to work, although the current performance is pretty awful, I estimate the animation lag of ~ 300 ms which is quite bad given that at ~ 100 ms some subjects already experience symptoms of motion sickness.
farshizzo, would you mind looking at the whole script? I'll PM or email it to you, whichever one you find better. Thanks again! |
#10
|
|||
|
|||
Actually, I don't think I can PM this: the script and my comments combine for ~23,500 characters plus I need to attach a ~2.5 MiB output log. Can you PM me your email, farshizzo? Thanks!
|
#11
|
|||
|
|||
You can email me at lashkari@worldviz.com
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|