与 Simulink 模型交互的 XBOX 控制器 [英] Interaction XBOX Controller with Simulink Model

查看:114
本文介绍了与 Simulink 模型交互的 XBOX 控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个项目中工作,我必须使用 XBOX 控制器控制机器人(我已经将它作为 Simulink 模型).

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.

我想通过 XBOX 控制器的按钮更改一些变量 (INPUT),然后获得反馈(例如:振动反馈)(OUTPUT).

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

可以用 ROS 和 Simulink 做到这一点吗?这样我就可以使用 ros_joy,然后在我的 Simulink 模型中实现它?

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.

非常感谢.

推荐答案

我无法测试这个,但我从 ubuntu <= 16 知道 jstestjstest-gtk(更好的gui界面)可以通过apt安装,检查&配置任何操纵杆/游戏手柄,它运行良好.然后你将把你的游戏手柄作为 /dev/ 下的设备.(例如:/dev/js0/dev/input/js0).并且该文件句柄易于使用,具有许多支持的第 3 方/一次性库(如果您不想/不需要,则不必使用所有 ros).

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).

而且我从 matlab 知道有一些方法可以破解解决方案,但他们自己的第一方解决方案是 vrjoystick,它接受一个基于 1 的数字 ID.这应该意味着你的游戏手柄显示为 js0,然后 id 应该是 1:id = 1;joy = vrjoystick(id,'forcefeedback');.

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');.

这篇关于与 Simulink 模型交互的 XBOX 控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆