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

Add Joint class #1910

Merged
merged 4 commits into from
Mar 1, 2023
Merged

Add Joint class #1910

merged 4 commits into from
Mar 1, 2023

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Mar 1, 2023

🎉 New feature

Part of #325

Summary

Add Joint APIs that help ease migration from gazebo-classic.

Note that I kept the API names somewhat consistent with classic but there are a few things to note:

  • The Set* functions now take a vector of doubles as arg (consistent with as the JointVelocity component) instead of a scalar value and joint index, e.g.
    • gz-sim: SetVelocity(const std::vector<double> &_vel)
    • classic: SetVelocity(unsigned int _index, double _vel)
  • The getter and setter function names use singular nouns instead of plural, .e.g. SetVelocity instead of SetVelocities, also done to be consistent with the naming convention in the joint component, e.g. JointVelocity
  • Enable*Check must be called before reading velocity/position/wrench data

Test it

Run the UNIT_Joint_TEST and INTEGRATION_joint 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.

Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Signed-off-by: Ian Chen <ichen@openrobotics.org>
@iche033 iche033 requested a review from mjcarroll as a code owner March 1, 2023 03:30
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Mar 1, 2023
@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #1910 (2dd193c) into ign-gazebo6 (472f7e5) will increase coverage by 0.14%.
The diff coverage is 96.99%.

❗ Current head 2dd193c differs from pull request most recent head ecb51d8. Consider uploading reports for the commit ecb51d8 to get more accurate results

@@               Coverage Diff               @@
##           ign-gazebo6    #1910      +/-   ##
===============================================
+ Coverage        64.83%   64.98%   +0.14%     
===============================================
  Files              323      324       +1     
  Lines            26429    26562     +133     
===============================================
+ Hits             17135    17261     +126     
- Misses            9294     9301       +7     
Impacted Files Coverage Δ
src/Joint.cc 96.99% <96.99%> (ø)
src/network/PeerInfo.cc 95.45% <0.00%> (-4.55%) ⬇️
src/network/NetworkManagerSecondary.cc 79.68% <0.00%> (-1.57%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

just a small comment about style but LGTM

ecm.CreateComponent<components::ChildLinkName>(id,
components::ChildLinkName("child_joint_name"));
EXPECT_EQ("child_joint_name", joint.ChildLinkName(ecm));

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Signed-off-by: Ian Chen <ichen@openrobotics.org>
@iche033 iche033 merged commit 89df3b7 into ign-gazebo6 Mar 1, 2023
@iche033 iche033 deleted the joint_api branch March 1, 2023 22:42
@iche033 iche033 mentioned this pull request Mar 2, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants