@@ -135,3 +135,211 @@ Advertised services
135135* ``~/set_speed_slider [ur_msgs/srv/SetSpeedSliderFraction] ``: Set the value of the speed slider.
136136* ``~/zero_ftsensor [std_srvs/srv/Trigger] ``: Zeroes the reported wrench of the force torque
137137 sensor.
138+ <<<<<<< HEAD
139+ =======
140+
141+ .. _passthrough_trajectory_controller :
142+
143+ ur_controllers/PassthroughTrajectoryController
144+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
145+
146+ This controller uses a ``control_msgs/FollowJointTrajectory `` action but instead of interpolating
147+ the trajectory on the ROS pc it forwards the complete trajectory to the robot controller for
148+ interpolation and execution. This way, the realtime requirements for the control PC can be
149+ massively decreased, since the robot always "knows" what to do next. That means that you should be
150+ able to run a stable driver connection also without a real-time patched kernel.
151+
152+ Interpolation depends on the robot controller's implementation, but in conjunction with the
153+ ur_robot_driver it defaults to mimicking ros2_control's spline interpolation. So, any trajectory
154+ planned e.g. with MoveIt! will be executed following the trajectory exactly.
155+
156+ A trajectory sent to the controller's action server will be forwarded to the robot controller and
157+ executed there. Once all setpoints are transferred to the robot, the controller goes into a waiting
158+ state where it waits for the trajectory to be finished. While waiting, the controller tracks the
159+ time spent on the trajectory to ensure the robot isn't stuck during execution.
160+
161+ This controller also supports **speed scaling ** such that and scaling down of the trajectory done
162+ by the robot, for example due to safety settings on the robot or simply because a slower execution
163+ is configured on the teach pendant. This will be considered, during execution monitoring, so the
164+ controller basically tracks the scaled time instead of the real time.
165+
166+ .. note ::
167+
168+ When using this controller with the URSim simulator execution times can be slightly larger than
169+ the expected time depending on the simulation host's resources. This effect will not be present
170+ when using a real UR arm.
171+
172+ .. note ::
173+
174+ This controller can currently only be used with URSim or a real UR robot. Neither mock hardware
175+ nor gazebo support this type of trajectory interfaces at the time being.
176+
177+ Tolerances
178+ """"""""""
179+
180+ Currently, the trajectory passthrough controller only supports goal tolerances and goal time
181+ tolerances passed in the action directly. Please make sure that the tolerances are completely
182+ filled with all joint names.
183+
184+ A **goal time tolerance ** of ``0.0 `` means that no goal time tolerance is set and the action will
185+ not fail when execution takes too long.
186+
187+ Action interface / usage
188+ """"""""""""""""""""""""
189+
190+ To use this controller, publish a goal to the ``~/follow_joint_trajectory `` action interface
191+ similar to the `joint_trajectory_controller <https://control.ros.org/master/doc/ros2_controllers/joint_trajectory_controller/doc/userdoc.html >`_.
192+
193+ Currently, the controller doesn't support replacing a running trajectory action. While a trajectory
194+ is being executed, goals will be rejected until the action has finished. If you want to replace it,
195+ first cancel the running action and then send a new one.
196+
197+ Parameters
198+ """"""""""
199+
200+ The trajectory passthrough controller uses the following parameters:
201+
202+ +----------------------------------+--------------+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
203+ | Parameter name | Type | Default value | Description |
204+ | | | | |
205+ +----------------------------------+--------------+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
206+ | ``joints `` (required) | string_array | <empty> | Joint names to listen to |
207+ +----------------------------------+--------------+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
208+ | ``state_interfaces `` (required) | string_array | <empty> | State interfaces provided by the hardware for all joints. Subset of ``["position", "velocity", "acceleration"] `` |
209+ +----------------------------------+--------------+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
210+ | ``speed_scaling_interface_name `` | string | ``speed_scaling/speed_scaling_factor `` | Fully qualified name of the speed scaling interface name. |
211+ +----------------------------------+--------------+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
212+ | ``tf_prefix `` | string | <empty> | Urdf prefix of the corresponding arm |
213+ +----------------------------------+--------------+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
214+
215+ Interfaces
216+ """"""""""
217+
218+ In order to use this, the hardware has to export a command interface for passthrough operations for each joint. It always has
219+ to export position, velocity and acceleration interfaces in order to be able to project the full
220+ JointTrajectory definition. This is why there are separate fields used, as for passthrough mode
221+ accelerations might be relevant also for robots that don't support commanding accelerations
222+ directly to their joints.
223+
224+ .. code :: xml
225+
226+ <gpio name =" ${tf_prefix}trajectory_passthrough" >
227+ <command_interface name =" setpoint_positions_0" />
228+ <command_interface name =" setpoint_positions_1" />
229+ <command_interface name =" setpoint_positions_2" />
230+ <command_interface name =" setpoint_positions_3" />
231+ <command_interface name =" setpoint_positions_4" />
232+ <command_interface name =" setpoint_positions_5" />
233+ <command_interface name =" setpoint_velocities_0" />
234+ <command_interface name =" setpoint_velocities_1" />
235+ <command_interface name =" setpoint_velocities_2" />
236+ <command_interface name =" setpoint_velocities_3" />
237+ <command_interface name =" setpoint_velocities_4" />
238+ <command_interface name =" setpoint_velocities_5" />
239+ <command_interface name =" setpoint_accelerations_0" />
240+ <command_interface name =" setpoint_accelerations_1" />
241+ <command_interface name =" setpoint_accelerations_2" />
242+ <command_interface name =" setpoint_accelerations_3" />
243+ <command_interface name =" setpoint_accelerations_4" />
244+ <command_interface name =" setpoint_accelerations_5" />
245+ <command_interface name =" transfer_state" />
246+ <command_interface name =" time_from_start" />
247+ <command_interface name =" abort" />
248+ </gpio >
249+
250+ .. note ::
251+
252+ The hardware component has to take care that the passthrough command interfaces cannot be
253+ activated in parallel to the streaming command interfaces.
254+
255+ Implementation details / dataflow
256+ """""""""""""""""""""""""""""""""
257+
258+ * A trajectory passed to the controller will be sent to the hardware component one by one.
259+ * The controller will send one setpoint and then wait for the hardware to acknowledge that it can
260+ take a new setpoint.
261+ * This happens until all setpoints have been transferred to the hardware. Then, the controller goes
262+ into a waiting state where it monitors execution time and waits for the hardware to finish
263+ execution.
264+ * If execution takes longer than anticipated, a warning will be printed.
265+ * If execution finished taking longer than expected (plus the goal time tolerance), the action will fail.
266+ * When the hardware reports that execution has been aborted (The ``passthrough_trajectory_abort ``
267+ command interface), the action will be aborted.
268+ * When the action is preempted, execution on the hardware is preempted.
269+
270+ .. _force_mode_controller :
271+
272+ ur_controllers/ForceModeController
273+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
274+
275+ This controller activates the robot's *Force Mode *. This allows direct force control running on the
276+ robot control box. This controller basically interfaces the URScript function ``force_mode(...) ``.
277+
278+ Force mode can be combined with (and only with) the :ref: `passthrough trajectory controller
279+ <passthrough_trajectory_controller>` in order to execute motions under a given force constraints.
280+
281+ .. note ::
282+ This is not an admittance controller, as given force constraints in a certain Cartesian
283+ dimension will overwrite the motion commands in that dimension. E.g. when specifying a certain
284+ force in the base frame's ``z `` direction, any motion resulting from the move command in the
285+ base frame's ``z `` axis will not be executed.
286+
287+ Parameters
288+ """"""""""
289+
290+ +----------------------------------+--------+---------------+---------------------------------------------------------------------+
291+ | Parameter name | Type | Default value | Description |
292+ | | | | |
293+ +----------------------------------+--------+---------------+---------------------------------------------------------------------+
294+ | ``tf_prefix `` | string | <empty> | Urdf prefix of the corresponding arm |
295+ +----------------------------------+--------+---------------+---------------------------------------------------------------------+
296+ | ``check_io_successful_retries `` | int | 10 | Amount of retries for checking if setting force_mode was successful |
297+ +----------------------------------+--------+---------------+---------------------------------------------------------------------+
298+
299+ Service interface / usage
300+ """""""""""""""""""""""""
301+
302+ The controller provides two services: One for activating force_mode and one for leaving it. To use
303+ those services, the controller has to be in ``active `` state.
304+
305+ * ``~/stop_force_mode [std_srvs/srv/Trigger] ``: Stop force mode
306+ * ``~/start_force_mode [ur_msgs/srv/SetForceMode] ``: Start force mode
307+
308+ In ``ur_msgs/srv/SetForceMode `` the fields have the following meanings:
309+
310+ task_frame
311+ All information (selection vector, wrench, limits, etc) will be considered to be relative
312+ to that pose. The pose's frame_id can be anything that is transformable to the robot's
313+ ``base `` frame.
314+ selection_vector_<x,y,z,rx,ry,rz>
315+ 1 means that the robot will be compliant in the corresponding axis of the task frame.
316+ wrench
317+ The forces/torques the robot will apply to its environment. The robot adjusts its position
318+ along/about compliant axis in order to achieve the specified force/torque. Values have no effect for non-
319+ compliant axes.
320+ Actual wrench applied may be lower than requested due to joint safety limits.
321+ type
322+ An integer [1;3] specifying how the robot interprets the force frame
323+
324+ 1
325+ The force frame is transformed in a way such that its y-axis is aligned with a vector pointing
326+ from the robot tcp towards the origin of the force frame.
327+ 2
328+ The force frame is not transformed.
329+ 3
330+ The force frame is transformed in a way such that its x-axis is the projection of the robot tcp
331+ velocity vector onto the x-y plane of the force frame.
332+ speed_limits
333+ Maximum allowed tcp speed (relative to the task frame). This is **only relevant for axes marked as
334+ compliant ** in the selection_vector.
335+ deviation_limits
336+ For **non-compliant axes **, these values are the maximum allowed deviation along/about an axis
337+ between the actual tcp position and the one set by the program.
338+ damping_factor
339+ Force mode damping factor. Sets the damping parameter in force mode. In range [0;1], default value is 0.025
340+ A value of 1 is full damping, so the robot will decelerate quickly if no force is present. A value of 0
341+ is no damping, here the robot will maintain the speed.
342+ gain_scaling
343+ Force mode gain scaling factor. Scales the gain in force mode. scaling parameter is in range [0;2], default is 0.5.
344+ A value larger than 1 can make force mode unstable, e.g. in case of collisions or pushing against hard surfaces.
345+ >>>>>>> e949995 (Add force mode controller (#1049))
0 commit comments