Skip to content

Unable to receive values from the controller.  #2

@MurtazaHassan01

Description

@MurtazaHassan01

Hi, Thanks for the great code. I tested it out with given test scripts and both of them run fine. The Steering wheel moves properly.
I am trying now to get values from the steering wheel. Specifically of the steering rotation. I would like to know the force being applied by the user (or the angle of the steering wheel). I have tried the state engine but no luck so far. Can't seem to get the states of the buttons as well.
Would really appreciate if you could point me in the right direction. Thanks

Here is the code i have tried.

import sys
sys.path.append('../logidrivepy')
from logidrivepy import LogitechController
import time

controller = LogitechController()
controller.steering_initialize()

while True:
    state_pointer = controller.LogiGetStateENGINES(0)
    state = state_pointer.contents

    # Retrieve force feedback values
    force_x = state.lFX
    force_y = state.lFY
    force_z = state.lFZ

    # Print or use the force feedback values
    print(f"Force X: {force_x}")
    print(f"Force Y: {force_y}")
    print(f"Force Z: {force_z}")


controller.steering_shutdown()


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions