0

I'm working in a project where i have to control a Robot (I have it already as a Simulink Model) with an XBOX Controller.

Until now I couldn't find a good Example or a good Idea to let these two interact.

I want to change some variables (INPUTs) with the buttons of the XBOX Controller and then get a feedback (Example: a vibration feedback) (OUTPUT).

Is it possible to do that with ROS and Simulink ? So that i can work with ros_joy, and then implement it in my Simulink model ?

It'll be very helpful when i get some advises here.

Thanks a lot.

Slachcrash
  • 27
  • 1
  • 6

1 Answers1

0

I can't test this, but I know from ubuntu <= 16 that jstest and jstest-gtk (the nicer gui interface) can be installed via apt, to check & configure any joysticks/gamepads, and it works well. Then you will have your gamepad as a device under /dev/. (Ex: /dev/js0, /dev/input/js0). And that file handle is easy to use, with many supporting 3rd party/one-off libraries (you don't have to use all of ros if you don't want/need to).

And I know from matlab that there are ways to hack up a solution, but their own 1st party solution is vrjoystick, which takes in a 1-based numeric id. This should mean your gamepad shows up as js0, and the id should then be 1: id = 1; joy = vrjoystick(id,'forcefeedback');.

JWCS
  • 1,120
  • 1
  • 7
  • 17
  • Thanks a lot. That's very helpful. I'll try to test it out. I have only one question: what did you mean with " And that file handle is easy to use, with many supporting 3rd party/one-off libraries (you don't have to use all of ros if you don't want/need to)." ? When your method works, I won't need ROS anymore or am i wrong ? (I was mentioning ROS because I thought there's no solution without it but with yours it could work) – Slachcrash Jun 15 '20 at 23:30
  • ROS is arguably 3 things: a messaging/frame-transforming/+build system; an ecosystem of packages/executables that conform to that messaging system; & dev practices. If you aren't tying together a bunch of robotics-related software, it's not useful. It only _wraps_ the underlying programs. `rosjoy` [calls low-level C functions on that filehandle, and bundles it in ROS msgs](https://github.com/ros-drivers/joystick_drivers/blob/dc9e8676a76157138d2f9769a814920e16c2ac57/joy/src/joy_node.cpp#L288). You could google/github search for generic joystick/gamepad libraries, there's many. – JWCS Jun 16 '20 at 00:06