Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Adjoint transformation of a pure dual quaternion does not return a pure dual quaternion #68

Open
ffasilva opened this issue Mar 31, 2021 · 1 comment
Assignees
Labels
bug Something isn't working low priority

Comments

@ffasilva
Copy link
Member

Bug description

I have encountered some situations where given a pure dual quaternion wrench and a unit dual quaternion x, the Ad(x, wrench) operation is not returning a pure dual quaternion as expected.

To Reproduce

I have attached a minimal example that reproduces the problem. It arises when there are some residual values on the pose variable x (for instance, 10e-17) and the order of magnitude of the wrench variable starts to get sufficiently high. As the magnitude of the wrench keeps rising, the problem becomes more prominent. For a wrench composed of elements of the order of magnitude of 10e20/10e30, the numerical error appearing at the real part of the adjoint transformation's result can be as high as 10e15!

minimum_example_bug_ad.zip

Workaround

To deal with the reported problem, I have implemented a local version of the Ad() function that checks if x is a unit dual quaternion and wrench is a pure dual quaternion. If that is the case, it "purifies" the result of the transformation. The modification is given as follows.

function res = Ad(x,y)
    if(is_unit(x) && is_pure(y))
        res = x*y*x';
        res.q(1) = 0;
        res.q(5) = 0;
    else
        res = x*y*x';
    end
end

This probably is not a good permanent solution but could give some insights into one.

Environment:

  • OS: Ubuntu 18.04.5 LTS
  • dqrobotics version: 20.04.0.1 (MATLAB Add-On)
  • MATLAB version: R2020a
@ffasilva ffasilva added the bug Something isn't working label Mar 31, 2021
@bvadorno bvadorno self-assigned this Apr 1, 2023
@bvadorno
Copy link
Member

bvadorno commented Apr 3, 2023

Hi @ffasilva,

This is indeed an annoying numerical issue that might arise in pathological cases. However, I won't fix it as you suggested because your solution hides other issues the user might be doing wrong. In your example, the pure dual quaternion has a gigantic norm, which is a symptom of things going wrong elsewhere (a wrench in the order of 1e+15 will be unacceptable in most cases).

Also, I need to analyze it more to verify that the other components are numerically correct. Otherwise, just 'purifying' the dual quaternion might be geometrically incorrect.

I'll leave this bug open.

Many thanks,
Bruno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority
Projects
None yet
Development

No branches or pull requests

2 participants