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

Fix warning message to show precise jump back in time duration #2435

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

AddisonFarley
Copy link
Contributor

🦟 Bug fix

Fixes #2407 (Incorrect warning msg when sim jumps back in time)

Summary

Refactor the following warning message code:

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;
  }

to:

if (_info.dt < std::chrono::steady_clock::duration::zero())
{
  gzwarn << "Detected jump back in time ["
         << std::chrono::duration<double>(_info.dt).count()
         << "s]. System may not work properly." << std::endl;
}

for the following files:

src/systems/ackermann_steering/AckermannSteering.cc
src/systems/advanced_lift_drag/AdvancedLiftDrag.cc
src/systems/air_pressure/AirPressure.cc
src/systems/air_speed/AirSpeed.cc
src/systems/altimeter/Altimeter.cc
src/systems/apply_joint_force/ApplyJointForce.cc
src/systems/battery_plugin/LinearBatteryPlugin.cc
src/systems/contact/Contact.cc
src/systems/diff_drive/DiffDrive.cc
src/systems/force_torque/ForceTorque.cc
src/systems/imu/Imu.cc
src/systems/joint_controller/JointController.cc
src/systems/joint_position_controller/JointPositionController.cc
src/systems/lift_drag/LiftDrag.cc
src/systems/log/LogRecord.cc
src/systems/logical_camera/LogicalCamera.cc
src/systems/magnetometer/Magnetometer.cc
src/systems/mecanum_drive/MecanumDrive.cc
src/systems/multicopter_control/MulticopterVelocityControl.cc
src/systems/multicopter_motor_model/MulticopterMotorModel.cc
src/systems/navsat/NavSat.cc
src/systems/odometry_publisher/OdometryPublisher.cc
src/systems/pose_publisher/PosePublisher.cc
src/systems/touch_plugin/TouchPlugin.cc
src/systems/tracked_vehicle/TrackedVehicle.cc
src/systems/velocity_control/VelocityControl.cc
src/systems/wind_effects/WindEffects.cc

@AddisonFarley AddisonFarley requested a review from mjcarroll as a code owner June 6, 2024 05:30
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Jun 6, 2024
Signed-off-by: AddisonFarley <93640684+AddisonFarley@users.noreply.github.com>
@AddisonFarley AddisonFarley force-pushed the fix-warning-message branch from 3478183 to fe6d398 Compare June 6, 2024 06:50
<< "s]. System may not work properly." << std::endl;
}

if (_info.dt < std::chrono::steady_clock::duration::zero())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update the indentation to match what it was before (2 spaces)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Signed-off-by: AddisonFarley <93640684+AddisonFarley@users.noreply.github.com>
Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thanks for your contribution!

@iche033 iche033 merged commit 0cc0464 into gazebosim:gz-sim8 Jun 6, 2024
7 of 8 checks passed
@AddisonFarley AddisonFarley deleted the fix-warning-message branch June 6, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Incorrect warning msg when sim jumps back in time
2 participants