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

Launch file setting a deprecated param? #38

Closed
artivis opened this issue Sep 7, 2023 · 2 comments
Closed

Launch file setting a deprecated param? #38

artivis opened this issue Sep 7, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@artivis
Copy link

artivis commented Sep 7, 2023

Hello,

Looking at the launch file it seems to be setting a dev parameter for the joy_node that doesn't exists. Instead, the joy_node uses device_id, since, afaict, its port to ROS 2.
Am I missing something or has this been broken forever in ROS 2?

@clalancette
Copy link

Am I missing something or has this been broken forever in ROS 2?

It hasn't been broken forever, but it has been broken quite a while. The history of the node to control joysticks in ROS 2 is a little twisted. The story below probably isn't all that relevant, but it is fun to walk down memory lane a little.

The original code of any kind of joystick control to ROS 2 was in 2016 as part of the turtlebot2_demo repository. That code was written from scratch to look at the /dev/input/js0 input device from Linux. This is equivalent in spirit to how the joystick driver in ROS 1 works, but is a very different and simplified implementation. It doesn't have any parameters at all; everything is hard-coded.

That code eventually got split out into its own repository in joystick_drivers_from_scratch. This also didn't have any parameters at all, everything is hard-coded.

Somewhat in parallel with joystick_drivers_from_scratch, joystick_drivers was forked off of the original https://github.com/ros/joystick_drivers, and a full port to ROS 2 was done. That version did have parameters, and the parameter in question was indeed called dev. It was around this time that the launch file here in teleop_twist_joy was created. At that time, the parameter was correct.

In 2020, I decided that we needed a cross-platform joystick driver, particularly one that would work in Windows. So I wrote an entirely new version based on SDL, which is the node we call "joy" today. That one was contributed to the upstream https://github.com/ros/joystick_drivers, and the old https://github.com/ros2/joystick_drivers and https://github.com/ros2/joystick_drivers_from_scratch were both deprecated. One other thing to note here is that I wasn't entirely confident that my SDL port would be sufficient, so retained the old, Linux-only joystick driver as "joy_linux". The new "joy" node uses the device_id parameter, while the old "joy_linux" node uses the dev parameter.

All of that said, you are correct that nowadays that parameter should indeed be changed to device_id. If you'd like to submit a pull request, I'd be happy to review it.

@clalancette clalancette added bug Something isn't working help wanted Extra attention is needed labels Sep 14, 2023
@clalancette
Copy link

This was fixed by #52 , so closing.

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

No branches or pull requests

2 participants