Unity Code from Virtual XDK
Answer
5/18/15 12:14 PM
Hello,

is it possible to work with the Unity Code that comes with the Virtual XDK application? 
Also do you know if I am allowed to use the Personal Edition while working at Bosch or do I have to purchase the Pro Version.
If I need to purchase it, does anyone know a alternative where I could reuse the resources from the Virtual XDK application?

BR,
Florian
0 (0 Votes)
Unity Code from Virtual XDK
Answer
5/19/15 11:12 PM as a reply to Florian Dittrich.
Hello Florian,

when exporting the Virtual XDK with Unity to either Android or iOS you have to use Unity 4.x, preferably 4.6.5 which is the latest version of Unity 4. You can get it from here, just click on the tab for 4.x.
I'm pointing to Version 4.x in particular as you'll run into problems with their latest version 5.x. 
5.x requires you to upgrade the Unity project and consequently all obsolete APIs that changed since 4.x which will break some functionality.

Are you trying to export the project for Xcode (iOS Devices) or for Android?
If you're trying to export the project for Xcode, you have to go a few extra steps as the Unity project settings in v2 of the Virtual XDK are not set for universial architectures (especially arm64 devices, everything form the iPhone 4s and up, are missing). To fix that, just follow these steps and later on, add the CoreBluetooth Framework to the Xcode project and you should be able to Build & Run the project for your device.

Switching the scripting backend to the IL2CPP and using Universal architecture in the player settings solved this problem for me. Here are the steps:

  1. Open up Player Settings either via Edit menu -> Project Settings -> Player or File menu -> Build Settings ... -> Player Settings... button at the bottom. Player Settings will appear in the inspector.
  2. Click on the iPhone, iPod Touch, and iPad settings tab (the icon that looks like an iPhone).
  3. Under Settings for iOS, open up Other Settings
  4. Under the Configuration heading:
  5. For Scripting Backend, select IL2CPP (Defaults to Mono (2.x)).
  6. For Architecture, select Universal.

Now build the Xcode project, and Xcode should compile without errors. If you still encounter errors, ensure Architectures is set to Standard architectures (armv7, arm64) and Valid Architectures is set to "arm64 armv7 armv7s"
 

Let me know how if you had success with that! I was able to export and compile a working app for my iPhone 6 Plus.

About your licensing issues:
From a technical point of view the personal edition is enough to export the project and start working with the app. 
Though, from a licensing perspective it's said to be a personal license. I don't know the specifics of their licenses here, therefore I'm forwarding this question to second level support.

Have a great day,
Florian

0 (0 Votes)
Unity Code from Virtual XDK
Answer
5/20/15 11:25 AM as a reply to Manuel Cerny.
Hello Manuel,

thank you for your reply. I'd prefer to use Unity to build Projects for Android and WebPlayer as well.
But I saw that the License probably doesn't work for me:

Unity Personal (including the iOS and Android platform deployment options) may not be used by:

  1. a Commercial Entity that has either: (a) reached annual gross revenues in excess of US$100,000, or (b) raised funds (including but not limited to crowdfunding) in excess of US$100,000, in each case during the most recently completed fiscal year;
  2. [...]
I'd be okay with using an alternative like libGDX, but it would be nice if I could import the 3D Model. Do you know if thats possible? I saw the model is a .obj File. I assume that's supposed to be portable to any other Game Enginge/Framework. Do you maybe have further information about that?

BR,
Florian 
 
0 (0 Votes)
Unity Code from Virtual XDK
Answer
5/21/15 2:27 AM as a reply to Florian Dittrich.
Hi Florian,

unfortuantely we can not provide any legal advice on licensing issues and wether or not it is legal to use the personal edition in your case. Please determine individually for yourself if the personal edition can be used or not.

As the Virtual XDK is only provided as an Unity 4.x project, we don't support libGDX or other alternatives to Unity. 
From experience and from what I've seen in the Unity project, libGDX is quite unlikely to work with what's provided with the Unity project as the API have too many mismatches between these two cross platform tools. If you succeed with libGDX, please let us know, it would be interesting to see how that works.

We are sorry that we couldn't help more in this concern and hope you're succeeding with porting over the VirtualXDK to your custom android solution.

- Florian
0 (0 Votes)
Unity Code from Virtual XDK
Answer
5/27/15 11:41 AM as a reply to Manuel Cerny.
Hi Manuel,

thank you anyway for your help. I'll keep on working with libGDX but I am having a little trouble with the sensor fusion. 
In the Virtual XDK you are integrating the gyro sensors and use the complementary filter to combine it with the accelerometer values to avoid the gyro drift right?
Can you tell me why you swap the axes in this line:

_gyroAttitude *= GetGyroDeltaRotation(new Vector3(xdk.GyroSensor.YAxis.Value, -1f * xdk.GyroSensor.XAxis.Value, xdk.GyroSensor.ZAxis.Value));

And where does the GyroRawAngularSpeedFactor come from?
Also I am wondering if you are using the raw sensor data at this stage or is there any sort of manipulation before? Are the accelerometer values still G-force values, gyro still °/s and magnetometer uT?

I'd be extremly happy if you could help me with this.

BR,
Florian
0 (0 Votes)
Unity Code from Virtual XDK
Answer
5/27/15 6:50 AM as a reply to Florian Dittrich.
Ah and one more thing, what exactly is the difference between Accelerometer BMA280 and BMI160, as well as Gyroscope BMG160 and BMI160?

Is there a documentation somewhere when to use which sensor or something like that?
0 (0 Votes)
Unity Code from Virtual XDK
Answer
5/28/15 4:42 AM as a reply to Florian Dittrich.
Hi Florian,

first of all, it's great to see you're making progress and you are really commiting to this! 
Here are the answers I can give you as of right now:
In the Virtual XDK you are integrating the gyro sensors and use the complementary filter to combine it with the accelerometer values to avoid the gyro drift right? 

That's exactly what's described in the source code and what later gets applied. I'll confirm that with second level support for you once more so we can be sure here.
 
_gyroAttitude *= GetGyroDeltaRotation(new Vector3(xdk.GyroSensor.YAxis.Value, -1f * xdk.GyroSensor.XAxis.Value, xdk.GyroSensor.ZAxis.Value)); 

I can't fully provide you with in detail information on why the XAxis is swapped, looking at the definition of GetGyroDetalRotation it seems to be a necessary swap for the calculation that is done and how Quaternion.Euler is
used. I'll make sure you/we get a definite answer here.
 
And where does the GyroRawAngularSpeedFactor come from? 

The GyroRawAngularSpeedFactor is a constant of the type float set to the value of 15267.
L15:  private const float GyroRawAngularSpeedFactor = 15267f;
Also I am wondering if you are using the raw sensor data at this stage or is there any sort of manipulation before? 

The sensor data used is the raw data coming from the sensors. If you take a look at the class "XdkParser" in "XdkParser.cs" you'll find that these values are coming as direct bitstream from the devices' sensors. 
Ah and one more thing, what exactly is the difference between Accelerometer BMA280 and BMI160, as well as Gyroscope BMG160 and BMI160? 

Documentation on those sensors can be found here:
http://ae-bst.resource.bosch.com/media/products/dokumente/bma280/BST-BMA280-DS000-11_published.pdf
https://ae-bst.resource.bosch.com/media/products/dokumente/bmi160/BMI160_Flyer.pdf
https://ae-bst.resource.bosch.com/media/products/dokumente/bmg160/bst-bmg160-fl000-01_2012-09.pdf

The BMA280 is a standalone accelerometer sensor, while the BMI160 is a sensors that combines both Gyroscope and Accelerometer. The BMG160 though, is the pendant to the BMA280 as gyroscope.

I hope that helps you further with your work. 

I'll respond back as soon as I have more answers for you from second level support ;)

Regards,
Florian 
0 (0 Votes)
Unity Code from Virtual XDK
Answer
5/28/15 6:48 AM as a reply to Manuel Cerny.
Hi Florian,

first of all, thanks for your quick reply and your extensive help. I really appreciate it.

With the GyroRawAngularSpeedFactor I meant, where the value is coming from? I mean is that some sort of a well known constant in the literature or how did you find that value?

Ah okay, so actually there shouldnt be a big difference between using the BMI160 or the other two?

BR,
Florian

 
0 (0 Votes)
Unity Code from Virtual XDK
Answer
6/5/15 12:52 AM as a reply to Florian Dittrich.
Hi Florian,

regarding your question about the GyroRawAngularSpeedFactor, I forwarded this to second level and to the devs who wrote that code. I haven't heard back about that right now, but I'll let you know as soon as I hear back from them.

There shouldn't be a big difference between the BMI160 and the other and the BMA280 regarding their accelerometer. The same goes for the BMG160 and the BMA280 for their gyroscope. Though, that's theory and in real life two sensors even in the same environment/angle/... will always differ a little.

You might want to check out the XDK Overview as well where all the sensors are listed with their different characteristics.

- Florian
0 (0 Votes)
Unity Code from Virtual XDK
Answer
6/10/15 11:12 AM as a reply to Manuel Cerny.
Hi Florian,

you might be able to give me one more advice with the Unity Application. I took the xdk.obj file from the Assets folder and imported it into Blender. Unfortunatly the material informations are lost or at least it appears in a grey default color.

Did you guys use Blender to build the Model or did you use some other software?

I assume that the .mat files within the Material Folder are generated by Unity, but where are the actual informations about the material stored? Does that happen programmatically? I cannot open the code with the Unity Editor, therefore its a little hard for me to find the location.

Thanks again for your help.

BR,
Florian
 
0 (0 Votes)
Unity Code from Virtual XDK
Answer
6/12/15 5:26 AM as a reply to Florian Dittrich.
Hi Florian,

as I'm not the developer of the VirtualXDK, I can't fully tell you which software was used to build the 3D Model. 

Let me try to get you the 3D model for you, so your libGDX version will look great! 

I'll reply again once I have a response from the original developers about this!

- Florian
0 (0 Votes)
Unity Code from Virtual XDK
Answer
6/12/15 8:44 AM as a reply to Manuel Cerny.
 
created by florian.dittrich on 27.05.2015, 08:50 AM
Ah and one more thing, what exactly is the difference between Accelerometer BMA280 and BMI160, as well as Gyroscope BMG160 and BMI160?

Is there a documentation somewhere when to use which sensor or something like that?

Dear Florian,

the basic functionality is the same; there are minor differences in accuracy and sensitivity (16bit data output on the BMI160 vs. 14bit on the BMA280). However, normally you will not see a difference in your application.
Main point of the BMI160 is to provide the user with different types of gyroscopes.
The gyro in the BMI160 is an “open-loop” gyroscope, which results in very low noise and low power consumption (~1mA). The BMG160 is working in “closed-loop”, which results in an excellent zero-Ω offset change over temperature (TCO), which can be two orders of magnitude below the open-loop version. As a result, the power consumption in higher (~5mA)
We encourage you to try out both sensors, and decide which is best for your application

Regards,
Mathias
0 (0 Votes)
RE: Unity Code from Virtual XDK
Answer
1/11/18 10:10 PM as a reply to Mathias Bruendel.

Hi,

Is this Unity project available anywhere? Looking for the actual source.

Thanks!

 

0 (0 Votes)
RE: Unity Code from Virtual XDK
Answer
1/12/18 4:34 PM as a reply to Athanasios Ikonomou.

Hello Athanasios,

I have answered this question in the new thread you created here.

Kind regards,
Franjo

0 (0 Votes)