Giter VIP home page Giter VIP logo

logitech_steering_wheel's Introduction

Logitech Steering Wheel Module

This module allows access from Python to the steering wheel SDK provided by Logitech for their gaming steering wheels. The API of this module is the same as the "Logitech Gaming Steering Wheel SDK" version 8.75.30. This SDK and it's documentation can be downloaded from the Logitech G website. The module has been tested on Python 3.8 and only works on Windows.

This module includes part of the before mentioned steering wheel SDK (the LogitechSteeringwheel.dll and LogitechSteeringWheelEnginesWrapper.dll files). These files do not fall under the open source license with the rest of the module. They are re-distributed with permission from Logitech (also see the README file in the SDK). Therefore, there is no need to obtain the SDK. The only dependency of this module is the Logitech Gaming Software.

Installation instructions

The logitech-steering-wheel module is available from PyPi and can be installed using pip (pip install logitech-steering-wheel). The only dependency is the Logitech Gaming Software that can be downloaded for Logitech's website. The module has been tested with version 5.10. This version works with older steering wheels. According to Logitech, the SDK is also compatible with newer versions of the gaming software.

In some cases, Windows has been known to install other drivers when a steering wheel is plugged in. These default drivers installed by Windows do not work with the SDK. The solution to is problem is to:

  1. plug in the steering wheel,
  2. uninstall the driver Windows automatically installed, and leave steering wheel plugged-in and turned on, and
  3. Install the Logitech Gaming Software (this should automatically install the correct drivers)

Test/Example

The script below can be used to test the connection with a steering wheel and serves as an example of how to connect, get the current state, and play force feedback effects. This example and a GUI based example can be found on the GitHub repo of this module.

import time

import logitech_steering_wheel as lsw
import pygetwindow as gw


if __name__ == '__main__':
    # The steering wheel should be connected to s specific window, the first step is to get the window handle and initialize the SDK
    
    window_handle = gw.getActiveWindow()._hWnd
    initialized = lsw.initialize_with_window(ignore_x_input_controllers=True, hwnd=window_handle)

    print("SDK version is: " + str(lsw.get_sdk_version()))

    connected = lsw.is_connected(0)

    lsw.update()

    # Check if setting and Getting of the operating range works 
    operated = lsw.set_operating_range(0, 100)
    print(lsw.get_operating_range(0))

    if connected and generated:
        print('Steering wheel online')
    else:
        print('Connection failed')
        exit()

    # The update function is called to update the current state, the get state function returns a state object representing the current state of the 
    # steering wheel
    lsw.update()
    s = lsw.get_state(0)
    print(s)

    # Test the force feedback by playing the bumpy road effect on 20 percent of its maximal magnitude 
    lsw.play_bumpy_road_effect(0, 20)

    time.sleep(2.)

    lsw.stop_bumpy_road_effect(0)

    # close the connection
    lsw.shutdown()

logitech_steering_wheel's People

Contributors

olgersiebinga avatar

Stargazers

Ziyu avatar Chirudeep  avatar Wilson Queiroz de Oliveira avatar Alberto Alarcon avatar  avatar

Watchers

Arkady Zgonnikov avatar  avatar Wilson Queiroz de Oliveira avatar Alberto Alarcon avatar

logitech_steering_wheel's Issues

Bumpy road effect

Hi,
when i run the GUI code i could see the bumpy road effect feedback in the steering wheel, but when i run the test_script i could not see any bumpy road effect in the steering wheel but the scripts runs successfully and shows steering wheel connected.

if i update the code to play_slippery_road_effect i could not see any effect on the steering wheel.

Thank you

Can´t interact with the device

Hello. I´m trying to controll the force feedback of a Logitech Driving Force PRO. With the demo app of the logitech sdk all works fine, but with the wrapped version, i can only initialize the wheel and get device name, manufacturer... none of the interactions with the wheel work. I can set range, but when getting it, it hasn´t changed. Also no ffb effects are played.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.