frustrated. gobot.io joystick support on raspberry pi

40 views
Skip to first unread message

Carl Ranson

unread,
Jun 7, 2018, 6:07:03 AM6/7/18
to gobotio
Hey all, 

been trying to get a joystick to work for a raspberry pi/gobot based robot I'm tinkering with. 

Seems gobot.io requires SDL 2.0.6 or better but the pi only has v2.0.5

has anyone cracked this problem? is there an approach that doesn't need SDL?

thanks,
CR.

Jay Newman

unread,
Jun 7, 2018, 7:27:27 AM6/7/18
to gobotio
Hi,

I managed to install Gobot on my Pi's without ever running into SDL. Could you please explain what SDL is? I found over 50 definitions of it, and can't seem to find it on my system. I'd love to see the code for a joystick.

Ron Evans

unread,
Jun 7, 2018, 8:06:25 AM6/7/18
to gobotio
Hello, there

These instructions should apply to any Debian like Raspbian, as well as Ubuntu:

Carl Ranson

unread,
Jun 10, 2018, 3:15:24 AM6/10/18
to gobotio
Thanks Ron, 

Not sure what I was doing wrong the first time I tried it but managed to make a fair bit of progress there. 
I've now got a dualshock 3 connected to the bot, and visible as far as the os is concerned, The sample code provided on that page builds and runs without problems and outputs events when i move the mouse around. 

It seems i've got two joystick devices, the first one being vnc-abspointer and the second being the dualshock.

From the documentation it looks like the joystickDriver's second parameter is the name of the config file to use. Anyone know how that tells it which joystick device to use?

thanks, 
CR 

Ron Evans

unread,
Jun 10, 2018, 7:23:32 AM6/10/18
to gobotio
That parameter refers to the definition now which joystick to connect to. The current code only connects to the first joystick, which is probably why you are having an issue.

I've added a Github issue to Gobot to track this: https://github.com/hybridgroup/gobot/issues/564

Carl Ranson

unread,
Jun 11, 2018, 4:15:40 AM6/11/18
to gobotio
Hi Ron

I managed to get it running by hacking the joystick driver to default to the last joystick. I'll keep an eye on the issue above on github.
thanks again for your help

Carl.

Carl Ranson

unread,
Jul 7, 2018, 3:17:08 AM7/7/18
to gobotio
Hey Ron, 

I put my head down today and worked out how to make the code select the joystick by name. its actually a pretty trivial change. 
I've added a comment to the issue with the block of code. Sorry I don't have time to do a full pull request etc, but hopefully that's still helpful. 

thanks, 
Carl R.


On Sunday, June 10, 2018 at 11:23:32 PM UTC+12, Ron Evans wrote:

Ron Evans

unread,
Jul 7, 2018, 6:40:19 AM7/7/18
to gobotio
Thanks, Carl!

Carl Ranson

unread,
Jul 8, 2018, 3:24:22 AM7/8/18
to gobotio
oh, and while were at it heres the config file i used for that thumb joystick.

magicseer1.json
Reply all
Reply to author
Forward
0 new messages