Skip to content

Commit

Permalink
add more doc, user iterator
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
  • Loading branch information
iche033 committed Sep 17, 2020
1 parent 8386f5e commit 13f57fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gazebo/msgs/performance_metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ message PerformanceMetrics
required double sim_update_rate = 3;

/// \brief If the sensor is a camera then this field should be filled
/// with fps in real time.
/// with average fps in real time.
optional double fps = 4;
}

Expand Down
14 changes: 9 additions & 5 deletions gazebo/sensors/SensorManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ struct sensorPerformanceMetricsType
/// \brief sensor sim time update rate
double sensorSimUpdateRate;

/// \brief Rendering sensor average real time update rate
/// \brief Rendering sensor average real time update rate. The difference
/// between sensorAvgFps and sensorRealUpdateRte is that sensorAvgFps is
/// for rendering sensors only and the rate is averaged over a fixed
/// window size, whereas the sensorSimUpdateRate stores the instantaneous
/// update rate and it is filled by all sensors.
double sensorAvgFPS;
};

Expand Down Expand Up @@ -247,9 +251,9 @@ void PublishPerformanceMetrics()
(name, emptySensorPerfomanceMetrics));
if (ret2.second == false)
{
sensorPerformanceMetrics[name].sensorSimUpdateRate =
ret2.first->second.sensorSimUpdateRate =
1.0/updateSimRate;
sensorPerformanceMetrics[name].sensorRealUpdateRate =
ret2.first->second.sensorRealUpdateRate =
1.0/updateRealRate;
worldLastMeasurementTime[name] = world->RealTime();

Expand All @@ -258,12 +262,12 @@ void PublishPerformanceMetrics()
std::dynamic_pointer_cast<sensors::CameraSensor>(sensor);
if (nullptr != cameraSensor)
{
sensorPerformanceMetrics[name].sensorAvgFPS =
ret2.first->second.sensorAvgFPS =
cameraSensor->Camera()->AvgFPS();
}
else
{
sensorPerformanceMetrics[name].sensorAvgFPS = -1;
ret2.first->second.sensorAvgFPS = -1;
}
}
}
Expand Down

0 comments on commit 13f57fe

Please sign in to comment.