Skip to content

NavSat::ToElement() method (backport #1585)#1638

Merged
azeey merged 1 commit into
sdf14from
mergify/bp/sdf14/pr-1585
Apr 30, 2026
Merged

NavSat::ToElement() method (backport #1585)#1638
azeey merged 1 commit into
sdf14from
mergify/bp/sdf14/pr-1585

Conversation

@mergify

@mergify mergify Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

🦟 Bug fix

Fixes #

Summary

sdf::NavSat didn't have a ToElement() method which prevent to convert sensor-specific information back to sdf format.

This PR include such changes:

  • Introduce sdf::NavSat::ToElement() method
  • Added this method call to dispatcher in Sensor::ToElement()
  • Also same dispatcher had misleading error msg: if user tried to convert sensor w/o sensor-specific information it will get error message about lack of this feature, but actually it's not correct. Dispatcher logic changed to avoid such misleading (split apart type check and pointer check)
  • And message was w/o trailing new_line symbol which makes console output harder to read
  • Added test for new ToElement() method; valgrind is happy
  • Couple of typos fixed

This PR was developed on top of sdf15 and retargeted to sdf16 due to sdf16 do not have dev packages.

Checklist

  • Signed all commits for DCO
  • Added tests
  • 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
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.


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

@mergify mergify Bot requested a review from azeey as a code owner March 3, 2026 19:38
@mergify mergify Bot added the conflicts label Mar 3, 2026
@mergify mergify Bot requested a review from scpeters as a code owner March 3, 2026 19:38
@mergify

mergify Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 8ccc60c has failed:

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

You are currently cherry-picking commit 8ccc60cd.
  (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:   include/sdf/Error.hh
	modified:   include/sdf/NavSat.hh
	modified:   src/Geometry.cc
	modified:   src/NavSat.cc
	modified:   src/NavSat_TEST.cc
	modified:   src/ScopedGraph.hh

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/Sensor.cc
	both modified:   src/Surface.cc

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

@github-actions github-actions Bot added the 🎵 harmonic Gazebo Harmonic label Mar 3, 2026
@mergify mergify Bot mentioned this pull request Mar 3, 2026
9 tasks
@scpeters scpeters force-pushed the mergify/bp/sdf14/pr-1585 branch from 48f0c55 to b2446c0 Compare April 17, 2026 21:46
@scpeters

Copy link
Copy Markdown
Member

I rebased and resolved conflicts

Comment thread src/Sensor.cc Outdated
elem->GetElement("update_rate")->Set<double>(_errors, this->UpdateRate());
elem->GetElement("enable_metrics")->Set<double>(_errors,
this->EnableMetrics());
>>>>>>> 8ccc60cd (NavSat::ToElement() method (#1585))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missed this one...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

resolved conflicts again and removed the frame_id field, since that was added in Ionic

`sdf::NavSat` didn't have a `ToElement()` method which prevent to convert sensor-specific information back to sdf format.

This PR include such changes:
* Introduce `sdf::NavSat::ToElement()` method
* Added this method call to dispatcher in `Sensor::ToElement()`
* Also same dispatcher had misleading error msg: if user tried to convert sensor w/o sensor-specific information it will get error message about lack of this feature, but actually it's not correct. Dispatcher logic changed to avoid such misleading (split apart type check and pointer check)
* And message was w/o trailing new_line symbol which makes console output harder to read
* Added test for new ToElement() method; valgrind is happy
* Couple of typos fixed

---------

Signed-off-by: Maksim Derbasov <ntfs.hard@gmail.com>
(cherry picked from commit 8ccc60c)
@scpeters scpeters force-pushed the mergify/bp/sdf14/pr-1585 branch from b2446c0 to 36b7248 Compare April 17, 2026 22:33
@scpeters

Copy link
Copy Markdown
Member

requesting other an alternate reviewer since I resolved conflicts

@github-project-automation github-project-automation Bot moved this from Inbox to In review in Core development Apr 30, 2026
@azeey azeey merged commit d81af1e into sdf14 Apr 30, 2026
12 checks passed
@azeey azeey deleted the mergify/bp/sdf14/pr-1585 branch April 30, 2026 20:52
@github-project-automation github-project-automation Bot moved this from In review to Done in Core development Apr 30, 2026
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