Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[JTC] Remove deprecated open_loop_control code #1598

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions joint_trajectory_controller/src/joint_trajectory_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ controller_interface::return_type JointTrajectoryController::update(
if (!current_trajectory_->is_sampled_already())
{
first_sample = true;
if (params_.interpolate_from_desired_state || params_.open_loop_control)
if (params_.interpolate_from_desired_state)
{
if (std::abs(last_commanded_time_.seconds()) < std::numeric_limits<float>::epsilon())
{
Expand Down Expand Up @@ -693,16 +693,6 @@ controller_interface::CallbackReturn JointTrajectoryController::on_configure(
{
auto logger = get_node()->get_logger();

// START DEPRECATE
if (params_.open_loop_control)
{
RCLCPP_WARN(
logger,
"[deprecated] 'open_loop_control' parameter is deprecated. Instead, set the feedback gains "
"to zero and use 'interpolate_from_desired_state' parameter");
}
// END DEPRECATE

// update the dynamic map parameters
param_listener_->refresh_dynamic_parameters();

Expand Down Expand Up @@ -783,8 +773,7 @@ controller_interface::CallbackReturn JointTrajectoryController::on_configure(
// if there is only velocity or if there is effort command interface
// then use also PID adapter
use_closed_loop_pid_adapter_ =
(has_velocity_command_interface_ && params_.command_interfaces.size() == 1 &&
!params_.open_loop_control) ||
(has_velocity_command_interface_ && params_.command_interfaces.size() == 1) ||
(has_effort_command_interface_ && params_.command_interfaces.size() == 1);

tmp_command_.resize(dof_, 0.0);
Expand Down Expand Up @@ -1018,8 +1007,9 @@ controller_interface::CallbackReturn JointTrajectoryController::on_activate(
resize_joint_trajectory_point(state, dof_);
// read from cmd joints only if all joints have command interface
// otherwise it leaves the entries of joints without command interface NaN.
// if no open_loop control, state_current_ is then used for `set_point_before_trajectory_msg` and
// future trajectory sampling will always give NaN for these joints
// if no interpolate_from_desired_state, state_current_ is then used for
// `set_point_before_trajectory_msg` and future trajectory sampling will always give NaN for these
// joints
if (
params_.set_last_command_interface_value_as_state_on_activation && dof_ == num_cmd_joints_ &&
read_state_from_command_interfaces(state))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ joint_trajectory_controller:
default_value: false,
description: "Allow joint goals defining trajectory for only some joints.",
}
open_loop_control: {
type: bool,
default_value: false,
description: "deprecated: use ``interpolate_from_desired_state`` and set feedback gains to zero instead",
read_only: true,
}
interpolate_from_desired_state: {
type: bool,
default_value: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ class TestableJointTrajectoryController

bool use_closed_loop_pid_adapter() const { return use_closed_loop_pid_adapter_; }

// START DEPRECATE
bool is_open_loop() const { return params_.open_loop_control; }
// END DEPRECATE

joint_trajectory_controller::SegmentTolerances get_active_tolerances()
{
return *(active_tolerances_.readFromRT());
Expand Down