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

JointPositionController: Improve misleading error message #1098

Merged
merged 8 commits into from
Oct 14, 2021

Conversation

chapulina
Copy link
Contributor

🦟 Bug fix

Summary

If another plugin adds the JointPosition component to the joint entity before the position controller does, it was printing this misleading message:

[Err] [JointPositionController.cc:256] [JointPositionController]: Detected an invalid <joint_index> parameter. The index specified is [0] but the joint only has [0] index[es]. This controller will be ignored

However, what's happening is that we need to wait one iteration for the physics system to populate the component.

The fix here means that the plugin will silently skip updates for joints that have zero axes, such as ball joints, though.

I also made sure that if the plugin is instantiated multiple times for multiple joints, the error message is printed for all of them.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • 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

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

@chapulina chapulina added the bug Something isn't working label Oct 8, 2021
@chapulina chapulina requested a review from azeey as a code owner October 8, 2021 22:55
@github-actions github-actions bot added the 🏰 citadel Ignition Citadel label Oct 8, 2021
Signed-off-by: Louise Poubel <[email protected]>
@codecov
Copy link

codecov bot commented Oct 8, 2021

Codecov Report

Merging #1098 (d4bab48) into ign-gazebo3 (d9195c4) will increase coverage by 0.28%.
The diff coverage is 78.24%.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-gazebo3    #1098      +/-   ##
===============================================
+ Coverage        77.56%   77.85%   +0.28%     
===============================================
  Files              208      221      +13     
  Lines            11385    12723    +1338     
===============================================
+ Hits              8831     9905    +1074     
- Misses            2554     2818     +264     
Impacted Files Coverage Δ
include/ignition/gazebo/EntityComponentManager.hh 100.00% <ø> (ø)
include/ignition/gazebo/Link.hh 100.00% <ø> (ø)
include/ignition/gazebo/Server.hh 100.00% <ø> (ø)
...nclude/ignition/gazebo/components/ContactSensor.hh 100.00% <ø> (ø)
include/ignition/gazebo/components/Factory.hh 96.05% <ø> (ø)
...nclude/ignition/gazebo/components/LogicalCamera.hh 100.00% <ø> (ø)
include/ignition/gazebo/components/Sensor.hh 100.00% <ø> (ø)
...nclude/ignition/gazebo/components/Serialization.hh 90.32% <ø> (ø)
include/ignition/gazebo/gui/GuiSystem.hh 0.00% <0.00%> (ø)
.../plugins/component_inspector/ComponentInspector.cc 8.58% <0.00%> (-0.90%) ⬇️
... and 111 more

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 e9be884...d4bab48. Read the comment docs.

Copy link
Contributor

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

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

Thanks! The error looks much clearer now! I've got a minor knit, it doesn't really matter as there should be a limited number of joints.

@chapulina chapulina mentioned this pull request Oct 11, 2021
7 tasks
Signed-off-by: Louise Poubel <[email protected]>
@chapulina chapulina requested a review from iche033 as a code owner October 12, 2021 17:28
Copy link
Contributor

@j-rivero j-rivero left a comment

Choose a reason for hiding this comment

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

first quick look at the code, looks good, one important question only

src/rendering/SceneManager.cc Outdated Show resolved Hide resolved
chapulina and others added 3 commits October 12, 2021 15:52
@chapulina chapulina merged commit 97e07f4 into ign-gazebo3 Oct 14, 2021
@chapulina chapulina deleted the chapulina/3/joint_pos_error branch October 14, 2021 20:24
WilliamLewww pushed a commit to WilliamLewww/ign-gazebo that referenced this pull request Dec 7, 2021
…1098)

Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: Jose Luis Rivero <[email protected]>
Signed-off-by: William Lew <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🏰 citadel Ignition Citadel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants