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

Use quaternion to represent error when a joint has 3 degrees of freedom and a target is set #22

Open
gkjohnson opened this issue Oct 14, 2020 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@gkjohnson
Copy link
Owner

gkjohnson commented Oct 14, 2020

It may just be easiest to handle a full quaternion here always. This is an issue with ball joints (3dof) that are not goals / closures because the solver will try to move all the individual joint degrees of freedom. Closures are comparing error using quaternion differences.

The complexity of using quaternions only when a joint is 3dof is complicated -- it would be best to pick one and stick with it.

@gkjohnson gkjohnson added the enhancement New feature or request label Oct 14, 2020
@gkjohnson gkjohnson added this to the High Priority milestone Oct 14, 2020
@gkjohnson gkjohnson mentioned this issue Oct 15, 2020
7 tasks
@gkjohnson gkjohnson modified the milestones: v0.0.1, v0.0.2 Oct 16, 2020
@gkjohnson gkjohnson reopened this Oct 16, 2020
@gkjohnson gkjohnson modified the milestones: v0.0.2, v0.0.x Dec 28, 2020
@gkjohnson
Copy link
Owner Author

gkjohnson commented Dec 28, 2020

@gkjohnson gkjohnson modified the milestones: v0.0.x, v0.0.3 Dec 29, 2020
@gkjohnson
Copy link
Owner Author

gkjohnson commented Dec 31, 2020

Places that need to change if the joint is 3 rotational DoF:

Joint Target Error

Target error is just used for determining how far a joint is away from it's current angle target so we may want to calculate error in some way that doesn't use euler because of the redundant representations:

  • Setting jacobian error affect
  • Computing the error for a given target degree of freedom
    • This is where redundant representations can be an issue. Both rotations need to be converted to closest represented orientation vectors (consistently choose target or current to adjust so it can be done consistently on read back)
    • code reference

Computing Closure Error Adjustment

  • When computing the error delta from a DoF change we need to adjust it as though the orientation vector representation is being adjusted.

    • code reference -- this function call needs to be changed in order to adjust the orientation vector field rather than the euler values when computing the delta matrix to be consistent
  • The rest pose would need to be adjusted here and when setting joint values here.

EDIT: It may be best to book keep the rotations as exponential maps but then provide an API for manipulating it via euler. Or just providing a function for reading and setting rotations as exponential maps?

@gkjohnson gkjohnson modified the milestones: v0.0.3, v0.0.4, v0.0.x Jan 1, 2021
@gkjohnson gkjohnson modified the milestones: v0.0.x, v0.0.4 Jan 16, 2021
@gkjohnson
Copy link
Owner Author

gkjohnson commented Mar 13, 2021

In Appendix B of this paper the rotations are described as an "orientation vector" with rotation axis defined by the vector direction and rotation amount defined by vector length. The paper defines equations for converting these to and from quaternions but intuitively the axis angle functions should be able to be used for this.

Other Notes

  • Must be careful of which frame the orientation is defined in (parent frame).
  • When reaching a singularity ( > PI rotation ) the orientation vector is reparametrized.
  • Error computations need to take the shortest delta error.

@gkjohnson
Copy link
Owner Author

gkjohnson commented Mar 14, 2021

With the number of places that need to be carefully adjusted and rotation count checked it might be best to just bookkeep all rotation as orientation vectors internally and provide an API for getting and setting rotations via euler. OR a read function can be used in the solver that reads and sets joint values in an orientation vector format (would joint limits be harder to impose?)

@gkjohnson gkjohnson modified the milestones: v0.0.4, v0.0.5 Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant