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

teleop_twist_joy does not work with SDL2 >= 2.32 (sdl2-compat), works with SDL2 <= 2.30 #37

Open
1 task done
jfrancis71 opened this issue Mar 6, 2025 · 9 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@jfrancis71
Copy link

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

teleop_twist_joy does not work on MacOSX:

ros2 launch teleop_twist_joy teleop-launch.py joy_config:='xbox'

It starts up fine. But when I move the joystick it prints:
[joy_node-1] [INFO] [1741248056.857958000] [joy_node]: Unknown event type 1544

and does not generate a twist message.

I believe the error message originates from:
https://github.com/ros-drivers/joystick_drivers/blob/ros2/joy/src/joy.cpp
Line: 451

        RCLCPP_INFO(get_logger(), "Unknown event type %d", e.type);
      }

I note this works fine on Linux.

If I do (on Linux):
mamba list | grep "sdl"
I get:
ros-jazzy-sdl2-vendor 3.3.0 np126py311h15c07e3_1 robostack-jaz
zy
sdl2 2.30.10 h63c27ac_0 conda-forge

But when I do the same on my Mac I get:
ros-jazzy-sdl2-vendor 3.3.0 np126py311hd6
9bdec_4 robostack-jazzy
sdl2 2.32.50 hc0cb955_1
conda-forge
sdl3 3.2.8 h6dd79e8_0
conda-forge

I am suspicious that there may be some mixing of sdl versions. There are no sdl
's in my base environment, and it seems it is the jazzy desktop mamba install w
hich is installing all 3 sdl's on my Mac. (As confirmed by fresh install in new
environment).

Any help much appreciated.

Thanks,
Julian.

Installed packages

github won't allow me to submit report with packages listed here.

Environment info

libmamba version : 2.0.5
          mamba version : 2.0.5
           curl version : libcurl/8.12.1 OpenSSL/3.4.1 (SecureTransport) zlib/1.3.1 zstd/1.5.7 libssh2/1.11.1 nghttp2/1.64.0
     libarchive version : libarchive 3.7.7 zlib/1.2.13 liblzma/5.4.6 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.2
       envs directories : /Users/julian/miniconda3/envs
          package cache : /Users/julian/miniconda3/pkgs
                          /Users/julian/.mamba/pkgs
            environment : ros_a1 (active)
           env location : /Users/julian/miniconda3/envs/ros_a1
      user config files : /Users/julian/.mambarc
 populated config files : /Users/julian/miniconda3/envs/ros_a1/.condarc
                          /Users/julian/.condarc
       virtual packages : __unix=0=0
                          __osx=12.7.6=0
                          __archspec=1=x86_64_v3
               channels : https://conda.anaconda.org/robostack-jazzy/noarch
                          https://conda.anaconda.org/robostack-jazzy/osx-64
                          https://conda.anaconda.org/robostack-staging/noarch
                          https://conda.anaconda.org/robostack-staging/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/conda-forge/osx-64
       base environment : /Users/julian/miniconda3
               platform : osx-64
@jfrancis71 jfrancis71 added the bug Something isn't working label Mar 6, 2025
@jfrancis71
Copy link
Author

Just to clarify in my report above, the formatting of my mamba list | grep "sdl" output was not correct (c/r in wrong place).

On my MacOS system (which fails):
ros-jazzy-sdl2-vendor 3.3.0 np126py311hd69bdec_4 robostack-jazzy
sdl2 2.32.50 hc0cb955_1 conda-forge
sdl3 3.2.8 h6dd79e8_0 conda-forge

whereas Linux (which works):
ros-jazzy-sdl2-vendor 3.3.0 np126py311h15c07e3_1 robostack-jazzy
sdl2 2.30.10 h63c27ac_0 conda-forge

@traversaro
Copy link
Member

Can you try to install sdl2 2.30.0 also on macOS to understand if that fixes the issue?

@jfrancis71
Copy link
Author

I was not able to find an sdl2 version 2.30.0. My suspicion that there may be mixing of sdl2 and sdl3 is not correct.

I have done a fresh mamba environment install.

I run the teleop joy command and this fails as detailed in opening comment.

I follow your suggestion (modified):
mamba install sdl2=2.30.10 # this matches the Linux version

I rerun teleop joy. The error message has gone. I am now successfully publishing Twist messages.

So this solves the problem. Let me know if I need to close the issue. I have not done so as I assume there may be a change required to the conda package to solve this for other Mac users.

Thank you for your help,
Julian.

@traversaro
Copy link
Member

I was not able to find an sdl2 version 2.30.0.

My bad, I wanted to suggest 2.30.10 (i.e. the version used in Linux) there was a typo.\

I rerun teleop joy. The error message has gone. I am now successfully publishing Twist messages.

Great, let's update the title for visibility.

My suspicion that there may be mixing of sdl2 and sdl3 is not correct.

sdl2 >= 2.32 actually installs a sdl2-compat, that is a version of sdl2 built on top of sdl3, see conda-forge/sdl-feedstock#21, so installing both sdl2 and sdl3 in theory is correct, but apparently you found a regression in sdl2-compat with respect to sdl2, so thanks a lot for opening the issue!

So this solves the problem. Let me know if I need to close the issue. I have not done so as I assume there may be a change required to the conda package to solve this for other Mac users.

As the default installation istructions are broken, the issue is still present, installing an older sdl2 is just a workaround. To help us to reproduce the problem, if you are able can you provide us more info:

  • Which joystick are you using? Can you provide us the exact model?
  • Is teleop_twist_joy with sdl2==2.32.50 on Linux working fine instead? Can you kindly check?

Thanks a lot in advance for opening the issue.

@jfrancis71
Copy link
Author

Would you like me to respond to your comments here, or in your link above?

@traversaro
Copy link
Member

Would you like me to respond to your comments here, or in your link above?

As you prefer. Probably as the discussion started here it make sense to continue here, that issue is just for visibility for people checking the sdl repo on conda-forge.

@jfrancis71
Copy link
Author

I am using XEOX Gamepad SL-6556-BK
This is a very old joystick (but still works...)

I have executed on my Ubuntu 22.04.5 LTS
mamba install sdl2==2.32.50

So now my teleop joy is no longer working on my Linux box (as expected).
It fails in exactly the way described before.

I have just restored 2.30.10, and it is back working again.

@traversaro
Copy link
Member

Perfect, thanks! Let me edit the title of the issue for clarity.

@traversaro traversaro changed the title teleop_twist_joy does not work on MacOSX teleop_twist_joy does not work with SDL2 >= 2.32 (sdl2-compat), works with SDL2 <= 2.30 Mar 7, 2025
@traversaro
Copy link
Member

TL;DR: for anyone reading this issue: a working workaround is to add a constraint for sdl2 <= 2.30.* to get it working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants