yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
ROS USB Handle📖
Wired Handle Tutorial
Raspberry Pi Tutorial
  • 1.Install jupyterLab
  • 2.Basic course
  • 3.Control DOFBOT
Jetson nano tutorial
  • 1. Install jupyterLab
  • 2.Basic course
  • 3.Control DOFBOT
  • 4.Control Jetbot
Wireless Handle Tutorial
Basic Control Cases
  • 1. Install JupyterLab
  • 2. Basic course
ROS1 Course
  • 1. ROS1 Course
ROS2 course
  • 1. Environment Construction
  • 2.Handle controlled robot
Download
  • Code
  • APP(Android/iOS)
Download ZIP

Welcome to ROS USB Handle repository

1. ROS1 Course

Handle ROS1 course

1、Operating environment Operating System: Ubuntu 18.04 ROS version: mellodic Devices: Jetson nano, Raspberry Pi, PC

2、Install the driver

sudo apt install ros-melodic-joy ros-melodic-joystick-drivers

3、Usage steps

Connect the USB end of the wireless controller to the device

  • View Device
xxxxxxxxxx
ls /dev/input

010

  • Test handle
xxxxxxxxxx
sudo jstest /dev/input/js0 

011

If jstest is not installed, run the following command:

xxxxxxxxxx
sudo apt-get install joystick
  • Operation handle node
x
roscore step1
rosrun joy joy_node Step3
rostopic echo joy Step3

012

4、Handle control Little Turtle

Copy the wireless handle control function package to the workspace, compile and update the environment

x
Catkin_ Make # Compile
Source dev/setup. bash # Update environment
Note: Any modifications to C++code require this step to take effect.

Start Python code command

xxxxxxxxxx
roslaunch joy_ctrl joy_turtlesim.launch

Start C++code command

xxxxxxxxxx
roslaunch joy_ctrl joy_turtle.launch

013

At this point, the handle can be used to control the operation of the little turtle. Corresponding relationship between the handle and the operation of the little turtle

HandleLittle turtle
Left rocker upforward
Left rocker downback
Right rocker leftturn left
Right rocker rightturn right
  • View node diagram
xxxxxxxxxx
rqt_graph

014

5、Handle controlled turbobot

Due to the need to start gazebo, there is a high demand for device performance. It is recommended to use it on a PC, as Jetson nano and Raspberry pie may become particularly sluggish and may not run properly.

Install gazebo and turbobot simulations

xxxxxxxxxx
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gazebo9 libgazebo9-dev ros-melodic-turtlebot3*

Copy the wireless handle control function package to the workspace, compile and update the environment

x
Catkin_ Make # Compile
Source dev/setup. bash # Update environment
Note: Any modifications to C++code require this step to take effect.

Start Python code command

xxxxxxxxxx
roslaunch joy_ctrl joy_turtlesim.launch

Start C++code command

xxxxxxxxxx
roslaunch joy_ctrl joy_turtle.launch robot_simulation:=turtlebot

015

At this point, the handle can be used to control the operation of the turbobot.

Corresponding relationship between the handle and the operation of the little turtlebot

Handleturtlebot
Left rocker upforward
Left rocker downback
Right rocker leftturn left
Right rocker rightturn right
  • View node diagram
xxxxxxxxxx
rqt_graph

016

  • gazebo close command
xxxxxxxxxx
killall gzserver gzclient

Appendix

jetson nano

xxxxxxxxxx
joy_data.buttons: header: 
  seq: 335
  stamp: 
    secs: 1628324636
    nsecs: 962988952
  frame_id: "/dev/input/js0"
axes: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

axes(8)

Code ParsingHandle buttons
axes[0]Left rocker (left positive and right negative)
axes[1]Left rocker (up positive and down negative)
axes[2]Right rocker (left positive and right negative)
axes[3]Right rocker (up positive and down negative)
axes[4] 
axes[5] 
axes[6]Left button (left positive and right negative)
axes[7]Left button (up positive and down negative)

buttons(15)

Code ParsingHandle buttons
buttons[0]A
buttons[1]B
buttons[2] 
buttons[3]X
buttons[4]Y
buttons[5] 
buttons[6]L1
buttons[7]R1
buttons[8]L2
buttons[9]R2
buttons[10]SELECT
buttons[11]START
buttons[12] 
buttons[13]Press left rocker
buttons[14]Press right rocker

Raspberry Pi

xxxxxxxxxx
joy_data.buttons: header: 
  seq: 264
  stamp: 
    secs: 1628326479
    nsecs: 848359307
  frame_id: "/dev/input/js0"
axes: [-0.0, -0.0, 0.0, -0.0, -0.0, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

axes(8)

Code ParsingHandle buttons
axes[0]Left rocker (left positive and right negative)
axes[1]Left rocker (up positive and down negative)
axes[2]L2(Press:-1,release:1)
axes[3]Right rocker (left positive and right negative)
axes[4]Right rocker (up positive and down negative)
axes[5]R2(Press:-1,release:1)
axes[6]Left button (left positive and right negative)
axes[7]Left button (up positive and down negative)

buttons(11)

Code ParsingHandle buttons
buttons[0]A
buttons[1]B
buttons[2]X
buttons[3]Y
buttons[4]L1
buttons[5]R1
buttons[6]SELECT
buttons[7]START
buttons[8]MODE
buttons[9]Press left rocker
buttons[10]Press right rocker
Basic course
Environment Construction

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/中文