﻿# JointTrajectory timing: add waypoint duration to the trajectory start, not to message receipt

Preserve the trajectory header reference and waypoint time_from_start separately, including the reviewed zero-start sampling behavior and past-end validation.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/robotics-jointtrajectory-start-stamp-relative-waypoint-time/
Language: en

## Queueing can change a start-now command

A planning client creates a trajectory, then an adapter delays delivery. The client intended a fixed reference, but the adapter sends a zero start and assumes the original creation time remains implied. It does not. Distinguish a scheduled trajectory from a request to begin under the controller’s start-now handling. Retain the selected reference before comparing execution timing. Message creation, transport receipt, controller acceptance and first trajectory sampling are different events, even when a fast local demonstration makes them appear simultaneous.

## The message contains a reference and relative arrivals

The [trajectory definition](https://raw.githubusercontent.com/ros2/common_interfaces/rolling/trajectory_msgs/msg/JointTrajectory.msg) makes its header the reference for durations. The [waypoint definition](https://raw.githubusercontent.com/ros2/common_interfaces/rolling/trajectory_msgs/msg/JointTrajectoryPoint.msg) describes time_from_start as desired arrival time relative to the trajectory start. Do not reinterpret those offsets as intervals after each preceding point or after network receipt. Preserve their cumulative meaning when an adapter merges, slices or regenerates waypoints. A structurally valid array can still represent the wrong schedule if the offsets are rebased without the matching reference change.

## Zero start is resolved by the reviewed sampler

The [Kilted sampler](https://raw.githubusercontent.com/ros-controls/ros2_controllers/kilted/joint_trajectory_controller/src/trajectory.cpp) replaces a zero trajectory start with sample_time on first sampling. It then adds each waypoint’s time_from_start to that start. State this as reviewed implementation behavior, not a universal hardware scheduling guarantee. A client that requires an explicit dated schedule should preserve that requirement and the relevant clock contract. A start-now command should not be reported as if its first point was timed from the client’s earlier construction event.

## Validation and replacement have separate scopes

The reviewed [controller validation](https://raw.githubusercontent.com/ros-controls/ros2_controllers/kilted/joint_trajectory_controller/src/joint_trajectory_controller.cpp) rejects an explicitly dated trajectory whose last arrival is already past and requires strictly increasing waypoint durations. These checks do not prove a smooth handoff from an active trajectory. The [representation page](https://control.ros.org/kilted/doc/ros2_controllers/joint_trajectory_controller/doc/trajectory.html) warns that its legacy useful-parts splicing description is not ported. Do not copy that later prose into a claim of implemented blending. Qualify replacement behavior against the actual controller revision independently from the message’s timing semantics.

## Compare derived arrival times in a passive fixture

Propose identical harmless waypoints under zero and explicit start references, with a controlled delay before sampling. Inspect derived arrival times and validation outcomes, including a dated trajectory whose end is past. Keep the time source and first-sample event in the record. No controller, sampler or robot was executed here. Acceptance concerns the declared timing representation and its reviewed checks; it does not establish actual joint tracking, collision clearance, transport-latency bounds or equivalence between a delayed command and the originally planned motion.

## Retain the schedule before evaluating execution

[Remaining RPC deadlines](/journal/guide-grpc-deadline-hop/) preserve a different time boundary. [RH20T query-time provenance](/journal/fg2-rh20t-aligned-query-not-simultaneous-sensor-acquisition/) separates related acquisition and derived times. A trajectory record should retain header reference, relative waypoint arrivals, acceptance and first-sample timing. This lets a reviewer distinguish an invalid schedule, a changed reference and imperfect physical tracking. A successful submission alone cannot establish which of those questions was answered.
