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

URDF parser: use SDFormat 1.11, parse joint mimic #1333

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Oct 3, 2023

🎉 New feature

Closes #1327

Summary

Support for joint mimic constraints were added to SDFormat 1.11, and the design has intentionally similar syntax to the URDF joint mimic tags, but support for parsing URDF joint mimic tags was not included in #1166. This small fix updates the URDF parser to generate SDFormat 1.11 files and adds support for parsing the //joint/mimic tags from URDF into //joint/axis/mimic tags from SDFormat.

I've converted the pendulum_rack_pinion model from the harmonic_demo harmonic_mimic_mechanisms.sdf world file to a URDF for use in a test.

Test it

  • Run the test bin/INTEGRATION_joint_axis_dom
  • Build a harmonic workspace from source including this branch and after sourcing the workspace, run gz sim -v 4 --physics-engine gz-physics-bullet-featherstone-plugin and then from the sdformat source folder, run the following command to spawn the test/sdf/joint_mimic_rack_pinion.urdf file into the world:
gz service -s /world/empty/create \
  --reqtype gz.msgs.EntityFactory \
  --reptype gz.msgs.Boolean \
  --timeout 300 \
  --req 'sdf_filename: "$PWD/test/sdf/joint_mimic_rack_pinion.urdf"'

You should see the pendulum swinging and the rack moving back and forth.

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.

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Merging #1333 (8dd88b4) into sdf14 (ea0d5ba) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 8dd88b4 differs from pull request most recent head 16ec0c7. Consider uploading reports for the commit 16ec0c7 to get more accurate results

@@            Coverage Diff             @@
##            sdf14    #1333      +/-   ##
==========================================
+ Coverage   87.49%   87.51%   +0.02%     
==========================================
  Files         134      134              
  Lines       17759    17768       +9     
==========================================
+ Hits        15538    15550      +12     
+ Misses       2221     2218       -3     
Files Coverage Δ
src/parser_urdf.cc 88.39% <100.00%> (+0.24%) ⬆️

src/parser_urdf.cc Outdated Show resolved Hide resolved
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
@scpeters scpeters force-pushed the scpeters/urdf_mimic branch from 6c55ffd to 16ec0c7 Compare October 3, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants