Skip to content

Commit

Permalink
Added support for save integral term parameter
Browse files Browse the repository at this point in the history
Added save_iterm parameter
Added check for default false in tests

Applied suggestions from code review

More comment updates
  • Loading branch information
Whalex451 authored and destogl committed Jan 30, 2024
1 parent 85f0459 commit a887b8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pid_controller/src/pid_controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ pid_controller:
default_value: 0.0,
description: "Lower integral clamp. Only used if antiwindup is activated."
}
save_iterm: {
type: bool,
default_value: false,
description: "Enables save of integral term on pid reset. Integrator error will not be set to 0. This is useful for pid loops that are enabled/disabled with constant steady-state external disturbance."
}
feedforward_gain: {
type: double,
default_value: 0.0,
Expand Down
1 change: 1 addition & 0 deletions pid_controller/test/test_pid_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ TEST_F(PidControllerTest, all_parameters_set_configure_success)
ASSERT_FALSE(controller_->params_.gains.dof_names_map[dof_name].antiwindup);
ASSERT_EQ(controller_->params_.gains.dof_names_map[dof_name].i_clamp_max, 5.0);
ASSERT_EQ(controller_->params_.gains.dof_names_map[dof_name].i_clamp_min, -5.0);
ASSERT_FALSE(controller_->params_.gains.dof_names_map[dof_name].save_iterm);
ASSERT_EQ(controller_->params_.gains.dof_names_map[dof_name].feedforward_gain, 0.0);
}
ASSERT_EQ(controller_->params_.command_interface, command_interface_);
Expand Down

0 comments on commit a887b8c

Please sign in to comment.