'Zeroing' a rotation, Quaternion inversion

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I am using an IMU-Sensor (Inertial Measurement Unit) to get the absolute rotation of a sensor kit I am building. The rotation is relative to the initial orientation, that means when the device is powered up the 'zero' rotation is set.



The sensor tells me its current rotation as a quaternion and by applying this to a reference vector - lets say (1,0,0) - I am visualizing that rotation. Works perfectly so far.



Now, I want to 'zero-out' the sensor without restarting it. Naively speaking, that means I have to undo the zeroing rotation. How do I do this?



My attempt:
Let the current rotation be $R$, the rotation at the zeroing moment $Z$ and the reference vector $x = (1, 0, 0)$ and we call the expected vector $y$.



Normally, I do: $y = R cdot x$ (works perfectly)
Now, I would do: $y = Z^-1 cdot R cdot x$ where $Z^-1$ is the inverse quaternion.



At the first moment this solution works. I can see that $y$ is reset to the x-axis. However, when I start rotating my sensor very wired things happen.



Question: What is the correct concept for zeroing a rotation system?







share|cite|improve this question




















  • If you know the current quaternion with respect to the original zero measurement, why don't you just apply the inverse of the current quaternion? That would bring you back to the identity (presumably your zero orientation?)
    – rschwieb
    Aug 8 at 19:42











  • I am not sure what you try to say? Could you write that down formally? I am working with quaternions since yesterday, so I am not yet on a 'why don't you just...' base here...
    – Matthias Sokolowski
    Aug 8 at 20:31










  • That's funny, I am not sure what you try to say? Could you write that down formally? is exactly what I was going to start with in my last comment. I don't really understand what challenge there is in "zeroing out" the sensor. "Zeroing out" implies you have a fixed "zero value" that you can re-assign to the value. Why would the zero value ever change? But let's ignore that for now and go on to a nother question: if you have "the zeroing rotation", and you "want to undo the rotation" you would just use the inverse rotation. The inverse rotation, by definition, undoes the rotation.
    – rschwieb
    Aug 8 at 20:37











  • So is the second thing what you are looking for? "I have a rotation and I want to undo it"?
    – rschwieb
    Aug 8 at 20:38










  • Ok, I am pretty sure, that I kind of self answered my question and my original solution - also as indicated by you - was in fact correct from the beginning. Apparently, a number of mistakes here when testing - e.g. drifting sensors and rotating to may things at a time - made me believe I had a wrong concept.
    – Matthias Sokolowski
    Aug 8 at 23:19














up vote
2
down vote

favorite












I am using an IMU-Sensor (Inertial Measurement Unit) to get the absolute rotation of a sensor kit I am building. The rotation is relative to the initial orientation, that means when the device is powered up the 'zero' rotation is set.



The sensor tells me its current rotation as a quaternion and by applying this to a reference vector - lets say (1,0,0) - I am visualizing that rotation. Works perfectly so far.



Now, I want to 'zero-out' the sensor without restarting it. Naively speaking, that means I have to undo the zeroing rotation. How do I do this?



My attempt:
Let the current rotation be $R$, the rotation at the zeroing moment $Z$ and the reference vector $x = (1, 0, 0)$ and we call the expected vector $y$.



Normally, I do: $y = R cdot x$ (works perfectly)
Now, I would do: $y = Z^-1 cdot R cdot x$ where $Z^-1$ is the inverse quaternion.



At the first moment this solution works. I can see that $y$ is reset to the x-axis. However, when I start rotating my sensor very wired things happen.



Question: What is the correct concept for zeroing a rotation system?







share|cite|improve this question




















  • If you know the current quaternion with respect to the original zero measurement, why don't you just apply the inverse of the current quaternion? That would bring you back to the identity (presumably your zero orientation?)
    – rschwieb
    Aug 8 at 19:42











  • I am not sure what you try to say? Could you write that down formally? I am working with quaternions since yesterday, so I am not yet on a 'why don't you just...' base here...
    – Matthias Sokolowski
    Aug 8 at 20:31










  • That's funny, I am not sure what you try to say? Could you write that down formally? is exactly what I was going to start with in my last comment. I don't really understand what challenge there is in "zeroing out" the sensor. "Zeroing out" implies you have a fixed "zero value" that you can re-assign to the value. Why would the zero value ever change? But let's ignore that for now and go on to a nother question: if you have "the zeroing rotation", and you "want to undo the rotation" you would just use the inverse rotation. The inverse rotation, by definition, undoes the rotation.
    – rschwieb
    Aug 8 at 20:37











  • So is the second thing what you are looking for? "I have a rotation and I want to undo it"?
    – rschwieb
    Aug 8 at 20:38










  • Ok, I am pretty sure, that I kind of self answered my question and my original solution - also as indicated by you - was in fact correct from the beginning. Apparently, a number of mistakes here when testing - e.g. drifting sensors and rotating to may things at a time - made me believe I had a wrong concept.
    – Matthias Sokolowski
    Aug 8 at 23:19












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I am using an IMU-Sensor (Inertial Measurement Unit) to get the absolute rotation of a sensor kit I am building. The rotation is relative to the initial orientation, that means when the device is powered up the 'zero' rotation is set.



The sensor tells me its current rotation as a quaternion and by applying this to a reference vector - lets say (1,0,0) - I am visualizing that rotation. Works perfectly so far.



Now, I want to 'zero-out' the sensor without restarting it. Naively speaking, that means I have to undo the zeroing rotation. How do I do this?



My attempt:
Let the current rotation be $R$, the rotation at the zeroing moment $Z$ and the reference vector $x = (1, 0, 0)$ and we call the expected vector $y$.



Normally, I do: $y = R cdot x$ (works perfectly)
Now, I would do: $y = Z^-1 cdot R cdot x$ where $Z^-1$ is the inverse quaternion.



At the first moment this solution works. I can see that $y$ is reset to the x-axis. However, when I start rotating my sensor very wired things happen.



Question: What is the correct concept for zeroing a rotation system?







share|cite|improve this question












I am using an IMU-Sensor (Inertial Measurement Unit) to get the absolute rotation of a sensor kit I am building. The rotation is relative to the initial orientation, that means when the device is powered up the 'zero' rotation is set.



The sensor tells me its current rotation as a quaternion and by applying this to a reference vector - lets say (1,0,0) - I am visualizing that rotation. Works perfectly so far.



Now, I want to 'zero-out' the sensor without restarting it. Naively speaking, that means I have to undo the zeroing rotation. How do I do this?



My attempt:
Let the current rotation be $R$, the rotation at the zeroing moment $Z$ and the reference vector $x = (1, 0, 0)$ and we call the expected vector $y$.



Normally, I do: $y = R cdot x$ (works perfectly)
Now, I would do: $y = Z^-1 cdot R cdot x$ where $Z^-1$ is the inverse quaternion.



At the first moment this solution works. I can see that $y$ is reset to the x-axis. However, when I start rotating my sensor very wired things happen.



Question: What is the correct concept for zeroing a rotation system?









share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Aug 8 at 19:36









Matthias Sokolowski

111




111











  • If you know the current quaternion with respect to the original zero measurement, why don't you just apply the inverse of the current quaternion? That would bring you back to the identity (presumably your zero orientation?)
    – rschwieb
    Aug 8 at 19:42











  • I am not sure what you try to say? Could you write that down formally? I am working with quaternions since yesterday, so I am not yet on a 'why don't you just...' base here...
    – Matthias Sokolowski
    Aug 8 at 20:31










  • That's funny, I am not sure what you try to say? Could you write that down formally? is exactly what I was going to start with in my last comment. I don't really understand what challenge there is in "zeroing out" the sensor. "Zeroing out" implies you have a fixed "zero value" that you can re-assign to the value. Why would the zero value ever change? But let's ignore that for now and go on to a nother question: if you have "the zeroing rotation", and you "want to undo the rotation" you would just use the inverse rotation. The inverse rotation, by definition, undoes the rotation.
    – rschwieb
    Aug 8 at 20:37











  • So is the second thing what you are looking for? "I have a rotation and I want to undo it"?
    – rschwieb
    Aug 8 at 20:38










  • Ok, I am pretty sure, that I kind of self answered my question and my original solution - also as indicated by you - was in fact correct from the beginning. Apparently, a number of mistakes here when testing - e.g. drifting sensors and rotating to may things at a time - made me believe I had a wrong concept.
    – Matthias Sokolowski
    Aug 8 at 23:19
















  • If you know the current quaternion with respect to the original zero measurement, why don't you just apply the inverse of the current quaternion? That would bring you back to the identity (presumably your zero orientation?)
    – rschwieb
    Aug 8 at 19:42











  • I am not sure what you try to say? Could you write that down formally? I am working with quaternions since yesterday, so I am not yet on a 'why don't you just...' base here...
    – Matthias Sokolowski
    Aug 8 at 20:31










  • That's funny, I am not sure what you try to say? Could you write that down formally? is exactly what I was going to start with in my last comment. I don't really understand what challenge there is in "zeroing out" the sensor. "Zeroing out" implies you have a fixed "zero value" that you can re-assign to the value. Why would the zero value ever change? But let's ignore that for now and go on to a nother question: if you have "the zeroing rotation", and you "want to undo the rotation" you would just use the inverse rotation. The inverse rotation, by definition, undoes the rotation.
    – rschwieb
    Aug 8 at 20:37











  • So is the second thing what you are looking for? "I have a rotation and I want to undo it"?
    – rschwieb
    Aug 8 at 20:38










  • Ok, I am pretty sure, that I kind of self answered my question and my original solution - also as indicated by you - was in fact correct from the beginning. Apparently, a number of mistakes here when testing - e.g. drifting sensors and rotating to may things at a time - made me believe I had a wrong concept.
    – Matthias Sokolowski
    Aug 8 at 23:19















If you know the current quaternion with respect to the original zero measurement, why don't you just apply the inverse of the current quaternion? That would bring you back to the identity (presumably your zero orientation?)
– rschwieb
Aug 8 at 19:42





If you know the current quaternion with respect to the original zero measurement, why don't you just apply the inverse of the current quaternion? That would bring you back to the identity (presumably your zero orientation?)
– rschwieb
Aug 8 at 19:42













I am not sure what you try to say? Could you write that down formally? I am working with quaternions since yesterday, so I am not yet on a 'why don't you just...' base here...
– Matthias Sokolowski
Aug 8 at 20:31




I am not sure what you try to say? Could you write that down formally? I am working with quaternions since yesterday, so I am not yet on a 'why don't you just...' base here...
– Matthias Sokolowski
Aug 8 at 20:31












That's funny, I am not sure what you try to say? Could you write that down formally? is exactly what I was going to start with in my last comment. I don't really understand what challenge there is in "zeroing out" the sensor. "Zeroing out" implies you have a fixed "zero value" that you can re-assign to the value. Why would the zero value ever change? But let's ignore that for now and go on to a nother question: if you have "the zeroing rotation", and you "want to undo the rotation" you would just use the inverse rotation. The inverse rotation, by definition, undoes the rotation.
– rschwieb
Aug 8 at 20:37





That's funny, I am not sure what you try to say? Could you write that down formally? is exactly what I was going to start with in my last comment. I don't really understand what challenge there is in "zeroing out" the sensor. "Zeroing out" implies you have a fixed "zero value" that you can re-assign to the value. Why would the zero value ever change? But let's ignore that for now and go on to a nother question: if you have "the zeroing rotation", and you "want to undo the rotation" you would just use the inverse rotation. The inverse rotation, by definition, undoes the rotation.
– rschwieb
Aug 8 at 20:37













So is the second thing what you are looking for? "I have a rotation and I want to undo it"?
– rschwieb
Aug 8 at 20:38




So is the second thing what you are looking for? "I have a rotation and I want to undo it"?
– rschwieb
Aug 8 at 20:38












Ok, I am pretty sure, that I kind of self answered my question and my original solution - also as indicated by you - was in fact correct from the beginning. Apparently, a number of mistakes here when testing - e.g. drifting sensors and rotating to may things at a time - made me believe I had a wrong concept.
– Matthias Sokolowski
Aug 8 at 23:19




Ok, I am pretty sure, that I kind of self answered my question and my original solution - also as indicated by you - was in fact correct from the beginning. Apparently, a number of mistakes here when testing - e.g. drifting sensors and rotating to may things at a time - made me believe I had a wrong concept.
– Matthias Sokolowski
Aug 8 at 23:19










1 Answer
1






active

oldest

votes

















up vote
0
down vote













My own mistakes during testing made me believe I applied the wrong concept. However, the solution explained above is in fact correct.






share|cite|improve this answer




















    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2876502%2fzeroing-a-rotation-quaternion-inversion%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    My own mistakes during testing made me believe I applied the wrong concept. However, the solution explained above is in fact correct.






    share|cite|improve this answer
























      up vote
      0
      down vote













      My own mistakes during testing made me believe I applied the wrong concept. However, the solution explained above is in fact correct.






      share|cite|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        My own mistakes during testing made me believe I applied the wrong concept. However, the solution explained above is in fact correct.






        share|cite|improve this answer












        My own mistakes during testing made me believe I applied the wrong concept. However, the solution explained above is in fact correct.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Aug 8 at 23:20









        Matthias Sokolowski

        111




        111






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2876502%2fzeroing-a-rotation-quaternion-inversion%23new-answer', 'question_page');

            );

            Post as a guest













































































            這個網誌中的熱門文章

            How to combine Bézier curves to a surface?

            Mutual Information Always Non-negative

            Why am i infinitely getting the same tweet with the Twitter Search API?