Skip to content

Add conversion for SDFormat Links#5

Merged
azeey merged 12 commits intomainfrom
azeey/add_link
May 12, 2022
Merged

Add conversion for SDFormat Links#5
azeey merged 12 commits intomainfrom
azeey/add_link

Conversation

@azeey
Copy link
Copy Markdown
Collaborator

@azeey azeey commented May 4, 2022

🎉 New feature

Summary

Builds on top of #2 to add conversion for links.

Test it

Run unit tests

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • 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 and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Addisu Z. Taddese added 4 commits April 25, 2022 23:51
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Base automatically changed from azeey/add_primitive_geometry to main May 10, 2022 16:19
Addisu Z. Taddese added 2 commits May 10, 2022 13:40
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@codecov
Copy link
Copy Markdown

codecov bot commented May 10, 2022

Codecov Report

Merging #5 (75246aa) into main (135d294) will increase coverage by 4.94%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
+ Coverage   89.41%   94.36%   +4.94%     
==========================================
  Files           6        7       +1     
  Lines         189      213      +24     
==========================================
+ Hits          169      201      +32     
+ Misses         20       12       -8     
Impacted Files Coverage Δ
sdformat_mjcf/sdformat_mjcf/converters/link.py 100.00% <100.00%> (ø)
sdformat_mjcf/sdformat_mjcf/sdf_utils.py 88.00% <100.00%> (+35.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 135d294...75246aa. Read the comment docs.

Comment on lines +82 to +86
for vi in range(link.visual_count()):
col = link.visual_by_index(vi)
if col.geometry() is not None:
add_visual(body, col, pose_resolver=pose_resolver)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for vi in range(link.visual_count()):
col = link.visual_by_index(vi)
if col.geometry() is not None:
add_visual(body, col, pose_resolver=pose_resolver)
for vi in range(link.visual_count()):
vis = link.visual_by_index(vi)
if vis.geometry() is not None:
add_visual(body, vis, pose_resolver=pose_resolver)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addisu Z. Taddese added 3 commits May 10, 2022 16:04
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey
Copy link
Copy Markdown
Collaborator Author

azeey commented May 10, 2022

I've added more tests in 3f481f2 to increase test coverage. @ahcorde PTAL.

@azeey azeey requested a review from scpeters May 10, 2022 22:31
Copy link
Copy Markdown
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

this looks reasonable to me. I would just consider adding an expectation on the exact value of the fullinertia attribute (see 175b5d1)

@azeey
Copy link
Copy Markdown
Collaborator Author

azeey commented May 12, 2022

this looks reasonable to me. I would just consider adding an expectation on the exact value of the fullinertia attribute (see 175b5d1)

Thanks Steve! Are those values based on a known shape?

Edit: I've cherry-picked 175b5d1

scpeters and others added 3 commits May 12, 2022 16:12
This strategically increases the inertia values in the test
and adds an expectation for the exact value of the
fullinertia attribute.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey merged commit 83f1392 into main May 12, 2022
@azeey azeey deleted the azeey/add_link branch May 12, 2022 21:28
@scpeters
Copy link
Copy Markdown
Member

Thanks Steve! Are those values based on a known shape?

Yes, they are based on a box with relative dimensions 1x4x9. I started with the values in this test case but increased the mass by a factor of 32 (12 -> 384) to avoid decimals in the inertial values (aside from sqrt(6)). Looking again the values could all be reduced by a factor of 4, but I think it works either way.

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.

3 participants