Skip to content

Commit 5120bb3

Browse files
committed
Small fixes of pid_controller for compilation.
1 parent c28a4c9 commit 5120bb3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

pid_controller/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS
1616
control_msgs
1717
controller_interface
1818
hardware_interface
19+
parameter_traits
1920
pluginlib
2021
rclcpp
2122
rclcpp_lifecycle
@@ -117,7 +118,7 @@ ament_export_include_directories(
117118
include
118119
)
119120
ament_export_dependencies(
120-
121+
${THIS_PACKAGE_INCLUDE_DEPENDS}
121122
)
122123
ament_export_libraries(
123124
pid_controller

pid_controller/package.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,15 @@
1212
<build_depend>generate_parameter_library</build_depend>
1313

1414
<depend>control_msgs</depend>
15-
1615
<depend>controller_interface</depend>
17-
1816
<depend>hardware_interface</depend>
19-
17+
<depend>parameter_traits</depend>
2018
<depend>pluginlib</depend>
21-
2219
<depend>rclcpp</depend>
23-
2420
<depend>rclcpp_lifecycle</depend>
25-
2621
<depend>realtime_tools</depend>
27-
2822
<depend>std_srvs</depend>
2923

30-
<test_depend>ament_lint_auto</test_depend>
3124
<test_depend>ament_cmake_gmock</test_depend>
3225
<test_depend>controller_manager</test_depend>
3326
<test_depend>hardware_interface</test_depend>

pid_controller/src/pid_controller.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,18 @@ controller_interface::CallbackReturn PidController::configure_parameters()
136136
std::make_shared<control_toolbox::PidROS>(get_node(), "gains." + params_.dof_names[i]);
137137
pids_[i]->initPid();
138138
}
139+
140+
return CallbackReturn::SUCCESS;
139141
}
140142

141143
controller_interface::CallbackReturn PidController::on_configure(
142144
const rclcpp_lifecycle::State & /*previous_state*/)
143145
{
144-
configure_parameters();
146+
auto ret = configure_parameters();
147+
if (ret != CallbackReturn::SUCCESS)
148+
{
149+
return ret;
150+
}
145151

146152
// topics QoS
147153
auto subscribers_qos = rclcpp::SystemDefaultsQoS();

0 commit comments

Comments
 (0)