Skip to content

Commit cdcacb5

Browse files
📝 Remove wrong information about trajectory replacement (#1979)
1 parent 1a4e19a commit cdcacb5

File tree

4 files changed

+2
-55
lines changed

4 files changed

+2
-55
lines changed

joint_trajectory_controller/doc/trajectory.rst

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -111,60 +111,7 @@ To visualize the difference of the different interpolation methods and their inp
111111

112112
Trajectory Replacement
113113
---------------------------------
114-
*Parts of this documentation were originally published in the ROS 1 wiki under the* `CC BY 3.0 license <https://creativecommons.org/licenses/by/3.0/>`_. [#f1]_
115-
116114
Joint trajectory messages allow to specify the time at which a new trajectory should start executing by means of the header timestamp, where zero time (the default) means "start now".
117115

118-
The arrival of a new trajectory command does not necessarily mean that the controller will completely discard the currently running trajectory and substitute it with the new one.
119-
Rather, the controller will take the useful parts of both and combine them appropriately, yielding a smarter trajectory replacement strategy.
120-
121-
The steps followed by the controller for trajectory replacement are as follows:
122-
123-
+ Get useful parts of the new trajectory: Preserve all waypoints whose time to be reached is in the future, and discard those with times in the past.
124-
If there are no useful parts (ie. all waypoints are in the past) the new trajectory is rejected and the current one continues execution without changes.
125-
126-
+ Get useful parts of the current trajectory: Preserve the current trajectory up to the start time of the new trajectory, discard the later parts.
127-
128-
+ Combine the useful parts of the current and new trajectories.
129-
130-
The following examples describe this behavior in detail.
131-
132-
The first example shows a joint which is in hold position mode (flat grey line labeled *pos hold* in the figure below).
133-
A new trajectory (shown in red) arrives at the current time (now), which contains three waypoints and a start time in the future (*traj start*).
134-
The time at which waypoints should be reached (``time_from_start`` member of ``trajectory_msgs/JointTrajectoryPoint``) is relative to the trajectory start time.
135-
136-
The controller splices the current hold trajectory at time *traj start* and appends the three waypoints.
137-
Notice that between now and *traj start* the previous position hold is still maintained, as the new trajectory is not supposed to start yet.
138-
After the last waypoint is reached, its position is held until new commands arrive.
139-
140-
.. image:: new_trajectory.png
141-
:alt: Receiving a new trajectory.
142-
143-
|
144-
145-
The controller guarantees that the transition between the current and new trajectories will be smooth. Longer times to reach the first waypoint mean slower transitions.
146-
147-
The next examples discuss the effect of sending the same trajectory to the controller with different start times.
148-
The scenario is that of a controller executing the trajectory from the previous example (shown in red),
149-
and receiving a new command (shown in green) with a trajectory start time set to either zero (start now),
150-
a future time, or a time in the past.
151-
152-
.. image:: trajectory_replacement_future.png
153-
:alt: Trajectory start time in the future.
154-
155-
|
156-
157-
.. image:: trajectory_replacement_now.png
158-
:alt: Zero trajectory start time (start now).
159-
160-
|
161-
162-
Of special interest is the last example, where the new trajectory start time and first waypoint are in the past (before now).
163-
In this case, the first waypoint is discarded and only the second one is realized.
164-
165-
.. image:: trajectory_replacement_past.png
166-
:alt: Trajectory start time in the past.
167-
168-
|
169-
170-
.. [#f1] Adolfo Rodriguez: `Understanding trajectory replacement <http://wiki.ros.org/joint_trajectory_controller/UnderstandingTrajectoryReplacement>`_
116+
The current implementation just forgets the old trajectory.
117+
Follow this `issue <https://github.com/ros-controls/ros2_controllers/issues/84#issuecomment-2940787997>`__ for more information.
-70.1 KB
Binary file not shown.
-62.5 KB
Binary file not shown.
-72.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)