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

Init will now set the nextUpdateTime to zero #137

Merged
merged 2 commits into from
Jun 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/ignition/sensors/Sensor.hh
Original file line number Diff line number Diff line change
@@ -75,6 +75,9 @@ namespace ignition
public: virtual bool Load(sdf::ElementPtr _sdf);

/// \brief Initialize values in the sensor
/// This will set the next update time to zero. This is particularly
/// useful if simulation time has jumped backward, for example during
/// a seek backward in a log file.
public: virtual bool Init();

/// \brief Force the sensor to generate data
1 change: 1 addition & 0 deletions src/Sensor.cc
Original file line number Diff line number Diff line change
@@ -142,6 +142,7 @@ Sensor::Sensor() :
//////////////////////////////////////////////////
bool Sensor::Init()
{
this->dataPtr->nextUpdateTime = std::chrono::steady_clock::duration::zero();
return true;
}