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

Translate axis to act as button #79

Open
mnh-jansson opened this issue Aug 19, 2022 · 1 comment
Open

Translate axis to act as button #79

mnh-jansson opened this issue Aug 19, 2022 · 1 comment

Comments

@mnh-jansson
Copy link

Joy node maps buttons and axes differently for example xbox controller on different OSs. Is there any way to make an axis act as a button with some kind of threshold? Or would this be outside the scope of this node?

@thomaspeyrucain
Copy link

Hello all,
I am trying to use the left Dpad of the Logitech Wireless Gamepad F710 (DirectInput Mode) as buttons to control a head
For now, this check in the code is only checking if you press the axis only in one direction:
self.active &= joy_state.axes[axis] == 1.0
If you want to assign the left Dpad axis 5 for example: 1 action for the up button (+1.0) and 1 other action for the down button (-1.0), it would look something like that:

    head_down:
      type: action
      interface_type: teleop_tools_msgs/action/Increment
      action_name: /head_controller/increment
      action_goal:
        increment_by: [0.0, -0.1]
      axes: [-5]

    head_up:
      type: action
      interface_type: teleop_tools_msgs/action/Increment
      action_name: /head_controller/increment
      action_goal:
        increment_by: [0.0, 0.1]
      axes: [5]

Another option would be to change the Dpad as 4 different buttons

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

No branches or pull requests

2 participants