remote control robot
In this section, we will use two common ways to introduce two methods to remote control the robot
- Remote control robot via computer keyboard
- Control the robot via PS3 Gamepad
1 Ready to start
- If you want to use the ps3 game controller, you need to install batteries for it, and plug the receiver inside into the industrial computer. When in use, turn on the switch on the back of the gamepad, then press the button above MODE on the front to light up the LED light below.
2 Remotely control the robot through the computer keyboard
2.1 Concise steps
You only need to open two terminals on the industrial computer and enter the following two commands respectively
roslaunch handsfree_hw handsfree_hw.launch
roslaunch handsfree_teleop keyboard_teleop.launch
2.2 Keyboard remote control robot with industrial computer package
Open the terminal (Ctrl+Alt+T) and open the robot driver node
roslaunch handsfree_hw handsfree_hw.launch
Normally, it will display:
Open the second terminal (Ctrl+Alt+T or Ctrl+Shift+T), open the keyboard control node
roslaunch handsfree_teleop keyboard_teleop.launch
Normally, it will display:
According to the English prompt of the terminal, control the movement of the robot through the nine keys
u i o j k l m , .
on the keyboard, and control the moving speed of the robot throughq/z, w/x, e/c
. The space bar and k are used to Forced parking, other buttons are used for smooth parking.At this point, the robot in your hand can move through the keyboard. If your keyboard is a wireless keyboard, then you can unplug the monitor and let your robot run through the keyboard.
2.3 Keyboard remote control basic version robot
After installing the corresponding ubuntu system and configuring the relevant environment, you only need to connect the usb interface of the robot to your computer and then start to try to control the robot remotely.
If you are trying through a virtual machine, you need to pay attention to the connection configuration of the usb port, otherwise there will be a prompt that the robot cannot be found
FTDI FT232R USB UART [0600] is the name of the usb device of the mini robot. Make sure that this device is selected on the virtual machine.
Open the terminal and open the robot driver node
roslaunch handsfree_hw handsfree_hw.launch
Normally, it will display:
Open the second terminal and open the keyboard control node
roslaunch handsfree_teleop keyboard_teleop.launch
Normally, it will display:
3 Remotely control the robot through the PS3 gamepad
3.1 Concise steps
You only need to open two terminals on the industrial computer and enter the following two commands respectively
roslaunch handsfree_hw handsfree_hw.launch
roslaunch handsfree_teleop ps3_teleop.launch
Tips: Press the left joystick vertically, then shake the joystick, the robot will move. The greater the shaking, the faster the robot will be, so be careful shaking the joystick.
3.2 PS3 remote control robot with industrial computer package
Let's take Laishida Sword God TE wireless game controller as an example to explain how to control the robot through the PS3 game controller.
Open the terminal and enter the following command
ls /dev/input/
Insert the receiver of the gamepad into the usb interface of the robot industrial computer, and enter the command again in the previously opened terminal
ls /dev/input/
Under normal circumstances, only one js0 will appear
If you find that the receiver recognized by the computer is not js0, but jsX (X refers to other numbers), such as the picture below
At the beginning, when the receiver is not plugged in, there are js0 and js1, and when the receiver is plugged in, js2 appears
Make sure the battery of the handle is installed, turn on the switch of the game handle, and the LED indicator light is on. Open a terminal and type
sudo jstest /dev/input/js0
tips: If yours is jsX (X refers to other numbers), please replace js0 with jsX
Normally, there will be
Now you can use your controller and see if the terminal is printing data.
Open the terminal (Ctrl+Alt+T), enter the following command
roslaunch handsfree_hw handsfree_hw.launch
Normally, it will display:
Re-open a terminal (Ctrl+Alt+T or Ctrl+Shift+T), enter the following command
roslaunch handsfree_teleop ps3_teleop.launch
Normally, it will display:
If such an error occurs, and the receiver detected by your computer is js0, you can try step 6 to see if the robot can move.
If the receiver detected by your computer is jsX (X refers to other numbers), you need to modify our ps3_teleop.launch file, open a new terminal, and enter the following command
gedit ~/handsfree/handsfree_ros_ws/src/handsfree/handsfree_hw/launch/ps3_teleop.launch
You can also open it in this directory. After opening, you need to perform steps 3 and 4 in the figure. Remember to change
js2
to the jsX of your computer's identification receiver (X refers to other numbers)Save the modified file, then use Ctrl+C to stop the process of
roslaunch handsfree_teleop ps3_teleop.launch
, and run it again in the terminalroslaunch handsfree_teleop ps3_teleop.launch
Although ERROR will still appear, the robot can be remotely controlled through step 6.
Press the left joystick vertically, then shake the joystick, your robot will move.
Tips: Press the left joystick vertically, then shake the joystick, the robot will move. The greater the shaking, the faster the robot will be, so be careful shaking the joystick.
3.3 PS3 remote control basic version robot
After installing the corresponding ubuntu system and configuring the relevant environment, you only need to connect the usb interface of the robot to your computer and then start to try to control the robot remotely.
If you are trying through a virtual machine, you need to pay attention to the connection configuration of the robot's usb port and the connection configuration of the ps3 game controller's usb port, otherwise there will be a prompt that the robot cannot be found and the controller cannot be found.
Open the terminal and enter the following command
ls /dev/input/
Plug the receiver of the gamepad into the usb interface of the robot industrial computer, and enter this command again in the previously opened terminal
ls /dev/input/
Under normal circumstances, only one js0 will appear
If you find that the receiver recognized by the computer is not js0, but jsX (X refers to other numbers), such as the picture below
At the beginning, when the receiver is not plugged in, there are js0 and js1, and when the receiver is plugged in, js2 appears
Make sure the battery of the handle is installed, turn on the switch of the game handle, and the LED indicator light is on. Open a terminal and type
sudo jstest /dev/input/js0
tips: If yours is jsX (X refers to other numbers), please replace js0 with jsX
Normally, there will be
Now you can use your controller and see if the terminal is printing data.
Open the terminal and enter the following command
roslaunch handsfree_hw handsfree_hw.launch
Normally, it will display:
Open a new terminal and enter the following command
roslaunch handsfree_teleop ps3_teleop.launch
Normally, it will display:
If such an error occurs, and the receiver detected by your computer is js0, please try step 8 to see if the robot can move.
If the receiver detected by your computer is jsX (X refers to other numbers), you need to modify our ps3_teleop.launch file
You can find this file by searching, or go to the relevant directory to find this file. When you open the launch file, you need to right-click the mouse and select gedit in the opening method.
After opening, you need to perform steps 3 and 4 in the figure. Remember to change
js2
to jsX for your computer to identify the receiver (X refers to other numbers)Then use Ctrl+C to stop the process of
roslaunch handsfree_teleop ps3_teleop.launch
, and run it again in the terminalroslaunch handsfree_teleop ps3_teleop.launch
Although ERROR will still appear, the robot can be remotely controlled by step 8
Press the left joystick vertically, then shake the joystick, your robot will It will move.
Tips: Press the left joystick vertically, then shake the joystick, the robot will move. The greater the shaking, the faster the robot will be, so be careful shaking the joystick.