JackFK / ps4-ros

[ROS] Sony PlayStation 4 DualShock®4 node joy_msg to twist_msg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ps4_ros

Sony PlayStation 4 DualShock®4 node joy_msg to twist_msg

Installation

  1. Install ds4dr: $sudo pip install ds4drv
  2. Install ros-joy: http://wiki.ros.org/joy
  3. Go into pairing mode with PS4: Playstation button + share button for ~5 sec
  4. Run $ds4drv from command line to connect to PS4
  5. This will output something like _Created devices /dev/input/jsX
  6. remember /dev/input/js__X__ and update the launch file (default X=0)
  7. $sudo chmod a+rw /dev/input/jsX

Starting

One by one

  1. $ds4drv if it is not running already.
  2. $rosparam set joy_node/dev "/dev/input/jsX"
  3. $rosrun joy joy_node
  4. $rosrun ps4_ros ps4_ros

roslaunch

  1. $roslaunch ps4_ros ps4
  • One can adjust the following parameter inside the launch file or use rosparam by using the one by one start procedure

    • <param name="scale_angular" value="1.5"/>

    • <param name="scale_linear" value="0.5"/>

Troubleshooting

  • Display raw ds4drv data
    • $sudo jstest /dev/input/jsX

To Do (v.2.0)

  • Pan-and-Tilt on second joystick

About

[ROS] Sony PlayStation 4 DualShock®4 node joy_msg to twist_msg

License:GNU General Public License v3.0


Languages

Language:C++ 86.5%Language:CMake 13.2%Language:Shell 0.2%