Skip to content

Commit

Permalink
Fix warning message to show precise jump back in time duration (#2435)
Browse files Browse the repository at this point in the history

---------

Signed-off-by: AddisonFarley <[email protected]>
  • Loading branch information
AddisonFarley authored Jun 6, 2024
1 parent 9e60fdc commit 0cc0464
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions src/systems/ackermann_steering/AckermannSteering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ void AckermannSteering::PreUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// If the joints haven't been identified yet, look for them
Expand Down
4 changes: 2 additions & 2 deletions src/systems/advanced_lift_drag/AdvancedLiftDrag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,8 @@ void AdvancedLiftDrag::PreUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

if (!this->dataPtr->initialized)
Expand Down
4 changes: 2 additions & 2 deletions src/systems/air_pressure/AirPressure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ void AirPressure::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

this->dataPtr->CreateSensors(_ecm);
Expand Down
4 changes: 2 additions & 2 deletions src/systems/air_speed/AirSpeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ void AirSpeed::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

this->dataPtr->CreateSensors(_ecm);
Expand Down
4 changes: 2 additions & 2 deletions src/systems/altimeter/Altimeter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ void Altimeter::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

this->dataPtr->CreateSensors(_ecm);
Expand Down
4 changes: 2 additions & 2 deletions src/systems/apply_joint_force/ApplyJointForce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ void ApplyJointForce::PreUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// If the joint hasn't been identified yet, look for it
Expand Down
4 changes: 2 additions & 2 deletions src/systems/battery_plugin/LinearBatteryPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ void LinearBatteryPlugin::Update(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

if (_info.paused)
Expand Down
4 changes: 2 additions & 2 deletions src/systems/contact/Contact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ void Contact::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

if (!_info.paused)
Expand Down
4 changes: 2 additions & 2 deletions src/systems/diff_drive/DiffDrive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ void DiffDrive::PreUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// If the joints haven't been identified yet, look for them
Expand Down
4 changes: 2 additions & 2 deletions src/systems/force_torque/ForceTorque.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ void ForceTorque::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

this->dataPtr->CreateSensors(_ecm);
Expand Down
4 changes: 2 additions & 2 deletions src/systems/imu/Imu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ void Imu::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

this->dataPtr->CreateSensors(_ecm);
Expand Down
4 changes: 2 additions & 2 deletions src/systems/joint_controller/JointController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ void JointController::PreUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// If the joints haven't been identified yet, look for them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ void JointPositionController::PreUpdate(
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// If the joints haven't been identified yet, look for them
Expand Down
4 changes: 2 additions & 2 deletions src/systems/lift_drag/LiftDrag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ void LiftDrag::PreUpdate(const UpdateInfo &_info, EntityComponentManager &_ecm)
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

if (!this->dataPtr->initialized)
Expand Down
4 changes: 2 additions & 2 deletions src/systems/log/LogRecord.cc
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,8 @@ void LogRecord::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// Publish only once
Expand Down
4 changes: 2 additions & 2 deletions src/systems/logical_camera/LogicalCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ void LogicalCamera::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

this->dataPtr->CreateSensors(_ecm);
Expand Down
4 changes: 2 additions & 2 deletions src/systems/magnetometer/Magnetometer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ void Magnetometer::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

this->dataPtr->CreateSensors(_ecm);
Expand Down
4 changes: 2 additions & 2 deletions src/systems/mecanum_drive/MecanumDrive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ void MecanumDrive::PreUpdate(const gz::sim::UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// If the joints haven't been identified yet, look for them
Expand Down
4 changes: 2 additions & 2 deletions src/systems/multicopter_control/MulticopterVelocityControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ void MulticopterVelocityControl::PreUpdate(
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// Nothing left to do if paused.
Expand Down
4 changes: 2 additions & 2 deletions src/systems/multicopter_motor_model/MulticopterMotorModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ void MulticopterMotorModel::PreUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// If the joint or links haven't been identified yet, look for them
Expand Down
4 changes: 2 additions & 2 deletions src/systems/navsat/NavSat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ void NavSat::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

this->dataPtr->CreateSensors(_ecm);
Expand Down
4 changes: 2 additions & 2 deletions src/systems/odometry_publisher/OdometryPublisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ void OdometryPublisher::PreUpdate(const gz::sim::UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// Create the pose component if it does not exist.
Expand Down
4 changes: 2 additions & 2 deletions src/systems/pose_publisher/PosePublisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ void PosePublisher::PostUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// Nothing left to do if paused.
Expand Down
4 changes: 2 additions & 2 deletions src/systems/touch_plugin/TouchPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ void TouchPluginPrivate::Update(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

{
Expand Down
4 changes: 2 additions & 2 deletions src/systems/velocity_control/VelocityControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ void VelocityControl::PreUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// Nothing left to do if paused.
Expand Down
4 changes: 2 additions & 2 deletions src/systems/wind_effects/WindEffects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,8 @@ void WindEffects::PreUpdate(const UpdateInfo &_info,
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
gzwarn << "Detected jump back in time ["
<< std::chrono::duration_cast<std::chrono::seconds>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
<< std::chrono::duration<double>(_info.dt).count()
<< "s]. System may not work properly." << std::endl;
}

// Process commands
Expand Down

0 comments on commit 0cc0464

Please sign in to comment.