Skip to content

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

@ffasilva

Description

@ffasilva

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions