ROS 2 joy_linux: better dev_name handling#301
Open
rayferric wants to merge 3 commits intoros-drivers:ros2from
Open
ROS 2 joy_linux: better dev_name handling#301rayferric wants to merge 3 commits intoros-drivers:ros2from
rayferric wants to merge 3 commits intoros-drivers:ros2from
Conversation
treat dev_name as a substring
Contributor
|
Changing the default behavior is an unwanted change in general, unless the behavior is really wrong. In this case, I think dev_name should block using dev only in case dev is explicitly set to empty string. That way, the original behavior would be kept while still allowing the behavior you want. Also, please remove the unrelated change with publishing all zeros. This is a topic we should treat separately because it has some gotchas (i.e. triggers usually do have value 1 in the neutral pose (not sure if this is also true with SDL, but with linux joystick this is true)). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses various problems with the
dev_nameparameter, which does not work as flexibly and reliably as we would like.Originally, if
dev_namewas specified, the node looked for a device with this identifier during initialization. If it could not be found, the node fell back to the device specified injoy_dev.With my changes:
dev_namewill be matched against device identifiers as a substring, which is more flexible.dev_nameis not found during initialization, the node won't connect to the default device, but rather will keep waiting for the name to match, retrying every second.joy_devparameter practically won't have any effect ifjoy_nameis specified. The node will keep searching for the name.This makes it possible to specify a gamepad model that you expect to be connected to the PC. The node will then only connect to this type of gamepad and keep reconnecting if the connection is dropped. It is resilient to faulty USB connectors, since during reconnection we have no guarantee that the same
/dev/input/jsNwill be allocated.Unrelated change: publish zeros to
/joyin the moment the device is disconnected.