Skip to content

Add function to convert Sensor DOM to sdf::ElementPtr#753

Merged
nkoenig merged 4 commits intosdf12from
sensor_dom_to_elem
Nov 16, 2021
Merged

Add function to convert Sensor DOM to sdf::ElementPtr#753
nkoenig merged 4 commits intosdf12from
sensor_dom_to_elem

Conversation

@iche033
Copy link
Copy Markdown
Contributor

@iche033 iche033 commented Nov 13, 2021

🎉 New feature

needed by gazebosim/gz-sim#1201

Summary

Adds a helper function to convert Sensor DOM to sdf::ElementPr.

This is needed when saving sensor properties to SDF file.

Note: Not all sensors are supported. I focused on implementing conversions for sensor types that are currently supported in Ignition gazebo

  • camera
  • depth camera
  • rgbd camera
  • thermal camera
  • segmentation camera
  • gpu lidar
  • air pressure
  • altimeter
  • magnetometer
  • imu
  • force torque

there are 2 sensor types in ignition that do not have SDF DOM classes so I didn't write conversions for them:

  • contact
  • logical camera

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • 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

Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 13, 2021

Codecov Report

Merging #753 (851006e) into sdf12 (6307392) will increase coverage by 0.15%.
The diff coverage is 91.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##            sdf12     #753      +/-   ##
==========================================
+ Coverage   88.41%   88.57%   +0.15%     
==========================================
  Files          76       76              
  Lines       11457    11740     +283     
==========================================
+ Hits        10130    10399     +269     
- Misses       1327     1341      +14     
Impacted Files Coverage Δ
src/ForceTorque.cc 86.36% <76.78%> (-1.40%) ⬇️
src/Noise.cc 95.86% <82.14%> (-4.14%) ⬇️
src/Sensor.cc 90.55% <92.10%> (+0.21%) ⬆️
src/Camera.cc 86.69% <93.84%> (+3.13%) ⬆️
src/AirPressure.cc 100.00% <100.00%> (ø)
src/Altimeter.cc 100.00% <100.00%> (ø)
src/Imu.cc 100.00% <100.00%> (ø)
src/Lidar.cc 90.22% <100.00%> (+1.63%) ⬆️
src/Magnetometer.cc 100.00% <100.00%> (ø)
... and 1 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 6307392...851006e. Read the comment docs.

* Suggestion to move dom conversion to sensor classes

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* Remove file from smake

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* remove header file in cmake

Signed-off-by: Ian Chen <ichen@osrfoundation.org>

* Fixing build

Signed-off-by: Nate Koenig <nate@openrobotics.org>

Co-authored-by: Nate Koenig <nate@openrobotics.org>
Co-authored-by: Ian Chen <ichen@osrfoundation.org>
@nkoenig nkoenig merged commit ad00668 into sdf12 Nov 16, 2021
@nkoenig nkoenig deleted the sensor_dom_to_elem branch November 16, 2021 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏯 fortress Ignition Fortress 🌱 garden Ignition Garden

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants