Automatic driving simulation: VTD calls Logitech G923 steering wheel (Linux environment)


foreword

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

The following Logitech models are supported
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

提示:以下是本篇文章正文内容,下面案例可供参考

1. Install new-lg4ff-master driver

1. Click to enter GitHub and download new-lg4ff-master

2. Unzip the downloaded new-lg4ff-master.zip file to /usr/src/new-lg4ff-masterthe path of the Linux system

3. Use DKMS to install new-lg4ff-master:$ sudo dkms install /usr/src/new-lg4ff-master

4. Check whether the new-lg4ff-master driver is installed:$ sudo dmesg |grep logi

The figure below 0003:046D:xxxx.xxxxis the hardware device number

insert image description here

2. Logitech G923 hardware parameter configuration

1. We can enter /sys/bus/hid/drivers/logitech/0003:046D:xxxx.xxxx/the folder and see the following files, and open them with text to modify the parameters.
insert image description here
Parameters and meanings:

parameter name meaning
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.
car center 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).

3. jstest-gtk visual debugging tool

1. Open the terminal and enter: $ sudo apt-get install jstest-gtkinstall jstest-gtk

2. Open the terminal and input $ cd /dev/input/, $ lsand know the device name of the logitech G923 by plugging and unplugging the drive cable: js0

3. Open the terminal and enter to $ sudo jstest /dev/input/js0view the index number corresponding to each button of the Logi G923, because we will associate the index number on the VTD to obtain the data of the Logi G923, buttons, pedals, and steering wheel. We can know the corresponding index number by touching the button, stepping on the pedal, and turning the steering wheel.

insert image description here

4. Open the terminal input $ sudo jstest -gtkto open the debugging visualization tool, you can debug the steering wheel, etc., modify the threshold parameters, etc.

insert image description here

4. VTD calls Logitech G923

1. Configure the relevant parameters as shown in the figure below, mainly Mockup and Joystick . After the configuration is completed (remember to open the dynamic model in MM), and then run to start using the steering wheel control.

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

insert image description here

5. Veristand calls Logitech G923 to expand

注:实时机无法调用Labview中的操纵杆采集模块,因此只能在本地模式下运行且为Window环境。
insert image description here
The main implementation program:
insert image description here
the steering wheel angle conversion, accelerator pedal, brake pedal, clutch opening conversion are done below
**Bold Style**


In summary, VTD calls Logitech G923

Guess you like

Origin blog.csdn.net/zataji/article/details/127812987