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

[Joint State Broadcaster] Publish the joint_states of joints present in the URDF #1233

Conversation

saikishor
Copy link
Member

Right now, when no joints parameter is set, it publishes all the entities with the position, velocity and effort interfaces, and the MoveIt and other plugins do not like that information and continuously spam with the warning logs, we have like 50MB of logs for 6 min run.

This PR tries to publish the joint_states of the joints that are within the URDF when no joints or interface params are set.

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.39%. Comparing base (298df4b) to head (baf8b86).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1233      +/-   ##
==========================================
+ Coverage   80.23%   80.39%   +0.15%     
==========================================
  Files         105      105              
  Lines        9268     9333      +65     
  Branches      817      818       +1     
==========================================
+ Hits         7436     7503      +67     
+ Misses       1557     1556       -1     
+ Partials      275      274       -1     
Flag Coverage Δ
unittests 80.39% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
..._state_broadcaster/src/joint_state_broadcaster.cpp 87.17% <100.00%> (+1.74%) ⬆️
..._broadcaster/test/test_joint_state_broadcaster.cpp 95.37% <100.00%> (+1.52%) ⬆️

... and 1 file with indirect coverage changes

@christophfroehlich
Copy link
Contributor

JSB uses all joints defined in the ros2_control tag. with URDF you don't mean the ros2_control tag but the URDF-Model itself?
How can that be that someone has joints in the tag not being in the URDF model? RM does not init successfully anyways?

@saikishor
Copy link
Member Author

JSB uses all joints defined in the ros2_control tag. with URDF you don't mean the ros2_control tag but the URDF-Model itself?
How can that be that someone has joints in the tag not being in the URDF model? RM does not init successfully anyways?

You can have state interfaces from the actuators before transmission and after transmission are the joints so they are pretty different

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

I was not aware of the problem before. But adding gpio or sensor types with interfaces called position

<gpio name="my_gpio">
  <command_interface name="position"/>
  <state_interface name="position">
    <param name="initial_value">1.0</param>
  </state_interface>
</gpio>

lets the JSB publish them.

As we currently don't have information about the type of the handles in the controllers (they exist only in the HardwareInfo class) we have to parse that again from the URDF. --> this PR is a straight forward solution of implementing that.

@bmagyar bmagyar merged commit 4a6456f into ros-controls:master Aug 15, 2024
19 of 21 checks passed
RobertWilbrandt pushed a commit to RobertWilbrandt/ros2_controllers that referenced this pull request Sep 19, 2024
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