yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Game Handle📖
1.Introduction to the Handle
  • Introduction to the Handle
2.Python Driver Tutorial
  • Python Driver Tutorial
3.ROS Driver Tutorial
  • ROS1 Handle Driver
  • ROS2 Handle Driver
4.Car Control Tutorial
  • ROSMASTER M3 Pro Car Control Tutorial
  • ROSMASTER X3PLUS Car Control Tutorial
5.ROS Car Upgrade Controller Adaptation Tutorial
  • ROS Car Upgrade Controller Adaptation Tutorial
Download
  • Code
  • VM_File
  • Instruction Manual
  • WindowsSoftware
Download ZIP

Welcome to Game Handle repository

ROS1 Handle Driver

ROS1 Handle Drive

I. Setup of the experimental Environment

  • Ubuntu18.04

  • Melodic

Note

This tutorial uses a 2.4G test environment as an example!

The controller supports rapid-fire functionality. If you experience jitter when pressing a button, please disable the rapid-fire function for the corresponding button according to the instruction manual.

Before testing, ensure the controller receiver is connected to the motherboard or PC, and switch the controller to DINPUT. ( Press and hold FN+SELECT for 3 seconds ) A solid blue indicator light indicates successful pairing of the controller.

If you use the virtual machine environment we provide, you can skip the following environment setup steps and directly conduct the controller test

  1. Install the handle to control the environment

sudo apt install ros-melodic-joy*

Type "Y" and press Enter to confirm the installation

image-20251208184528865

install joystick

xxxxxxxxxx
sudo apt install joystick

image-20251209112809838

Type "Y" and press Enter to confirm the installation

After the installation is completed, refresh the environment variables again

xxxxxxxxxx
source ~/.bashrc

Ii.Test the handle

test method 1

Before testing, make sure the handle receiver is connected to the motherboard or PC and successfully paired. Enter the following command to check if the handle device can be detected

xxxxxxxxxx
ll /dev/input/js0

image-20251209100243262

As shown in the figure, it indicates that the handle receiver has been successfully recognized. Note that if a mouse or keyboard is connected, the js device may also be recognized, but the program only recognizes js0. Therefore, if there are multiple js devices, the handle receiver should be connected first, and then the other devices. If the handle is connected, the indicator light will be in a constant green state. If it flashes, it indicates that the connection is disconnected.

Execute the test instructions

Here, the actual device number is taken as the standard. We take js0 as an example

xxxxxxxxxx
sudo jstest /dev/input/js0

image-20251209113959335

test method 2:

Enter the following instructions to the terminal to run the handle node program

xxxxxxxxxx
roscore

Open another terminal and input

xxxxxxxxxx
rosrun joy joy_node 

Open another topic about terminal print controllers

image-20251209100947678

As shown in the above figure, it is the data content of this topic

Iii. Button Introduction

【Buttons】Represent physical buttons

Buttons IndexGamepad Button
buttons[0]A
buttons[1]B
buttons[2] 
buttons[3]X
buttons[4]Y
buttons[5] 
buttons[6]L1|LB
buttons[7]R1|RB
buttons[8]L2|LT
buttons[9]R2|RT
buttons[10]SELECT
buttons[11]START
buttons[12]Left Stick Press
buttons[13]Right Stick Press

【Axes】Represent joysticks

Axes IndexGamepad Control
axes[0]Left Joystick (Left = Positive, Right = Negative)
axes[1]Left Joystick (Up = Positive, Down = Negative)
axes[2]Right Joystick (Left = Positive, Right = Negative)
axes[3]Right Joystick (Up = Positive, Down = Negative)
axes[4]R2|RT (Pressed: -1, Released: 1)
axes[5]L2|LT (Pressed: -1, Released: 1)
axes[6]D-pad (Horizontal) (Left = Positive, Right = Negative)
axes[7]D-pad (Vertical) (Up = Positive, Down = Negative)

Iv. Control Turtle with Gamepad

Execute the following commands:

xxxxxxxxxx
roslaunch joy_ctrl joy_turtlesim.launch

image-20251211144531122

Gamepad ButtonFunction Description
Left Joystick UpMove Forward
Left Joystick DownMove Backward
Right Joystick UpTurn Left
Right Joystick DownTurn Right
Python Driver Tutorial
ROS2 Handle Driver

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文