-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkuksa_seat_control.py
31 lines (25 loc) · 1.02 KB
/
kuksa_seat_control.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from kuksa_client.grpc import VSSClient, Datapoint
import time
def setup_driver_seat(profile):
"""
Setup the driver's seat with the given profile settings.
Parameters:
- profile: A list containing position, tilt, and height settings.
"""
seat_settings = [
('Vehicle.Cabin.Seat.Row1.DriverSide.Position', 'Position'),
('Vehicle.Cabin.Seat.Row1.DriverSide.Tilt', 'Tilt'),
('Vehicle.Cabin.Seat.Row1.DriverSide.Height', 'Height')
]
with VSSClient('127.0.0.1', 55556) as client: #'10.51.249.60', 30555
for setting, name in seat_settings:
client.set_target_values({setting: Datapoint(profile[seat_settings.index((setting, name))])})
print(f"Setting {name} to {profile[seat_settings.index((setting, name))]}")
time.sleep(1)
print("Finished setting up driver's seat.")
def main():
# Example profile: position = 50, tilt = 50, height = 50
profile = [50, 50, 50]
setup_driver_seat(profile)
if __name__ == "__main__":
main()