Skip to content

Add autocenter#308

Open
chrisbitter wants to merge 8 commits intoros-drivers:ros2from
enabl-tech:add_autocenter
Open

Add autocenter#308
chrisbitter wants to merge 8 commits intoros-drivers:ros2from
enabl-tech:add_autocenter

Conversation

@chrisbitter
Copy link

@chrisbitter chrisbitter commented Dec 12, 2025

Adding a parameter to use autocentering.

Tested on a Logitech G920.

@Nils-ChristianIseke
Copy link

Hi @clalancette and @JWhitleyWork,

If you think this makes sense for the project, we’d love to see it merged when you have time.
These changes cover what we need on our side and would help us stay aligned with upstream rather than maintaining a fork.

We’d really appreciate a PR review whenever it fits your schedule — happy to address any feedback or make adjustments.

Thanks a lot for your work and for maintaining this project!

joy/src/joy.cpp Outdated
status = future_.wait_for(std::chrono::seconds(0));

if (haptic_ != nullptr && autocenter_) {
SDL_HapticSetAutocenter(haptic_, autocenter_);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, handle the return value: https://wiki.libsdl.org/SDL2/SDL_HapticSetAutocenter#return-value . Ideally, log a warning.

@peci1
Copy link

peci1 commented Feb 15, 2026

Thanks for the PR.

I'm not yet 100% sure about the ABI breakage policy of this package, but normally, adding a class member to a public header means breaking ABI, which would mean this change could only be merged to Rolling. If you needed it to work in older ROS distros, some of the hacks for keeping ABI stable would have to be applied. Do you need this change in some of the stable distros?

@peci1 peci1 self-assigned this Feb 15, 2026
chrisbitter and others added 4 commits February 24, 2026 10:12
Co-authored-by: Martin Pecka <peci1@seznam.cz>
Co-authored-by: Martin Pecka <peci1@seznam.cz>
@chrisbitter
Copy link
Author

Thanks for the review @peci1 :) I fixed the code accordingly. Also tested again on our Logitech G920.

We are running on Jazzy. Also happy to help implementing the "hacks" if necessary.
Whats your proposed way forward? Shall we merge this PR and address the backward compatibility as a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants