Re: How to turn "gaming wheel" automatically in autonomous driving mode!
Tambet Matiisen <[email protected]> Wed, 3 Aug 2016 16:35:45 +0300
| Newsgroups | gmane.games.torcs.general |
|---|---|
| Message-ID | <[email protected]> |
First you need a driving wheel supporting force feedback. I'm assuming you have one. If you happen to use Ubuntu, then there is a nice package joystick, that you can use to test your wheel. After installing it use jstest /dev/input/js0 to test the basic joystick functionality and fftest /dev/input/eventX to test the force feedback. With fftest you have to try all the event devices, in my case /dev/input/event4 was the right one, but it might not be the case with you. Also ffcfstress -d /dev/input/eventX is an example program doing exactly what you need to do - moving wheel to a different directions with constant force. Next if you want to control the force feedback yourself, the easiest option would be through SDL2, which has support for haptic devices: http://wiki.libsdl.org/CategoryForceFeedback You can install Python wrapper using pip install pysdl2. But you still have to refer to C++ documentation for details. As the API functions match exactly, it's not too complicated. An example how to use Python wrapper can be found here: https://github.com/tambetm/botmobile/blob/master/test/testhaptic.py I tried to do exactly the same thing as you and have a messy repo populated with half-working examples. Here is the Languarden's excellent Torcs Championship Server Client modified to turn the wheel: https://github.com/tambetm/botmobile/blob/master/src/ffdriver.py Hope this helps! Tambet On 2.08.2016 13:21, Alan Ali wrote: > Hi all, > > Sorry to send this email (by error) to the development list, so i > re-send it to the users list. > > I am developing a lateral control laws for the cars to follow the > tracks. I would like to make my "gaming wheel" turn automatically > according to applied control law (as the autonomous vehicles do). I > have searched in the mailing list about the feedback force but i > couldn't find how to control the gaming wheel (the feedback isn't > implemented!), so would you please tell me how control the gaming > wheel (e.g, how to turn it 10 degrees)? > > Thank you > > -- > /Alan ALI/ > > > <mailto:[email protected]> > > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Torcs-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/torcs-users ------------------------------------------------------------------------------ _______________________________________________ Torcs-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/torcs-users