Skip to content

Commit 2889038

Browse files
christophfroehlichdestoglbmagyar
authored
[JTC] Disable use of closed-loop PID adapter if controller is used in open-loop mode. (ros-controls#551) (ros-controls#740)
(cherry picked from commit 8029a2f) Co-authored-by: Dr. Denis <[email protected]> Co-authored-by: Bence Magyar <[email protected]>
1 parent 6a4e7a6 commit 2889038

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

joint_trajectory_controller/doc/userdoc.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,18 @@ allow_partial_joints_goal (boolean)
155155
Allow joint goals defining trajectory for only some joints.
156156

157157
open_loop_control (boolean)
158-
Use controller in open-loop control mode using ignoring the states provided by hardware interface and using last commands as states in the next control step. This is useful if hardware states are not following commands, i.e., an offset between those (typical for hydraulic manipulators).
158+
Use controller in open-loop control mode:
159+
+ The controller ignores the states provided by hardware interface but using last commands as states for starting the trajectory interpolation.
160+
+ It deactivates the feedback control, see the ``gains`` structure.
159161

160-
If this flag is set, the controller tries to read the values from the command interfaces on starting. If they have real numeric values, those will be used instead of state interfaces. Therefore it is important set command interfaces to NaN (std::numeric_limits<double>::quiet_NaN()) or state values when the hardware is started.
162+
This is useful if hardware states are not following commands, i.e., an offset between those (typical for hydraulic manipulators).
163+
164+
.. Note::
165+
If this flag is set, the controller tries to read the values from the command interfaces on activation.
166+
If they have real numeric values, those will be used instead of state interfaces.
167+
Therefore it is important set command interfaces to NaN (i.e., ``std::numeric_limits<double>::quiet_NaN()``) or state values when the hardware is started.
168+
169+
Default: false
161170

162171
allow_nonzero_velocity_at_trajectory_end (boolean)
163172
If false, the last velocity point has to be zero or the goal will be rejected.
@@ -188,7 +197,10 @@ constraints.<joint_name>.goal (double)
188197
Default: 0.0 (tolerance is not enforced)
189198

190199
gains (structure)
191-
If ``velocity`` is the only command interface for all joints or an ``effort`` command interface is configured, PID controllers are used for every joint. This structure contains the controller gains for every joint with the control law
200+
Only relevant, if ``open_loop_control`` is not set.
201+
202+
If ``velocity`` is the only command interface for all joints or an ``effort`` command interface is configured, PID controllers are used for every joint.
203+
This structure contains the controller gains for every joint with the control law
192204

193205
.. math::
194206

joint_trajectory_controller/src/joint_trajectory_controller.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,8 @@ controller_interface::CallbackReturn JointTrajectoryController::on_configure(
687687
// if there is only velocity or if there is effort command interface
688688
// then use also PID adapter
689689
use_closed_loop_pid_adapter_ =
690-
(has_velocity_command_interface_ && params_.command_interfaces.size() == 1) ||
690+
(has_velocity_command_interface_ && params_.command_interfaces.size() == 1 &&
691+
!params_.open_loop_control) ||
691692
has_effort_command_interface_;
692693

693694
if (use_closed_loop_pid_adapter_)

0 commit comments

Comments
 (0)