Skip to main content

python driver for g29 wheel/pedals

Project description

g29py

python driver for logitech g29 wheel/pedals

:warning: Warning: g29py is alpha software. This repository is under heavy development and subject to breaking changes. :warning:

Install

pip install g29py

Use

from g29py import G29
g29 = G29()
# write 
g29.set_range(500)
g29.set_friction(0.5)
# read
g29.listen() # thread
while 1:
    state = g29.get_state()
    print("steering:", state["steering"])
    print("brake:", state["brake"])
    print("accelerator", state["accelerator"])

Read

Pedals/Steering

Pedal Value Range Neutral Position
steering Float: -1 to 1 0 (Centered)
accelerator Float: -1 to 1 -1 (Not pressed)
clutch Float: -1 to 1 -1 (Not pressed)
brake Float: -1 to 1 -1 (Not pressed)

Buttons

Button Value
up 0/1
down 0/1
left 0/1
right 0/1
X 0/1
O 0/1
S 0/1
T 0/1
R2 0/1
R3 0/1
L2 0/1
L3 0/1
Share 0/1
Options 0/1
+ 0/1
- 0/1
track -1/1
back 0/1
PS 0/1

Write

Method Name Default Parameters Parameter Types
force_constant val=0.5 val: float
set_friction val=0.5 val: float
set_range val=400 val: int
set_autocenter strength=0.5, rate=0.05 strength: float, rate: float
set_anticenter angle1=180, angle2=180, strength=0.5, reverse=0x0, force=0.5 angle1: int, angle2: int, strength: float, reverse: hexadecimal, force: float
autocenter_off None None
force_off slot=0xf3 slot: hexadecimal

Sources

  • Commands based on nightmode's logitech-g29 node.js driver.
  • Interface uses libhidapi ctype bindings from apmorton's pyhidapi.
  • Reference wiki-brew for effects API.

Support

Only Logitech G29 Driving Force Racing Wheels & Pedals kit supported on linux in ps3 mode.

On linux, remove sudo requirements by adding udev rule.

echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' \
    | sudo tee /etc/udev/rules.d/99-hidraw-permissions.rules
sudo udevadm control --reload-rules

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

g29py-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

g29py-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file g29py-0.1.0.tar.gz.

File metadata

  • Download URL: g29py-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.10 Linux/5.15.0-91-generic

File hashes

Hashes for g29py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1aae6b4cda382185d3d9883a24eaeee11d45be88620a1845f2105afb5046215e
MD5 a27cf96a12543644d811ec605f77e93d
BLAKE2b-256 091fbf902594438e9665a32a0a610c3f8e8bad72a19e51f5137b4770de1cf037

See more details on using hashes here.

File details

Details for the file g29py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: g29py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.10 Linux/5.15.0-91-generic

File hashes

Hashes for g29py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4febecdc9c7f1f2dc15097029fd3c8a04de7247c8bfecdb27610d3b6f341b728
MD5 b9a99f6d17d67f1693e516f285b78a7d
BLAKE2b-256 5565477bd0cfbd8f76378eee9eadaedf87fa0e5b8b1a60459a398810440c6e7f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page