cengizozel / LogiDrivePy

A Python module for interfacing with Logitech steering wheels.
https://pypi.org/project/logidrivepy/
MIT License
33 stars 1 forks source link

Help using your module to integrate it with CARLA Autonomous Driving Simulator #1

Closed Optimiza closed 9 months ago

Optimiza commented 1 year ago

Hi, first I'd like to thank you for your work.

I've been exploring ways to integrate Python with a Logitech G29.

Currently, I'm working on scripts to add new features to CARLA (https://carla.org/).

I've already implemented G29 support using PyGame, but some features like Force Feedback and steering wheel movement aren't supported by this library.

I came across your package and thought it might be the solution.

However, while your library does recognize the connected steering wheel, I haven't been able to interact with it. I've tried manipulating the LEDs without success, and even running your test cases didn't allow me to move the steering wheel.

Below is the error I encountered upon closing the controller, which leads me to believe something might be wrong.

Any guidance would be greatly appreciated.

I really appreciate any help you can provide.

steering_initialize: True logi_update: True is_connected: True

---Logitech Spin Test--- Spin test passed.

[2023-09-07 22:25:08.715] [info] [websocket_client.cpp:204] ignoring request to stop websocket client -> already stopped!

cengizozel commented 1 year ago

Hello, thank you for the kind words!

I've just tested it, and it seems to work on my machine. Then I moved my G920 from my office to the lab to test it on a different computer to start fresh and initially got all False from my run_controller_test.py.

Then I downloaded Logitech's G Hub application: https://www.logitechg.com/en-us/innovation/g-hub.html After the setup, both the run_controller and spin_wheel_test worked (both on Windows 10 and 11 64-bit).

About testing LEDs, I got this function to work.

def led_test():
    controller = LogitechController()
    controller.steering_initialize()
    print("\n---Logitech LED Test---")

    for i in range(0, 100):
        controller.play_leds(0, 0, 0, 0)
        controller.logi_update()
        time.sleep(0.1)

    controller.steering_shutdown()

You can check function.py comments for information on all functions. Additionally, here is Logitech's official documentation (on C# equivalent functions): https://drive.google.com/file/d/1egz5y3Ry7yMiVT7R6z-MhEpdxD_aifvG/view?usp=sharing

I hope you find this relevant to your issue. Please let me know how it goes.

Optimiza commented 1 year ago

Hi, and thank you once again for your reply.

It's working now :)

After starting from scratch and rebooting the system, it worked. It appears that the Windows environment was impacted by the numerous tests I had conducted earlier.

Many thanks!

cengizozel commented 1 year ago

Amazing, I'm very glad that it worked. Thank you for the update!

saicsk-deloitte commented 9 months ago

Hi @Optimiza , @cengizozel I want to know if I can use this package for Fanatec Steering Wheel (& OS: 'Windows')?

cengizozel commented 9 months ago

Hello @saicsk-deloitte

Unfortunately, I have not tested this package with the Fanatec Steering Wheel. This project is a Python implementation of Logitech's SDK, which does not list the Fanatec Steering Wheel as a supported device. You can view a list of supported devices at LogiDrivePy Supported Devices.

As the original issue in this thread has been resolved, I will be closing this issue thread to keep our discussions organized and focused. Feel free to start a new thread for any further inquiries or discussions.