Skip to content

Commit

Permalink
[JTC] Add Parameter to Toggle State Setting on Activation (#1231)
Browse files Browse the repository at this point in the history
* [JTC] Add param to setting last command interface value as state on activation

* [JTC] add a note about set_last_command_interface_value_as_state_on_activation to release_notes. Updated the parameters.yaml description to match the same wording.

---------

Co-authored-by: Bence Magyar <[email protected]>
Co-authored-by: Christoph Fröhlich <[email protected]>
(cherry picked from commit f96d2fc)

# Conflicts:
#	joint_trajectory_controller/src/joint_trajectory_controller_parameters.yaml
  • Loading branch information
KentaKato authored and mergify[bot] committed Oct 26, 2024
1 parent da5c15d commit cd21a5d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ joint_trajectory_controller
* -1 - The tolerance is "erased". If there was a default, the joint will be
allowed to move without restriction.
* Add the boolean parameter ``set_last_command_interface_value_as_state_on_activation``. When set to ``true``, the last command interface value is used as both the current state and the last commanded state upon activation. When set to ``false``, the current state is used for both (`#1231 <https://github.com/ros-controls/ros2_controllers/pull/1231>`_).

pid_controller
************************
* 🚀 The PID controller was added 🎉 (`#434 <https://github.com/ros-controls/ros2_controllers/pull/434>`_).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,9 @@ controller_interface::CallbackReturn JointTrajectoryController::on_activate(
// running already)
trajectory_msgs::msg::JointTrajectoryPoint state;
resize_joint_trajectory_point(state, dof_);
if (read_state_from_command_interfaces(state))
if (
params_.set_last_command_interface_value_as_state_on_activation &&
read_state_from_command_interfaces(state))
{
state_current_ = state;
last_commanded_state_ = state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ joint_trajectory_controller:
default_value: false,
description: "Allow integration in goal trajectories to accept goals without position or velocity specified",
}
<<<<<<< HEAD
state_publish_rate: {
type: double,
default_value: 50.0,
description: "Rate controller state is published",
validation: {
gt_eq: [0.1]
}
=======
set_last_command_interface_value_as_state_on_activation: {
type: bool,
default_value: true,
description: "When set to true, the last command interface value is used as both the current state and the last commanded state upon activation. When set to false, the current state is used for both.",
>>>>>>> f96d2fc ([JTC] Add Parameter to Toggle State Setting on Activation (#1231))
}
action_monitor_rate: {
type: double,
Expand Down

0 comments on commit cd21a5d

Please sign in to comment.