Skip to content

Commit 0708ad9

Browse files
committed
Handle autocenter return value
1 parent b168d7b commit 0708ad9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

joy/src/joy.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,10 @@ void Joy::eventThread()
485485
status = future_.wait_for(std::chrono::seconds(0));
486486

487487
if (haptic_ != nullptr && autocenter_) {
488-
SDL_HapticSetAutocenter(haptic_, autocenter_);
488+
int result = SDL_HapticSetAutocenter(haptic_, autocenter_);
489+
if (result) {
490+
RCLCPP_WARN(get_logger(), "Failed to set autocenter: %s", SDL_GetError());
491+
}
489492
}
490493
} while (status == std::future_status::timeout);
491494
}

0 commit comments

Comments
 (0)