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


前言

提示: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_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的数据,按键、踏板、方向盘。我们可以通过触碰按键、踩下踏板、转动方向盘来知道对应的索引号。

在这里插入图片描述

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

在这里插入图片描述

四、VTD调用Logitech G923

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

注意:
1、player填写需要控制车辆的名称
2、index要按照第大三中的索引号配置,必须一一对应起来。
3、device按照真实的路径配置,上面有讲到

在这里插入图片描述

五、Veristand调用Logitech G923 拓展

注:实时机无法调用Labview中的操纵杆采集模块,因此只能在本地模式下运行且为Window环境。
在这里插入图片描述
主要实现程序:
在这里插入图片描述
下面做了方向盘角度转换、油门踏板、刹车踏板、离合开度转换
**加粗样式**


综上完成VTD对Logitech G923调用

  • 5
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

自动驾驶simulation

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值