Skip to content

Commit 4f9f831

Browse files
christophfroehlichmergify[bot]
authored andcommitted
📝 Remove wrong information about trajectory replacement (#1979)
(cherry picked from commit cdcacb5)
1 parent 607f040 commit 4f9f831

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
@@ -109,60 +109,7 @@ To visualize the difference of the different interpolation methods and their inp
109109

110110
Trajectory Replacement
111111
---------------------------------
112-
*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]_
113-
114112
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".
115113

116-
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.
117-
Rather, the controller will take the useful parts of both and combine them appropriately, yielding a smarter trajectory replacement strategy.
118-
119-
The steps followed by the controller for trajectory replacement are as follows:
120-
121-
+ 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.
122-
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.
123-
124-
+ Get useful parts of the current trajectory: Preserve the current trajectory up to the start time of the new trajectory, discard the later parts.
125-
126-
+ Combine the useful parts of the current and new trajectories.
127-
128-
The following examples describe this behavior in detail.
129-
130-
The first example shows a joint which is in hold position mode (flat grey line labeled *pos hold* in the figure below).
131-
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*).
132-
The time at which waypoints should be reached (``time_from_start`` member of ``trajectory_msgs/JointTrajectoryPoint``) is relative to the trajectory start time.
133-
134-
The controller splices the current hold trajectory at time *traj start* and appends the three waypoints.
135-
Notice that between now and *traj start* the previous position hold is still maintained, as the new trajectory is not supposed to start yet.
136-
After the last waypoint is reached, its position is held until new commands arrive.
137-
138-
.. image:: new_trajectory.png
139-
:alt: Receiving a new trajectory.
140-
141-
|
142-
143-
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.
144-
145-
The next examples discuss the effect of sending the same trajectory to the controller with different start times.
146-
The scenario is that of a controller executing the trajectory from the previous example (shown in red),
147-
and receiving a new command (shown in green) with a trajectory start time set to either zero (start now),
148-
a future time, or a time in the past.
149-
150-
.. image:: trajectory_replacement_future.png
151-
:alt: Trajectory start time in the future.
152-
153-
|
154-
155-
.. image:: trajectory_replacement_now.png
156-
:alt: Zero trajectory start time (start now).
157-
158-
|
159-
160-
Of special interest is the last example, where the new trajectory start time and first waypoint are in the past (before now).
161-
In this case, the first waypoint is discarded and only the second one is realized.
162-
163-
.. image:: trajectory_replacement_past.png
164-
:alt: Trajectory start time in the past.
165-
166-
|
167-
168-
.. [#f1] Adolfo Rodriguez: `Understanding trajectory replacement <http://wiki.ros.org/joint_trajectory_controller/UnderstandingTrajectoryReplacement>`_
114+
The current implementation just forgets the old trajectory.
115+
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)