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

Backport #2231 to garden: use sdf FindElement API to avoid const_cast #2236

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

scpeters
Copy link
Member

🦟 Bug fix

Backport #2231 to garden: use sdf FindElement API to avoid const_cast

Summary

Several systems use const_cast in order to call
sdf::Element::GetElement with const ElementPtrs,
but the FindElement API can be used instead.

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

Note to maintainers: Remember to use Rebase-and-Merge.

Several systems use const_cast in order to call
sdf::Element::GetElement with const ElementPtrs,
but the FindElement API can be used instead.

Signed-off-by: Steve Peters <[email protected]>
@scpeters scpeters requested a review from mjcarroll as a code owner November 10, 2023 19:27
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Nov 10, 2023
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Merging #2236 (d53bc0f) into gz-sim7 (e88a46f) will decrease coverage by 0.03%.
The diff coverage is 90.90%.

❗ Current head d53bc0f differs from pull request most recent head 955933f. Consider uploading reports for the commit 955933f to get more accurate results

@@             Coverage Diff             @@
##           gz-sim7    #2236      +/-   ##
===========================================
- Coverage    64.77%   64.75%   -0.03%     
===========================================
  Files          357      357              
  Lines        29144    29138       -6     
===========================================
- Hits         18877    18867      -10     
- Misses       10267    10271       +4     
Files Coverage Δ
src/systems/diff_drive/DiffDrive.cc 83.57% <100.00%> (-0.06%) ⬇️
...stems/joint_state_publisher/JointStatePublisher.cc 83.73% <100.00%> (-0.14%) ⬇️
...ms/joint_traj_control/JointTrajectoryController.cc 78.80% <100.00%> (-0.07%) ⬇️
src/systems/log/LogRecord.cc 79.15% <100.00%> (-0.09%) ⬇️
src/systems/velocity_control/VelocityControl.cc 90.07% <100.00%> (-0.08%) ⬇️
src/systems/tracked_vehicle/TrackedVehicle.cc 46.22% <75.00%> (-0.17%) ⬇️

... and 4 files with indirect coverage changes

@mjcarroll mjcarroll merged commit 409efa7 into gz-sim7 Nov 13, 2023
10 of 12 checks passed
@mjcarroll mjcarroll deleted the scpeters/backport_rm_const_cast_sdf branch November 13, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants