/ps4msd

ROS package to read PS4 DualShock controller that uses a Sub-GHz LPWA 920MHz wireless module that enables long-distance communication (Interplan IM920sL with XIAO-RP2040 board from Seeed Studio)

Primary LanguagePython

ps4msd

ROS package to read PS4 DualShock controller that uses a Sub-GHz LPWA 920MHz wireless module that enables long-distance communication (IM920sL Interplan with XIAO-RP2040 board from Seeed Studio). This takes naoki-mizumi/ds4_driver as message reference.

Installation

  1. Clone this project to your catkin's workspace src folder.
cd ~/<catkin-workspace>/src
git clone https://github.com/syahrulirwansyah12/ps4msd.git -b devel
  1. Run catkin_make in your workspace folder.
cd ~/<catkin-workspace> && catkin_make
  1. In case you haven't installed pyserial yet, please install it first.
pip install pyserial

or

pip3 install pyserial

if you're using Python3.

Running Program

  1. Check the authority of XIAO-RP2040's serial-port:
ls -l /dev/ttyACM*
  1. Add the authority of write: (such as /dev/ttyACM0):
sudo chmod 666 /dev/ttyACM0
  1. You can set the permission permanently by creating a udev rule.
cd /etc/udev/rules.d/
sudo touch local.rules

then add:

ACTION=="add", KERNEL=="/dev/ttyACM0", MODE="0666"

to the file you have been made.

  1. After setting up the serial port you can run the node by running roscore then rosrun:
roscore
rosrun ps4msd ps4msd_node.py

ROS Nodes

  1. Published Topics
    /joystick/joystate (ps4msd/Joystate)
       publishes topics from the joystick state
    /joystick/cmd_vel (geometry_msgs/Twist)
       publishes topic of command velocity from the right analog hat
  2. Parameters
    serial_port
       serial port name used in your system. (string, default: /dev/ttyACM0)
    baudrate
       serial port baud rate. (int, default: 115200)
    max_speed
       maximum linear speed in m/s. (float, default: 0.4)
    max_turn
       maximum angular speed in rad/s. (float, default: 0.8)