Skip to content

joystick

趙 漠居(Zhao, Moju) edited this page Jan 9, 2019 · 13 revisions

PlayStation DualShock3 and DualShock4 are supported in our system.Both controller are confirmed in Ubuntu16.04

PlayStation DualShock3

PS3joy

Install for wireless connection

Please refer to https://retropie.org.uk/forum/topic/2913/guide-use-qtsixa-on-ubuntu-16-04-and-derivatives

$ sudo apt-get install  pyqt4-dev-tools   libusb-dev libjack-dev libbluetooth-dev python-dbus -y
$ git clone https://github.com/falkTX/qtsixa.git
$ cd qtsixa
$ make
$ sudo make install

Pairing

Connect the controller with host PC via USB cable, and run following command:

$ sudo sixpair

Wireless Connection

Unplug the joystick from the computer, and run following command:

$ sixad --start

Press the PS button in the middle of the joystick and the connection will be activated.

Option: start sixad on boots

edit /etc/rc.local, and add following description before exit 0

sixad --start 

Note: if you can not connect with pc even pressing the PS button, please restart the sixad by following command:

$ sixad -r

Common commands:

command action
start motor arming (please do this before takeoff)
corss-left + circle takeoff (this can be received by robot only after motor arming)
cross-right + squre landing
select (short push) force landing (without xy position control, robot will descend slowly)
select (long push, > 2.0s) halt (i.e. stop motor immediately )
triangle xy(horizontal) velocity control mode
cross(X) xy(horizontal) position control mode
cross-down xy(horizontal) attitude control mode
left stick vertical movement in world x axis (only available in velocity/attitude control mode)
left stick horizontal movement in world y axis (only available in velocity/attitude control mode)
left stick vertical + L2 movement in baselink (local) x axis (only available in velocity/attitude control mode)
left stick horizontal + L2 movement in baselink (local) y axis (only available in velocity/attitude control mode)
right stick vertical movement in z axis
right stick horizontal + push right stick movement in yaw axis

For more information about ps3joy in ros, please check here

PlayStation DualShock4

PS4joy

Install for wireless connection

Please refer to http://cryborg.hatenablog.com/entry/2016/09/19/185501

$ sudo pip install ds4drv

Wireless Pairing

  • No need to connect the controller with host PC via USB cable
  • But please check the bluetooth is ON in host PC as shown in following figure: bluetooth
  • Run following command:
$ sudo ds4drv

Press the PS button and options simultaneously for more than 10 second, and check whether the controller is blinking. If the led of controller turns to blue than the connection is activated.

Option: start sixad on boots

edit /etc/rc.local, and add following description before exit 0

ds4drv 

Common commands:

the different key bounds of dualshock4 are:

  • share in dualshock4 = start in dualshock3
  • options in dualshock4 = select in dualshock3

different commands:

command action
share motor arming (please do this before takeoff)
options (short push) force landing (without xy position control, robot will descend slowly)
options (long push, > 2.0s) halt (i.e. stop motor immediately )

For more information about ps4joy in ros, please check here

euroc

Clone this wiki locally