From e8f9fd588c6e6076c95f19eba9bb01916f2ad103 Mon Sep 17 00:00:00 2001 From: dmronga Date: Tue, 21 Nov 2023 23:20:09 +0100 Subject: [PATCH] Add error handling for update_rate --- src/whole_body_controller.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/whole_body_controller.cpp b/src/whole_body_controller.cpp index 1337f05..a148391 100644 --- a/src/whole_body_controller.cpp +++ b/src/whole_body_controller.cpp @@ -119,6 +119,10 @@ controller_interface::CallbackReturn WholeBodyController::on_configure(const rcl RCLCPP_INFO_THROTTLE(get_node()->get_logger(), *get_node()->get_clock(), 5000, "Waiting for parameter %s.", "/update_rate"); usleep(100000); } + if(update_rate <= 0){ + RCLCPP_FATAL(get_node()->get_logger(), "Update Rate parameter is %i. Did you forget to set it?", update_rate); + throw std::runtime_error("Invalid update_rate parameter"); + } RobotModelConfig robot_model_cfg; robot_model_cfg.file_or_string = urdf_string;