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

[pose_broadcaster] Check for valid pose before attempting to publish a tf for it (backport #1479) #1483

Merged
merged 5 commits into from
Jan 11, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 9, 2025

Deactivate the controller otherwise

When using the pose_broadcaster e.g. with mock hardware, the pose state interfaces might not contain any value (NaN), if there are no initial values inside the URDF. However, it might not make sense to set an initial value as this would be plain wrong information. Imagine a robot-calculated forward kinematics that generates that pose. Initializing this to any fixed value will just be wrong. IMHO it would be better to explicitly state that there is no valid information available.

Currently, attempting to publish a tf with no pose information will result in spamming the shell with

TF_NAN_INPUT: Ignoring transform for child_frame_id "tool0_controller" from authority "Authority undetectable" because of a nan value in the transform (nan nan nan) (nan nan nan nan)

In this PR I added a check for a valid pose before attempting to publish a tf and return an error in case of an invalid pose.


This is an automatic backport of pull request #1479 done by Mergify.

…a tf for it (#1479)

(cherry picked from commit 67096bd)

# Conflicts:
#	pose_broadcaster/test/test_pose_broadcaster.hpp
@mergify mergify bot added the conflicts label Jan 9, 2025
Copy link
Contributor Author

mergify bot commented Jan 9, 2025

Cherry-pick of 67096bd has failed:

On branch mergify/bp/humble/pr-1479
Your branch is up to date with 'origin/humble'.

You are currently cherry-picking commit 67096bd.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   pose_broadcaster/src/pose_broadcaster.cpp
	modified:   pose_broadcaster/test/test_pose_broadcaster.cpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   pose_broadcaster/test/test_pose_broadcaster.hpp

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

bmagyar
bmagyar previously approved these changes Jan 10, 2025
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for fixing the API calls

Copy link

codecov bot commented Jan 11, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 15 lines in your changes missing coverage. Please review.

Project coverage is 66.76%. Comparing base (b4d79ab) to head (85e89b3).
Report is 1 commits behind head on humble.

Files with missing lines Patch % Lines
pose_broadcaster/test/test_pose_broadcaster.cpp 54.83% 0 Missing and 14 partials ⚠️
pose_broadcaster/src/pose_broadcaster.cpp 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           humble    #1483      +/-   ##
==========================================
+ Coverage   66.74%   66.76%   +0.01%     
==========================================
  Files         113      113              
  Lines       13333    13376      +43     
  Branches     8246     8274      +28     
==========================================
+ Hits         8899     8930      +31     
  Misses       1438     1438              
- Partials     2996     3008      +12     
Flag Coverage Δ
unittests 66.76% <66.66%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
pose_broadcaster/test/test_pose_broadcaster.hpp 94.73% <100.00%> (+11.40%) ⬆️
pose_broadcaster/src/pose_broadcaster.cpp 79.16% <91.66%> (+2.69%) ⬆️
pose_broadcaster/test/test_pose_broadcaster.cpp 57.77% <54.83%> (-0.88%) ⬇️

@christophfroehlich christophfroehlich merged commit 15a1a78 into humble Jan 11, 2025
11 of 13 checks passed
@christophfroehlich christophfroehlich deleted the mergify/bp/humble/pr-1479 branch January 11, 2025 15:22
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.

4 participants