Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] joystick angle

edited February 2016 in OpenSesame

Hi guys, I'm trying to set up an experiment in which participants point to things with a joystick. I'm interested in getting the pointing angle (in degrees) and the rt. The RT is no problem but I'm wondering if there's an easy way to get the angle (or at least the x-y coordinates and get the angle from there using trigonometry). Any ideas?


  • edited 12:19AM

    Hi Mario,

    The joystick plug-in ( has the function .get_joyaxes() which returns a position value. I suspect this to be an x,y-tuple, although it could also be the direct angle of the joystick. You could in any case verify this manually, by moving the joystick to a specific angle (for example the maximum, the angle of which is easiest to retrieve), and compare it to the output. Let me know if it works.



  • edited 12:19AM

    Thanks for the reply Josh. I've tried the .getjoyaxes() function and the position value I get is a tuple with 5 values. They range from -1 to 1 and the 4th one is always 0. Can't really tell what these numbers mean and I'm not sure why there's 5 of them!

  • edited February 2016

    Hi Marios,

    The joystick you're using seems to have 5 axis. You can figure out which values correspond to which axes by trial-and-error. If, by any chance, you're using the XBox 360 controller on Windows, please refer to this image. Other controllers (and the same controller under different operating systems) will be different.

    Two of the axes should be the x- and y-axes for the main stick. The values of these axes range from -1 (all the way to one side) to 1 (all the way to the other side). 0 means the axis isn't angles at all.

    Using Pythagoras, you can simply recalculate the two axes' states into an angle.

    Good luck!

    Edwin (wrote most of the joystick plug-in)

  • edited 12:19AM

    Ah, that explains it! I generally use Logitech Attack 3 joysticks for my experiments but I only had a more complex Saitek joystick at home yesterday to play with. Thanks for the reply Edwin, and for the plugin (I used your sample experiment to figure out how to make the joystick work).

  • edited 12:19AM

    No worries! :)

    The Attack 3 has three axes: x and y for the main stick, and a z-axis for the throttle (the bit you can slide up and down; it's on the side near to the user).

    Not familiar with the Saitek brand, but I hear it's primarily for flight simulators? Sounds fancy!

    Will mark this as solved. Thanks for letting us know!



Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games