4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PS3コントローラ (DUALSHOCK3; SIXAXIS)をROSに接続する(有線編)

Posted at

筆者の環境と機器

  • Ubuntu 14.04
  • ROS Indigo
  • DUALSHOCK3 WIRELESS CONTROLLER
  • USBケーブル (A type - Mini B type)

インストール

ROS Indigoは導入済みの時点から開始。
aptで必要なソフトウェアをインストール。

$ sudo apt-get install ros-indigo-joystick-drivers 

Ubuntuがコントローラを正常に認識していることを確認

$ ls /dev/input/js0

USBケーブルで、コントローラをPCに接続。またコントローラが十分に充電されていることを確認。
そして、ターミナルで

$ roscore

さらに別のターミナルで、

$ rosrun joy joy_node  
[ INFO] [1469617859.336444877]: Opened joystick: /dev/input/js0. deadzone_: 0.050000.

rostopicで出力を確認すると以下の通り。

$ rostopic echo -c /joy
header: 
  seq: 528
  stamp: 
    secs: 1469617998
    nsecs: 830194045
  frame_id: ''
axes: [-0.0, -0.0, -0.0, -0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.08682194352149963, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

参考

ps3joy

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?