Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Archy's avatar
Archy
Honored Guest
12 years ago

Faster automatic magnetometer calibration (Patch)

Hi,

attached to this post you find a patch for Util_MagCalibration.h && Util_MagCalibration.cpp which speeds up the auto calibration of the magnetometer alot without reducing the result quality.

This is done simply by collecting up to 16 samples and throwing away the worst ones until 4 samples match the criteria. The main problem of the original auto calibration is that is takes the initial view direction as the first sample and thus invalidates all samples easily reachable by moving the head comfortably.

The extension is txt as I am not allowed to upload patch or diff files.
Hope someone finds this useful!

regards,
Julian

8 Replies

  • "Archy" wrote:
    Hi,

    attached to this post you find a patch for Util_MagCalibration.h && Util_MagCalibration.cpp which speeds up the auto calibration of the magnetometer alot without reducing the result quality.

    This is done simply by collecting up to 16 samples and throwing away the worst ones until 4 samples match the criteria. The main problem of the original auto calibration is that is takes the initial view direction as the first sample and thus invalidates all samples easily reachable by moving the head comfortably.

    The extension is txt as I am not allowed to upload patch or diff files.
    Hope someone finds this useful!

    regards,
    Julian

    Thanks! This looks useful, and it makes a lot of sense for autocalibration. :D
  • Archy's avatar
    Archy
    Honored Guest
    I do calibration by activating auto calibration on startup and using the calibration from the last run on the current pc until new calibration is complete. But with the changed auto calibration you often get a valid calibration within seconds without even asking the user.
  • drash's avatar
    drash
    Heroic Explorer
    This is awesome! Was just thinking it might be asking a lot of the user to look straight up, and to crane the neck so far left and right etc.
  • kwaegel's avatar
    kwaegel
    Honored Guest
    Can I assume this patch is public domain?

    (Hate to ask about licensing, but my current employer can't use non-commercial licenses like the GPL...)
  • At some companies, you can lose your job for downloading or viewing GPL code on a company computer. People who do both commercial and open source programming avoid such a dangerous license like a deadly plague.

    I prefer MIT or BSD, but there are many more suitable free (as in freedom) open source licenses including (but not limited to) CPOL and WTFPL. Although GPL claims to be free, it has a viral anti-business model. Other licensing models are much safer if you ever plan to be a professional programmer. There are businesses that give away their code under the GPL, but it takes a special talent (and a legal team) to survive in that sector of the business world, and most jobs are at other companies that do not use such a difficult business model, preferring to keep their source code under their own control.

    People in some countries are not free to use unlicensed code, so I recommend using the MIT license like I use in my code. :D
  • Archy's avatar
    Archy
    Honored Guest
    "kwaegel" wrote:
    Can I assume this patch is public domain?

    (Hate to ask about licensing, but my current employer can't use non-commercial licenses like the GPL...)


    Hm, I am not sure. From reading the oculus license I guess it has to use the same license?

    And you will have to add a notice to the files.
    3.4. You must give any other recipients of the SDK or Derivative Works a copy of this License and you must cause any modified files to carry prominent notices stating that you changed the files;


    Can anyone tell me if and how I can publish patch files so everyone of you is allowed to use them under the same conditions as the oculus sdk? After reading the oculus license I think I always have to publish the full SDK source code?
  • As I understand it, a patch can have any license you choose that is compatible with the target code, but after applying the patch, the combined work is a derivative work and inherits the license of the target code. Combining source code with mutliple licenses, especially if you decide to combine and refactor code within multiple modules, can get rather tricky. But I am no legal professional, so take that with a "grain of salt".

    Perhaps it would be better to give all your money to a legal professional so he can decide what you should do...
    :o
    Although, it should always be safe to just use the same license in a patch file as is used in the target code, and that would be cheaper than seeking legal advice.
    :D
    Portions of the OculusVR SDK (e.g. the sample apps) now use the less-restrictive Apache license.
  • drash's avatar
    drash
    Heroic Explorer
    I'm curious if anyone at Oculus has seen this and whether it will prove to be a viable update to the SDK's magnetometer calibration logic?