自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)

文章目录

前言

提示:new-lg4ff-master支持大多数罗技的硬件,不支持G920与G923 XBOX/PC版本:

支持以下罗技Logitech 型号Logitech WingMan Formula GP (without force feedback)Logitech WingMan Formula Force GPLogitech Driving ForceLogitech MOMO Force Feedback Racing WheelLogitech Driving Force ProLogitech G25 Racing WheelLogitech Driving Force GT (tested)Logitech G27 Racing Wheel (tested)Logitech G29 Driving Force (tested)Logitech G923 Racing Wheel for PlayStation 4 and PCLogitech MOMO RacingLogitech 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 就是硬件设备号

自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)

; 二 、 Logitech G923硬件参数配置

1、 我们可以进入 /sys/bus/hid/drivers/logitech/0003:046D:xxxx.xxxx/文件夹下可以看到如下文件,使用文本打开即可修改参数。

自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)
参数及含义:

参数名称含义combine_pedalsThis entry already existed. It has been extended, setting the value to 2 combines the clutch and gas pedals in the same axis.gainGet/set the global FF gain (0-65535). This property is independent of the gain set by applications using the Linux FF API.autocenterGet/set the autocenter strength (0-65535). This property can be overwritten by applications using the Linux FF API.spring_levelSet the level (0-100) for the spring type effects.damper_levelSet the level (0-100) for the damper type effects.friction_levelSet the level (0-100) for the friction type effects.peak_ffb_levelIt 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的数据,按键、踏板、方向盘。我们可以通过触碰按键、踩下踏板、转动方向盘来知道对应的索引号。

自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)

4、打开终端输入 $ sudo jstest -gtk 打开调试的可视化工具,可以对方向盘等进行调试,阈值参数修改等。

自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)

; 四、VTD调用Logitech G923

1、按下图配置相关参数,主要是 MockupJoystick,配置完成后(记得在MM打开动力学模型),随后运行即可开始使用方向盘控制。

注意:
1&#x3001;player&#x586B;&#x5199;&#x9700;&#x8981;&#x63A7;&#x5236;&#x8F66;&#x8F86;&#x7684;&#x540D;&#x79F0;
2&#x3001;index&#x8981;&#x6309;&#x7167;&#x7B2C;&#x5927;&#x4E09;&#x4E2D;&#x7684;&#x7D22;&#x5F15;&#x53F7;&#x914D;&#x7F6E;&#xFF0C;&#x5FC5;&#x987B;&#x4E00;&#x4E00;&#x5BF9;&#x5E94;&#x8D77;&#x6765;&#x3002;
3&#x3001;device&#x6309;&#x7167;&#x771F;&#x5B9E;&#x7684;&#x8DEF;&#x5F84;&#x914D;&#x7F6E;&#xFF0C;&#x4E0A;&#x9762;&#x6709;&#x8BB2;&#x5230;

自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)

五、Veristand调用Logitech G923 拓展

&#x6CE8;&#xFF1A;&#x5B9E;&#x65F6;&#x673A;&#x65E0;&#x6CD5;&#x8C03;&#x7528;Labview&#x4E2D;&#x7684;&#x64CD;&#x7EB5;&#x6746;&#x91C7;&#x96C6;&#x6A21;&#x5757;&#xFF0C;&#x56E0;&#x6B64;&#x53EA;&#x80FD;&#x5728;&#x672C;&#x5730;&#x6A21;&#x5F0F;&#x4E0B;&#x8FD0;&#x884C;&#x4E14;&#x4E3A;Window&#x73AF;&#x5883;&#x3002;

自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)
主要实现程序:
自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)
下面做了方向盘角度转换、油门踏板、刹车踏板、离合开度转换
自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)

综上完成VTD对Logitech G923调用

Original: https://blog.csdn.net/zataji/article/details/127812987
Author: mydate()
Title: 自动驾驶仿真:VTD调用罗技 G923方向盘(Linux环境)

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/653801/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球