Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with SDL 2.0.10 for Ubuntu Focal #273

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions joy/src/game_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,14 @@ void GameController::handleControllerDeviceAdded(const SDL_ControllerDeviceEvent
joy_msg_.axes.at(i) = convertRawAxisValueToROS(state);
}

#if SDL_VERSION_ATLEAST(2, 0, 18)
const char * has_rumble_string = "No";
if (SDL_GameControllerHasRumble(game_controller_)) {
has_rumble_string = "Yes";
}
#else
const char * has_rumble_string = "Unknown";
#endif

RCLCPP_INFO(
get_logger(), "Opened game controller: %s, deadzone: %f, rumble: %s",
Expand Down