前言
提示:new-lg4ff-master支持大多数罗技的硬件,不支持G920与G923 XBOX/PC版本:
支持以下罗技Logitech 型号 |
---|
Logitech WingMan Formula GP (without force feedback) |
Logitech WingMan Formula Force GP |
Logitech Driving Force |
Logitech MOMO Force Feedback Racing Wheel |
Logitech Driving Force Pro |
Logitech G25 Racing Wheel |
Logitech Driving Force GT (tested) |
Logitech G27 Racing Wheel (tested) |
Logitech G29 Driving Force (tested) |
Logitech G923 Racing Wheel for PlayStation 4 and PC |
Logitech MOMO Racing |
Logitech Speed Force Wireless Wheel for Wii |
提示:以下是本篇文章正文内容,下面案例可供参考
一、 安装new-lg4ff-master 驱动
1、 点击进入GitHub,下载new-lg4ff-master
2、 将下载的new-lg4ff-master.zip文件解压到Linux系统的/usr/src/new-lg4ff-master
路径
3、 使用DKMS安装new-lg4ff-master:$ sudo dkms install /usr/src/new-lg4ff-master
4、 检查new-lg4ff-master驱动是否安装:$ sudo dmesg |grep logi
下图,0003:046D:xxxx.xxxx
就是硬件设备号
二 、 Logitech G923硬件参数配置
1、 我们可以进入/sys/bus/hid/drivers/logitech/0003:046D:xxxx.xxxx/
文件夹下可以看到如下文件,使用文本打开即可修改参数。
参数及含义:
参数名称 | 含义 |
---|---|
combine_pedals | This entry already existed. It has been extended, setting the value to 2 combines the clutch and gas pedals in the same axis. |
gain | Get/set the global FF gain (0-65535). This property is independent of the gain set by applications using the Linux FF API. |
autocenter | Get/set the autocenter strength (0-65535). This property can be overwritten by applications using the Linux FF API. |
spring_level | Set the level (0-100) for the spring type effects. |
damper_level | Set the level (0-100) for the damper type effects. |
friction_level | Set the level (0-100) for the friction type effects. |
peak_ffb_level | It returns the maximum detected FF level value as an integer. It can be written to reset the value and start reading again. Values read will be always greater or equal than the last value written. Values between 0-32768 mean no clipping, greater values mean there can be clipping. |
ffb_leds:
Use the wheel leds (when present) to monitor FF levels.
Led combinations:
• All leds off: force < 7.5% (normally the force is lower than the wheel mechanical friction so it will be too weak to be noticed).
• 1 led on from outside: 7.5%-25% force.
• 2 leds on from outside: 25%-50% force.
• 3 leds on from outside: 50%-75% force.
• 4 leds on from outside: 75%-90% force.
• 5 leds on from outside: 90%-100% force.
• 1 led off from outside: 100%-110% force (some clipping but most probably unnoticeable).
• 2 leds off from outside: 110%-125% force (probably noticeable light clipping).
• 3 leds off from outside: 120%-150% force (clipping must be pretty noticeable).
• 4 leds off from outside: force > 150% (clipping hard).
三、 jstest-gtk 可视化调试工具
1、打开终端输入:$ sudo apt-get install jstest-gtk
安装jstest-gtk
2、打开终端输入$ cd /dev/input/
,$ ls
,并通过拔插驱动线知道logitech G923的设备名称为:js0
3、打开终端输入$ sudo jstest /dev/input/js0
查看Logi G923每个按键对应的索引号,因为我们将在VTD上关联索引号来获取到Logi G923的数据,按键、踏板、方向盘。我们可以通过触碰按键、踩下踏板、转动方向盘来知道对应的索引号。
4、打开终端输入$ sudo jstest -gtk
打开调试的可视化工具,可以对方向盘等进行调试,阈值参数修改等。
四、VTD调用Logitech G923
1、按下图配置相关参数,主要是Mockup和Joystick,配置完成后(记得在MM打开动力学模型),随后运行即可开始使用方向盘控制。
注意:
1、player填写需要控制车辆的名称
2、index要按照第大三中的索引号配置,必须一一对应起来。
3、device按照真实的路径配置,上面有讲到
五、Veristand调用Logitech G923 拓展
注:实时机无法调用Labview中的操纵杆采集模块,因此只能在本地模式下运行且为Window环境。
主要实现程序:
下面做了方向盘角度转换、油门踏板、刹车踏板、离合开度转换
综上完成VTD对Logitech G923调用
转载:https://blog.csdn.net/zataji/article/details/127812987