-
Notifications
You must be signed in to change notification settings - Fork 59
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
Publish performance sensor metrics. #146
Conversation
Signed-off-by: Franco Cipollone <[email protected]>
It is ready for review @chapulina 😃 !, let me know if I should ask someone else for a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me, I just have various minor comments.
src/Sensor.cc
Outdated
double simUpdateRate; | ||
double realUpdateRate; | ||
const auto clockNow = std::chrono::steady_clock::now(); | ||
if(this->lastUpdateTime > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why can't it be zero?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is zero then this variable wasn't initialized(first iteration) yet so the calculus below is pointless.
Codecov Report
@@ Coverage Diff @@
## ign-sensors3 #146 +/- ##
================================================
+ Coverage 77.14% 77.17% +0.02%
================================================
Files 23 23
Lines 2306 2344 +38
================================================
+ Hits 1779 1809 +30
- Misses 527 535 +8
Continue to review full report at Codecov.
|
d3fc7b4
to
4470190
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! Let's bump the required libSDFormat
version on CMakeLists
once the 9.6.0 release is out: https://build.osrfoundation.org/job/sdformat9-debbuilder/
I made this quick PR to enable metrics on some Gazebo demos: gazebosim/gz-sim#982
1a6355e
to
1b3c6f7
Compare
Co-authored-by: Louise Poubel <[email protected]> Signed-off-by: Franco Cipollone <[email protected]>
Signed-off-by: Franco Cipollone <[email protected]>
Signed-off-by: Franco Cipollone <[email protected]>
Co-authored-by: Louise Poubel <[email protected]> Signed-off-by: Franco Cipollone <[email protected]>
1b3c6f7
to
a90110c
Compare
This reverts commit a90110c. Signed-off-by: Franco Cipollone <[email protected]>
Signed-off-by: Franco Cipollone <[email protected]>
This pull request has been mentioned on Gazebo Community. There might be relevant details there: https://community.gazebosim.org/t/new-ignition-releases-2022-01-10/1228/1 |
Signed-off-by: Franco Cipollone [email protected]
🎉 New feature
Related to gazebosim/gz-sim#557
Summary
ignition::sensors::Sensor
publishes a performance metric message (ignition::msgs::PeformanceSensorMetrics
)for each Update() call. The message is published at
<sensor_topic_name>/performance_metrics
ignition-msgs
in PR: Adds PerformanceSensorMetrics proto message. gz-msgs#172ignition::sensors::Sensor
provides an API to let the subclasses to publish a custom message or change the way the metrics are computed. For example,CameraSensor
'sPublishMetrics
implementation should also fill thefps
field of the message.Test it
It can be tested using an ignition simulation:
the sensors in the
.sdf
must enable this behavior by doing:<enable_metrics>true</enable_metrics>
Then we can do:
and then verify the messages being published:
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge