Commit Graph

33 Commits

Author SHA1 Message Date
Shane Smiskol
2af3cc6093 joystick: use ISO acceleration (#35230)
ISO max
2025-05-14 19:31:55 -07:00
Shane Smiskol
8f3e773977 actuators: rename steer to torque (#34724)
* bump

* temp fix

* fix

* forgot these
2025-02-27 16:12:55 -08:00
Shane Smiskol
6723106bf5 Move vehicle_model.py to opendbc (#34681)
* move

* fix

* move test too

* bump

* better

* bump to master
2025-02-26 17:35:43 -08:00
Shane Smiskol
e9aa331f0f set curvature in joystickd (#34668)
* set curvature in joystickd

* Update joystickd.py

* Update joystickd.py
2025-02-22 01:43:00 -08:00
Shane Smiskol
c515021576 joystick: fix long control state 2025-01-16 16:07:56 -08:00
Shane Smiskol
733206fdd9 fix joystick 2025-01-16 16:06:11 -08:00
Sammohana
8eebce75ac Getting rid of openpilot.common.numpy_fast (#34368)
* Got rid openpilot.common.numpy_fast

* fixed some data type erros

* importing numpy instead of importing specific functions

* fixing some numpy importing mistakes

* Update selfdrive/car/cruise.py

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2025-01-14 14:52:56 -08:00
Shane Smiskol
1965b2fd6e joystick: add cancel logic (#33950)
match cancel logic
2024-11-06 17:46:05 -08:00
Shane Smiskol
09b68eef3e fix lead distance bars w/ joystick mode (#33942) 2024-11-06 14:41:45 -08:00
Kacper Rączy
d82c4509ea joystickd: split into joystickd and joystick_control (#33632)
* Split joystickd into joystickd and joystick_control

* Update process config

* Undeprecate testJoystick

* Static analysis fixes

* Mark as +x

* Update README

* Add testJoystick back to services

* reset if testJoystick not received

* Fix quotes

* Remove self

* Add a send thread instead

* Add joystick_control into process config

* Add main

* Add additional condition

* Fix imports
2024-09-23 20:47:28 -07:00
Shane Smiskol
606943010e Reapply "joystickd is a real process (#33490)" (#33514)
* Reapply "joystickd is a real process (#33490)"

This reverts commit c8465e3a21.

* catch this

* reset to 0 when unplugged

* catch this too

* pytest capturing breaks stdin (pytest -s) fixes
2024-09-07 17:03:22 -07:00
Adeeb Shihadeh
c8465e3a21 Revert "joystickd is a real process (#33490)"
This reverts commit 374246845c.
2024-09-07 09:28:16 -07:00
Shane Smiskol
374246845c joystickd is a real process (#33490)
* true joystickd

* temp params hack, manager clears all on start

* implement main, assume js

* works

* fix enable

* clean up

* like a real controlsd

* clean up

* fix mypy

* clean up

* update refs

* clean up
2024-09-06 21:58:45 -07:00
Shane Smiskol
eecac1069e joystickd: mapping for PC (#33500)
work on PC
2024-09-06 21:06:34 -07:00
Shane Smiskol
5521ab6d53 Joystick: utilize left/right trigger for gas/brakes (#33474)
* try

* clean up

* flip

* Update tools/joystick/joystickd.py
2024-09-04 14:29:52 -07:00
Shane Smiskol
aec6547cf1 joystickd: works with game controller on device (#33414)
* state what we support

* more

* wording
old-commit-hash: dae88e1ffb
2024-08-30 22:54:42 -07:00
Shane Smiskol
ae96713070 joystick: perform deadzone first
old-commit-hash: fc425042ab
2024-08-30 22:30:49 -07:00
Shane Smiskol
b96b60fa6c joystickd: lower deadzone
old-commit-hash: 0a737d9a2e
2024-08-30 18:42:28 -07:00
Shane Smiskol
13acd5c84f joystickd: non-linear response function
old-commit-hash: f037d2216a
2024-08-30 18:40:32 -07:00
Maxime Desroches
c551f1d239 fix bash + python3 shebangs (#33287)
fix shebangs
old-commit-hash: 1dcd660815
2024-08-13 21:22:13 -07:00
Sliicy
fc2e961f1b Fixed joystickd.py incorrect steering control (#30879)
old-commit-hash: 6ccf2cbfde
2024-01-01 14:29:01 -08:00
Kacper Rączy
6c9a87556d joystickd: remove WEB (#30612)
Remove WEB option from joystickd
old-commit-hash: 6c62a31466
2023-12-05 14:42:44 -08:00
Adeeb Shihadeh
16ec56398c add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
old-commit-hash: a9626f95b6
2023-08-20 20:49:55 -07:00
jp-solutionz
e769f4d11a joystickd: add controller mapping (#25986)
* Correct default controller mapping.

Current config maps steering to right trigger (ABS_RZ) when using a default xinput controller: https://inputs.readthedocs.io/en/latest/user/hardwaresupport.html

This results in default full left steering angle (1) requiring right trigger to return to centre (0) or right (-1).

It appears the intended mapping for steering is right thumbstick (ABS_RX).

Cancel button is also non-existent on default xinput controller. May be X button (BTN_NORTH) or Right Trigger (ABS_RZ).

Tested on Xbox One Controller via USB Cable, Logitech F710 and GameSir T4 Pro.

* Update joystickd.py

Fixed comment

* gamepad configuration

* gamepad arg

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
old-commit-hash: 1d8fc4d21c
2022-10-12 20:48:22 -07:00
Adeeb Shihadeh
0325a33752 add pyside2 package (#25602)
old-commit-hash: c6b749fb96
2022-08-30 15:10:52 -07:00
Shane Smiskol
f49bbf60b6 joystick: revert max axes value (#25483)
revert this to 255
old-commit-hash: 16fe10e128
2022-08-18 23:34:48 -07:00
George Hotz
5ce06c5016 joystickd: add send thread
old-commit-hash: 13e18b605a
2022-04-18 22:35:19 -07:00
George Hotz
8353786c69 joystickd: add WEB support, add logitech joystick support
old-commit-hash: e9ef650901
2022-04-18 22:13:09 -07:00
Adeeb Shihadeh
597535c014 linter: don't allow implicitly concatenated strings (#23513)
* linter: don't allow implicitly concatenated strings

* fix hyundai
old-commit-hash: 2c94f15584
2022-01-13 14:19:38 -08:00
Adeeb Shihadeh
9908210bd6 tools: better joystick instructions
old-commit-hash: 7eca4d6207
2022-01-10 12:03:27 -08:00
Cameron Clough
f9e8fb3145 Joystick: learn axis min/max (#23377)
* Joystick: learn axis min/max

* clean up updating max/min

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 5a77157ea4
2022-01-04 14:17:30 +01:00
grekiki
9e4cc1f7ff Python: Replace more lists with generators (#23116)
* Replace lists with generators v2

* Replace set with {}

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Replace more set() with {}

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 6951b3271d
2021-12-03 22:57:19 -08:00
ShaneSmiskol
23ea456f4f Fixup joystick (#21129)
* some common changes

* rename to joystick

* add alert and update controlsd to work with joystick

* update joystickd

* Update Joystick readme

* assume we have inputs

* only send gb or steer when engaged_toggle is true

* Update instructions

* fix --ip

* Easier to understand at a glance

* much better

* -a

* receive events and send msg in same loop

* always import

* Update selfdrive/controls/lib/events.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update selfdrive/controls/lib/events.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* combine logic and clean up

* use argparse

* outdated, and use normal class

* rm

* bit of a refactor

* refactor part 2 / 3

* much better (3 / 3)

* Simplify

* bump cereal and update readme

* capitalize

* Update tools/joystick/joystickd.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update tools/joystick/joystickd.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* make joystick abstraction class clearer

* use interp, clearer without comments

* no need to use apply_deadzone

* more explicit

* define btns and axes once

* split function by use_keyboard again, but simpler

* we can use handle_button as a reset function

* need to flip sign

* remove

* invert axes map for kb, easier to read the button mapping

* apply changes from review

* new lateral log for debug mode

* bump

* add saturated

* static alert

* joystick_mode

* conditionally subscribe

* Update selfdrive/controls/controlsd.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* move params instantiation

* Spoof active and enabled

* Only allow car to engage

* no startup alert if joystick

* Update controlsd.py

* Should be orange not enabled, green enabled

* no more button states

* should work

* blue

* submaster conflates, so only send when we have an update

* final change

* remove msg

* clean up a bit

sort of clean up

clean up a bit

remove msg

* this was right

* Apply suggestions from code review

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* lowercase

* suggestions from code review

* forgot laptop

* bump to latest

* fixes

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
old-commit-hash: ae77f693a2
2021-06-11 14:33:17 -07:00