Re: How to turn "gaming wheel" automatically in autonomous driving mode!
Tambet Matiisen <[email protected]> Thu, 4 Aug 2016 09:26:33 +0300
| Newsgroups | gmane.games.torcs.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Alan! Sorry, I don't have much experience on Windows or with PLIB. Maybe you can replace PLIB with SDL2? But at least in my case the pySDL2 code didn't work that well on Windows. On Linux you could also do it at lower level, with ioctl-s: https://www.kernel.org/doc/Documentation/input/ff.txt Tambet On 3.08.2016 17:56, Alan Ali wrote: > Hi Tambet, > > Thank you for your response. > Actually, I have the Logitech G29 gaming wheel with a feedback force. > I am working on visual studio 2010 express. > > I will try to see if it is possible to control the gaming wheel using > the SLD2 library (I imagine it is a special and a simpler case of the > feedback force!). But I have some question: > 1- Is it possible to integrate it into TORCS without a conflict with > the existing library "PLIB's" where the joystick interface is > implemented according to > https://sourceforge.net/p/torcs/mailman/message/2873568/? or do i have > to do something to prevent conflicts? > 2- Isn't possible to do it directly by PLIB's? If yes, how? because i > can't find where to set the feedback force in the "js.h" and how to > know the position of the wheel? I even searched in PLIB library > mailing list for the feedback force and i didn't find any answer to > this issue! > > If i dont succeed with SLD2 i will try with Python because i don't > know it! > > Thank you a gain. > Alan > > > On Wed, Aug 3, 2016 at 3:35 PM, Tambet Matiisen > <[email protected] <mailto:[email protected]>> wrote: > > 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] >> <mailto:[email protected]> >> https://lists.sourceforge.net/lists/listinfo/torcs-users > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Torcs-users mailing list > [email protected] > <mailto:[email protected]> > https://lists.sourceforge.net/lists/listinfo/torcs-users > > > > > -- > /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