Skip to content

Fix: Reset both sec and nanosec in time_from_start #1709

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

Merged

Conversation

arnavk23
Copy link
Contributor

Fixes issue #1708 by resetting both seconds and nanoseconds in time_from_start.

Previously, only seconds were reset with set__sec(0), but nanoseconds remained unchanged, causing incorrect time resets.

This patch sets both sec and nanosec to zero explicitly.

Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.70%. Comparing base (1b92f30) to head (e9101b0).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1709   +/-   ##
=======================================
  Coverage   85.69%   85.70%           
=======================================
  Files         123      123           
  Lines       11895    11896    +1     
  Branches     1014     1014           
=======================================
+ Hits        10194    10195    +1     
  Misses       1379     1379           
  Partials      322      322           
Flag Coverage Δ
unittests 85.70% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ory_controller/src/joint_trajectory_controller.cpp 86.01% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@christophfroehlich christophfroehlich added backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. backport-jazzy labels May 27, 2025
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

Thanks. I had a quick look to find a one-line assignment, but there is also none in rclcpp::duration.

@christophfroehlich christophfroehlich merged commit 483d6ac into ros-controls:master May 27, 2025
24 of 27 checks passed
mergify bot pushed a commit that referenced this pull request May 27, 2025
mergify bot pushed a commit that referenced this pull request May 27, 2025
@arnavk23 arnavk23 deleted the fix-reset-sec-nanosec branch May 27, 2025 08:30
christophfroehlich pushed a commit that referenced this pull request May 27, 2025
christophfroehlich pushed a commit that referenced this pull request May 27, 2025
@arnavk23 arnavk23 restored the fix-reset-sec-nanosec branch May 31, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. backport-jazzy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants