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

New pose proposal (#252) #581

Closed
wants to merge 4 commits into from

Conversation

aaronchongth
Copy link
Collaborator

@aaronchongth aaronchongth commented Jun 2, 2021

🎉 New feature

Related to #252

Summary

  • Adding specific translation and rotation elements to pose.
  • rotation can be read according to its type attribute, rpy_degrees, rpy_radians, and q_wxyz.

Technically values and child elements are not supposed to live side-by-side, and there was no precedent of this use case. After some experimentation, I have found a workaround using the feature #542, to find out whether the translation and rotation elements were explicitly set.

This branch requires

With the intention of deprecating the old //pose descriptions, this proposal parses the poses by hierarchy, whereby whenever a translation or rotation child element is present, even if a value is specified, it will be ignored, for example,

<pose>
  1 2 3 4 5 6
  <translation></translation>
<pose>

In this case, where the translation child element is present, it is treated as an indication to use the new pose proposal, therefore using the default xyz values of (0, 0, 0) for translation, while failing to find a rotation child element also uses the default values, which are rpy of (0, 0, 0).

Alternatively, we could opt for overriding just the translation in this example, while leaving the rpy components to be (4, 5, 6).

Test it

source install/setup.bash
./build/sdformat12/test/integration/INTEGRATION_pose_1_9_sdf

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Code check passed (In source directory, run sh tools/code_check.sh)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review
    another open pull request
    to support the maintainers

Note to maintainers: Remember to use Squash-Merge

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@aaronchongth aaronchongth changed the title New pose proposal New pose proposal #252 Jun 2, 2021
@aaronchongth aaronchongth changed the title New pose proposal #252 New pose proposal (#252) Jun 2, 2021
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@aaronchongth aaronchongth requested a review from azeey June 3, 2021 15:31

<model name="model_with_rpy_deg_value">
<pose>
<rotation type="rpy_degrees">0 90 180</rotation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be careful using pitch values of 90 degrees in an example since that is a singularity


<model name="model_with_rpy_rad_value">
<pose>
<rotation type="rpy_radians">1 2 3</rotation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be careful using euler angles larger than pi/2 in an example because I believe they will be truncated internally when loaded and then show a different value when printed out again. For example, using the quaternion_*_euler executables in the ign-math examples:

$ ./quaternion_from_euler 1 2 3
Converting Euler angles:
 roll   1.000000 radians
 pitch  2.000000 radians
 yaw    3.000000 radians

 roll     57.295780 degrees
 pitch   114.591559 degrees
 yaw     171.887339 degrees

to Quaternion
 W  0.435953
 X -0.718287
 Y  0.310622
 Z  0.444435

to Rotation matrix
    0.411982  -0.833738  -0.367630
   -0.058727  -0.426918   0.902382
   -0.909297  -0.350175  -0.224845

then converting the quaternion back to Euler:

$ ./quaternion_to_euler 0.435953 -0.718287 0.310622 0.444435
Normalizing Quaternion components:
  W 0.435953
  X -0.718287
  Y 0.310622
  Z 0.444435
to
  W 0.435953
  X -0.718287
  Y 0.310622
  Z 0.444435

Converting to Euler angles
 roll  -2.141591 radians
 pitch  1.141592 radians
 yaw   -0.141591 radians

 roll  -122.704130 degrees
 pitch  65.408409 degrees
 yaw   -8.112557 degrees

to Rotation matrix
    0.411983  -0.833737  -0.367631
   -0.058726  -0.426918   0.902382
   -0.909297  -0.350176  -0.224845

the rotation matrices are the same, but it results in different Euler angles


<model name="model_with_both_rotations_first_value">
<pose>
<rotation type="rpy_radians">1 2 3</rotation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above about radians above pi/2

@EricCousineau-TRI
Copy link
Collaborator

Per VC, this is closed in lieu of minimal version, #589

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants