Teleoperation of your robot
Teleoperation refers to the use of a remote computer to control the robot for debugging and development,which will make the operation of the robot much more easy.
Environment configuration for remote computers
The system version and ROS version of the remote computer must be the same as the IPC on the robot, otherwise there will be communication problems caused by the inconsistent versions.
Use SSH to connect to remote computer
Turn on the robot's IPC and the user's remote computer Follow the steps:
- 1 Make the IPC and the user computer in the same LAN (that is, connected to the same router, try not to use the cell phone hotspot).
- 2 Obtain the IP of the IPC.
- 3 Login to the IPC in the terminal of the user computer, the command @ symbol followed by the IP address of the IPC.
> ssh -X handsfree@192.186.x.x
- 4 On the IPC side, use the same method to log in to the user computer:
> ssh -X user_name@192.186.y.y
If you do not encounter any errors during this process,the communication between the IPC and PC is successful and we can move to the next step
Teleoperation Settings
In the previous step, we have allowed the IPC and PC to access each other over the LAN, so now we just need to do the following settings to run the ROS program on the IPC and PC separately.
We first launch the remote control node on the remote computer and launch the robot abstraction node on the IPC at the robot side and then we can use the remote computer to remotely control the robot
Tips : IP_OF_ROBOT_PC is the IP of the IPC,IP_OF_REMOTE_PC is the IP of the remote computer.
- Add the following two lines of code to the ~/.bashrc file on the remote computer:
export ROS_MASTER_URI=http://IP_OF_ROBOT_PC:11311
export ROS_HOSTNAME=IP_OF_REMOTE_PC
- Add the following two lines of code to the ~/.bashrc file on the robot side of the IPC:
export ROS_MASTER_URI=http://IP_OF_ROBOT_PC:11311
export ROS_HOSTNAME=IP_OF_ROBOT_PC
Teleoperation of your robot
Launch the robot drive node:
Open a terminal on the robot-side IPC and run the following command:> roslaunch handsfree_hw handsfree_hw.launch
This command launches the robot driver node, which is responsible for the communication and data transfer between the PC and the robot's underlying device.
Launch the remote node
Open a terminal on the remote computer and run the following command:
> roslaunch handsfree_teleop keyboard_teleop.launch
This command will launche the keyboard control node, and then we can use the keyboard to control the robot movement. If you do not encounter any errors during this process,it means that our communication connection is correct and we can see the ROS information from the robot's IPC on the remote computer, and control the robot from the remote computer.
Further Introduction
If you just want to teleoperate your robot, then you just need to connect the communication between the two PCs using ssh tools. All the topics can be operated on both PCs at the same time. Generally, we can run rviz, rqt and other ros tools on the remote PC and run the algorithm on the IPC.