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
Copy file name to clipboardExpand all lines: joint_trajectory_controller/doc/trajectory.rst
+2-55Lines changed: 2 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,60 +111,7 @@ To visualize the difference of the different interpolation methods and their inp
111
111
112
112
Trajectory Replacement
113
113
---------------------------------
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
-
116
114
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".
117
115
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.
0 commit comments