Skip to content

Commit 7cbce50

Browse files
committed
debugging
1 parent 0ce7774 commit 7cbce50

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

whole_body_controllers/src/ik_controller.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ auto to_eigen(const std::vector<double> & vec) -> Eigen::Affine3d
4848
return Eigen::Affine3d(translation * rotation);
4949
}
5050

51-
auto has_nan(const std::vector<double> & vec) -> bool
52-
{
53-
return std::ranges::any_of(vec, [](double x) { return std::isnan(x); });
54-
}
55-
5651
} // namespace
5752

5853
auto IKController::on_init() -> controller_interface::CallbackReturn
@@ -360,7 +355,7 @@ auto IKController::update_system_state_values() -> controller_interface::return_
360355
}
361356
}
362357

363-
if (has_nan(position_state_values_) || has_nan(velocity_state_values_)) {
358+
if (common::math::has_nan(position_state_values_) || common::math::has_nan(velocity_state_values_)) {
364359
RCLCPP_DEBUG(logger_, "Received system states with NaN value."); // NOLINT
365360
return controller_interface::return_type::ERROR;
366361
}
@@ -371,11 +366,11 @@ auto IKController::update_system_state_values() -> controller_interface::return_
371366
auto IKController::update_and_validate_interfaces() -> controller_interface::return_type
372367
{
373368
if (update_system_state_values() != controller_interface::return_type::OK) {
374-
RCLCPP_DEBUG(logger_, "Failed to update system state values"); // NOLINT
369+
RCLCPP_INFO(logger_, "Failed to update system state values"); // NOLINT
375370
return controller_interface::return_type::ERROR;
376371
}
377-
if (has_nan(reference_interfaces_)) {
378-
RCLCPP_DEBUG(logger_, "Received reference with NaN value."); // NOLINT
372+
if (common::math::has_nan(reference_interfaces_)) {
373+
RCLCPP_INFO(logger_, "Received reference with NaN value."); // NOLINT
379374
return controller_interface::return_type::ERROR;
380375
}
381376
return controller_interface::return_type::OK;
@@ -386,7 +381,7 @@ auto IKController::update_and_write_commands(const rclcpp::Time & /*time*/, cons
386381
-> controller_interface::return_type
387382
{
388383
if (update_and_validate_interfaces() != controller_interface::return_type::OK) {
389-
RCLCPP_DEBUG(logger_, "Skipping controller update. Failed to update and validate interfaces"); // NOLINT
384+
RCLCPP_INFO(logger_, "Skipping controller update. Failed to update and validate interfaces"); // NOLINT
390385
return controller_interface::return_type::OK;
391386
}
392387

0 commit comments

Comments
 (0)