Skip to content

Commit 94abd56

Browse files
Whalex451destogl
authored andcommitted
Added support for save integral term parameter
Added save_iterm parameter Added check for default false in tests Applied suggestions from code review More comment updates
1 parent 5703c37 commit 94abd56

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pid_controller/src/pid_controller.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ pid_controller:
7474
default_value: 0.0,
7575
description: "Lower integral clamp. Only used if antiwindup is activated."
7676
}
77+
save_iterm: {
78+
type: bool,
79+
default_value: false,
80+
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."
81+
}
7782
feedforward_gain: {
7883
type: double,
7984
default_value: 0.0,

pid_controller/test/test_pid_controller.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ TEST_F(PidControllerTest, all_parameters_set_configure_success)
5252
ASSERT_FALSE(controller_->params_.gains.dof_names_map[dof_name].antiwindup);
5353
ASSERT_EQ(controller_->params_.gains.dof_names_map[dof_name].i_clamp_max, 5.0);
5454
ASSERT_EQ(controller_->params_.gains.dof_names_map[dof_name].i_clamp_min, -5.0);
55+
ASSERT_FALSE(controller_->params_.gains.dof_names_map[dof_name].save_iterm);
5556
ASSERT_EQ(controller_->params_.gains.dof_names_map[dof_name].feedforward_gain, 0.0);
5657
}
5758
ASSERT_EQ(controller_->params_.command_interface, command_interface_);

0 commit comments

Comments
 (0)