Handle ROS1 course

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

2、Install the driver

3、Usage steps

Connect the USB end of the wireless controller to the device

010

011

If jstest is not installed, run the following command:

012

4、Handle control Little Turtle

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

Start Python code command

Start C++code command

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

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

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

Start Python code command

Start C++code command

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

016

Appendix

jetson nano

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

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