You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix: moveit_servo: future-stamped commands remain active past incoming_command_timeout - #4034
Fix for moveit/moveit2 issue #4033 (moveit_servo: future-stamped commands remain active past incoming_command_timeout). Collision check clean: issue timeline shows no linked PR, body search hit only unrelated 2022 PR #1333. Implemented the issue's first proposed fix (clamp + throttled warning): new parameter incoming_command_future_tolerance (double, default 0.1 s, gt_eq 0.0) in config/servo_parameters.yaml; ServoNode::clampFutureCommandStamp() clamps any joint-jog/twist/pose header stamp more than the tolerance ahead of node time back to receipt time and emits a 1 s-throttled warning naming the clock-sync cause; the existing (now - stamp) >= incoming_command_timeout staleness checks are unchanged, so a clamped command now expires normally once input stops while small millisecond skew passes through untouched. Added regression test testFutureStampedTwistExpires in tests/test_ros_integration.cpp: streams twist commands stamped +5 s for 1 s, asserts Servo drives while input is live, then asserts zero additional trajectory messages 1 s after the 0.5 s test-config timeout (pre-fix this fails: the command stays fresh for 5 s). Pushed to SIDDARTHAREDDY8/moveit2 branch oss-bhai-2026-11-29-p1, 1 commit ahead of main @ 5399d29 (the exact main SHA cited in the issue), compare verified: only these 4 files, all additions. DCO: single Signed-off-by line on the fresh commit. NOT verified in a live ROS run: this lane has no ROS (/opt/ros absent, no ros2/colcon), so the reporter's repro script and the repo's own gtest suite could not run here; verification was a C++ harness compiling the ACTUAL extracted clampFutureStamp function against stub rclcpp types (7/7 boundary checks pass: 5 s future clamps, 50 ms/100 ms-boundary untouched, 101 ms clamps, past stamp untouched, tolerance-0 behavior) plus a simulation showing the repro case flips from age -4.40 s (never stale) to +0.60 s (stale) at 0.6 s after input stops. The new integration test needs CI/a ROS Jazzy run to execute.
Tests pass: Repo gtest suite and reporter repro script NOT runnable in this lane: no ROS installed (/opt/ros absent, no ros2/colcon). Focused verification ran and passed: C++ harness compiled the actual extracted clampFutureStamp function from the pushed servo_node.cpp against stub rclcpp::Time/Duration and passed 7/7 boundary checks; Python simulation of the unchanged staleness check confirmed the repro case (5 s future stamp, 0.6 s after last command) flips from never-stale to stale. YAML validated by parse. New regression test testFutureStampedTwistExpires added but not executed here; must run under CI/ROS Jazzy.
Summary by CodeRabbit
Bug Fixes
Commands stamped significantly ahead of the current time are now adjusted to their receipt time, helping prevent outdated motion commands from continuing to generate trajectories.
Small differences between command timestamps and the current time remain unchanged.
Configuration
Added a nonnegative setting to control how far ahead a command timestamp can be before it is adjusted. The default tolerance is 0.1 seconds.
No actionable comments were generated in the recent review.
Walkthrough
Servo adds a configurable tolerance for future command timestamps. The JointJog, TwistStamped, and PoseStamped callbacks clamp timestamps beyond the tolerance to receipt time. An integration test checks trajectory generation after future-stamped twist commands stop arriving.
Changes: Future-stamped command handling
Layer / File(s)
Summary
Configure and apply timestamp clamping moveit_ros/moveit_servo/config/servo_parameters.yaml, moveit_ros/moveit_servo/include/moveit_servo/servo_node.hpp, moveit_ros/moveit_servo/src/servo_node.cpp, moveit_ros/moveit_servo/tests/test_ros_integration.cpp
Adds a nonnegative incoming_command_future_tolerance parameter, defaulting to 0.1 seconds. The JointJog, TwistStamped, and PoseStamped callbacks clamp timestamps beyond the tolerance to receipt time and issue a warning throttled to once per second. An integration test publishes commands stamped five seconds ahead and checks that trajectory generation stops after publishing ends.
sequenceDiagram
participant Publisher
participant ServoNode
participant TrajectoryOutput
Publisher->>ServoNode: Publish stamped command
ServoNode->>ServoNode: Compare stamp with future tolerance
ServoNode->>ServoNode: Clamp to receipt time if beyond tolerance
ServoNode->>TrajectoryOutput: Generate trajectory while commands arrive
Loading
Suggested reviewers:nbbrooks, rhaschke
Merge Risk: Minimal · up to a5d52
Servo now clamps command timestamps that are far in the future to their receipt time, so such commands expire after the configured timeout. The change is small and its default allows normal clock skew. The new integration test should be confirmed in CI before merge.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the Servo fix: future-stamped commands stay active past incoming_command_timeout. The changeset clamps future command stamps (joint jog, twist, pose) to receipt time when they exceed i…
Linked Issues check
Directly linked issue #4033 requires that future-dated Servo commands not stay active beyond incoming_command_timeout, that small positive skew be allowed, and that the fix apply to twist, joint jog, …
Out of Scope Changes check
The PR changes four files: the servo_parameters.yaml parameter addition, the servo_node.hpp helper declaration, the servo_node.cpp clamp logic and callback calls, and the regression test in test_ros_i…
Full details: Title check
Explanation
The title names the Servo fix: future-stamped commands stay active past incoming_command_timeout. The changeset clamps future command stamps (joint jog, twist, pose) to receipt time when they exceed incoming_command_future_tolerance, and adds a test for the expired-command behavior. The title matches the main change. The title uses the "Fix:" prefix and a package scope, which is acceptable.
Full details: Linked Issues check
Explanation
Directly linked issue #4033 requires that future-dated Servo commands not stay active beyond incoming_command_timeout, that small positive skew be allowed, and that the fix apply to twist, joint jog, and pose inputs. The file read of moveit_ros/moveit_servo/src/servo_node.cpp at the reviewed head shows: (1) clampFutureStamp returns node time when stamp - now exceeds incoming_command_future_tolerance and returns the stamp otherwise; (2) clampFutureCommandStamp applies this clamp and emits a 1 s throttled warning; (3) jointJogCallback, twistCallback, and poseCallback each call the clamp on the copied header stamp before setting the new-message flag; (4) the existing (node_->now() - stamp) >= incoming_command_timeout staleness checks are unchanged, so clamped commands expire after input stops. This matches the issue's first proposed fix. The config parameter and the header declaration were not read through the diff tool because the whole-PR diff was unavailable. The servo_node.cpp file read supports the call sites and the helper's use of servo_params_.incoming_command_future_tolerance. The new regression test in tests/test_ros_integration.cpp was not executed. This does not affect the verdict, because the issue requires code behavior and the code path is shown. Residual uncertainty: the build and the test run were not confirmed in this lane.
Full details: Out of Scope Changes check
Explanation
The PR changes four files: the servo_parameters.yaml parameter addition, the servo_node.hpp helper declaration, the servo_node.cpp clamp logic and callback calls, and the regression test in test_ros_integration.cpp. Each change supports the #4033 objective: the parameter sets the tolerance, the header and source implement the clamp, and the test checks the expiry behavior. The reviewed servo_node.cpp shows no unrelated logic changes in the staleness checks or the command processing paths. No unrelated change was found in the evidence available.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.
Queue this pull request once it meets the queue conditions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4033.
Fix for moveit/moveit2 issue #4033 (moveit_servo: future-stamped commands remain active past incoming_command_timeout). Collision check clean: issue timeline shows no linked PR, body search hit only unrelated 2022 PR #1333. Implemented the issue's first proposed fix (clamp + throttled warning): new parameter incoming_command_future_tolerance (double, default 0.1 s, gt_eq 0.0) in config/servo_parameters.yaml; ServoNode::clampFutureCommandStamp() clamps any joint-jog/twist/pose header stamp more than the tolerance ahead of node time back to receipt time and emits a 1 s-throttled warning naming the clock-sync cause; the existing (now - stamp) >= incoming_command_timeout staleness checks are unchanged, so a clamped command now expires normally once input stops while small millisecond skew passes through untouched. Added regression test testFutureStampedTwistExpires in tests/test_ros_integration.cpp: streams twist commands stamped +5 s for 1 s, asserts Servo drives while input is live, then asserts zero additional trajectory messages 1 s after the 0.5 s test-config timeout (pre-fix this fails: the command stays fresh for 5 s). Pushed to SIDDARTHAREDDY8/moveit2 branch oss-bhai-2026-11-29-p1, 1 commit ahead of main @ 5399d29 (the exact main SHA cited in the issue), compare verified: only these 4 files, all additions. DCO: single Signed-off-by line on the fresh commit. NOT verified in a live ROS run: this lane has no ROS (/opt/ros absent, no ros2/colcon), so the reporter's repro script and the repo's own gtest suite could not run here; verification was a C++ harness compiling the ACTUAL extracted clampFutureStamp function against stub rclcpp types (7/7 boundary checks pass: 5 s future clamps, 50 ms/100 ms-boundary untouched, 101 ms clamps, past stamp untouched, tolerance-0 behavior) plus a simulation showing the repro case flips from age -4.40 s (never stale) to +0.60 s (stale) at 0.6 s after input stops. The new integration test needs CI/a ROS Jazzy run to execute.
Tests pass: Repo gtest suite and reporter repro script NOT runnable in this lane: no ROS installed (/opt/ros absent, no ros2/colcon). Focused verification ran and passed: C++ harness compiled the actual extracted clampFutureStamp function from the pushed servo_node.cpp against stub rclcpp::Time/Duration and passed 7/7 boundary checks; Python simulation of the unchanged staleness check confirmed the repro case (5 s future stamp, 0.6 s after last command) flips from never-stale to stale. YAML validated by parse. New regression test testFutureStampedTwistExpires added but not executed here; must run under CI/ROS Jazzy.
Summary by CodeRabbit
Bug Fixes
Configuration