Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access the Sony Playstation SixAxis Controller using C++ on Linux

I'm coding in C++ on Linux (Ubuntu 12.04 specifically) and would like to use the PlayStation SixAxis controller (the type that comes with the PS3) as an input device, ideally over bluetooth.

My application will be running headless. There's no window manager running on the target platform. The target is a small robot that's running Ubuntu Server 12.04, though I'm developing on a desktop.

Are there any libraries or techniques for this that I could use?

like image 352
Drew Noakes Avatar asked Oct 05 '22 06:10

Drew Noakes


2 Answers

My current solution involves using this ppa on ubuntu 12.04

sudo apt-add-repository ppa:falk-t-j/qtsixa
sudo apt-get update
sudo apt-get install sixad -y
# plug controller into machine (via wire)
sudo sixpair
# unplug controller
sixad --start
# hold PS button

I then found your c++ library, and it works great. I now have sixaxis controlled robots!

like image 75
Brendan Annable Avatar answered Oct 10 '22 04:10

Brendan Annable


pkg-config opencv –libs –cflags
 run script for local-dir
t-j/qtsixa
sudo apt-get update
sudo apt-get install sixad -y
# plug controller into machine (via wire)
sudo sixpair
# unplug controller
like image 26
Joseph Wamoto Avatar answered Oct 10 '22 02:10

Joseph Wamoto