Design of Robot Teleoperation Network Communication Platform
2026-04-06 05:43:20··#1
Abstract: To solve the communication problem in robot teleoperation, this paper designs a network communication platform that enables remote clients and local servers to send and receive information. This platform is based on the TCP/IP protocol and is written in VC++ 6.0 using Windows Sockets. Unlike the command-line output of previous TCP communication methods, this network communication platform implements a user interface. Experimental results show that this network communication platform can accurately and conveniently realize real-time file sending and receiving and mutual communication between the server and client, meeting the communication tasks of robot teleoperation. Keywords: TCP communication; Remote Client; Socket; Teleoperation [b][align=center]The Design of Robot Network Communication Platform Pan Bin, Jiang Zhijian, Zhang Lei, Wang Chengcheng[/align][/b] Abstract: To solve the communication problem of robot teleoperation, a new kind of network communication platform that realizes the mutual receiving and sending of messages between the remote client and the local server is presented in this paper. The platform is discussed using Windows Sockets based on the TCP/IP protocol in VC++6.0. It achieves an interface output different from the command-line output of the former TCP correspondence. The experimental results show that the platform realizes the sending and receiving of messages and documents in real time between the local server and the remote client. Therefore, the platform can better meet the communication needs for robot teleoperation. Key words: TCP communication; Remote Client; Socket; Teleoperation Currently, robot teleoperation systems have become a hot topic in robot research. In the process of robot teleoperation, the network communication problem between the local server and the remote client is a key link in teleoperation. To address the communication problem in robot teleoperation, this paper designs a network communication platform based on the TCP/IP protocol, implemented using Socket in the Windows XP environment. 1 Socket Programming Principles 1.1 Introduction to Socket Socket was originally developed by the University of California, Berkeley for the UNIX operating system as a network communication interface. Later, network vendors such as Intel, Microsoft, and Sun ported it to Windows, forming the Windows Sockets specification, which defines a set of interfaces for network programming in the Windows environment. The hierarchical structure of a network communication program developed using Windows Sockets is shown in Figure 1. [align=center] Figure 1 Structure of Sockets Programming[/align] Based on the different data types transmitted, Sockets can be divided into two categories: stream sockets (SOCK_STREAM) and datagram sockets (SOCK_DGRAM). Stream sockets provide connection-oriented, reliable data transmission services, ensuring error-free and non-duplicated data transmission, and receiving data in the order it was sent. Stream sockets are actually implemented based on the TCP protocol. Datagram sockets provide connectionless services. Datagrams are sent as independent packets, without error-free guarantees; data may be lost or duplicated, and the order of reception may be disordered. Datagram sockets are actually implemented based on the UDP protocol. According to their function in the client/server model, sockets can be divided into two categories: Listening sockets: These sockets reside on the server side. Their main function is to continuously listen on a specific port. When a connection request is detected, the request is accepted, and a new client socket is constructed to establish a connection with the requesting client socket, thus preparing for communication between the two parties. Client sockets: These sockets are the entities used for network communication. They reside on both the client and server sides. The server must maintain an equal number of such sockets as the number of clients it serves, forming a star topology centered on the server. 1.2 TCP Network Communication Platform Design Steps Internet-based robot teleoperation technology is a combination of modern network technology and robot control technology. The Internet uses the Internet Packet Switching Protocol (TCP/IP) as its communication standard, which includes protocols such as TCP, UDP, and ICMP. TCP is a connection-oriented protocol that requires a connection to be established with the communicating party before data exchange. It has segmentation and reassembly functions to ensure reliable and orderly data transmission. The entire TCP communication process can be divided into three stages: connection establishment, data transmission, and connection teardown. (1) Connection establishment stage: First, the listening socket in the server listens for the breakpoint, and the client's socket submits a connection request to the specific breakpoint on the server side. (2) Communication stage: This is the core part of the whole process, and its task is to be responsible for sending and receiving data. (3) Connection teardown stage: After the data is transmitted, the socket is closed and the allocated resources are released. The main steps for writing a TCP communication program using Socket are as follows: 1) Construct a Socket object; 2) Use the object to construct a basic Socket handle. Because teleoperation requires reliable and accurate data communication, the TCP protocol is adopted, and stream sockets are used; 3) Establish a client CSocket and call Connect() to establish a connection with the server socket. The server calls Listen() to listen for connection requests and accepts the client connection by calling Accept() after receiving a client request. 4) Construct a CSocketFile object and associate it with a CSocket object. 5) Construct a CArchive object for receiving and sending data. Use the CArchive object for socket communication between the client and the server. 6) When communication ends, close the socket and exit the program. 2 Implementation of TCP Network Communication Platform Program This program is a network communication platform built for robot teleoperation communication. This platform realizes data network communication between the local server and the remote client. The system structure diagram is shown in Figure 2. [align=center] Figure 2 Teleoperation System Structure Diagram[/align] The program design in this paper is based on the TCP/IP protocol and uses a client/server model. The network environment for this program design and debugging is a local area network configured using the TCP/IP protocol in Windows XP. The server's IP address is "192.168.0.104", and the communication port can be set arbitrarily; in this paper, it is set to 4231. 2.1 Implementation Flow of the Communication Platform Program The server is the main control console for the robot. Through the server, the robot's crawling, detection, and turning can be controlled. In this paper, the server-side program mainly establishes a port that allows clients to connect, listens for connections, establishes connections with clients that need to connect, and communicates data information with them. It sends the robot's status information acquired by the robot's sensors to the client to achieve remote signal processing, and receives control information from the client to control the robot. The client-side is the computer that remotely controls the robot. After requesting a connection with the server, it transmits control information to the server, and the server controls the robot based on the control information. Furthermore, the client-side can also receive robot status information transmitted from the server to process the information acquired by the robot. In this paper, the client-side program establishes a connection with the server through Connect() to achieve mutual communication. The flowchart of the network communication platform implementation is shown in Figure 3. The server-side program is the core part of the communication platform. The server-side program in this paper can not only realize one-to-one communication with a remote client, but also communicate with multiple clients simultaneously. The client-side program is simpler than the server-side program. It does not have the listener and connection accepter of the server-side program, but it has a connection program added. The connection program and the listener are the distinguishing features between the server-side program and the client-side program. [align=center] Figure 3 Communication Platform Flowchart[/align] (1) Listener (Listen()) (Listen program) is the most important feature that distinguishes the server program from the client-side program. The server listens for client requests to connect through the listener program. When a client makes a connection request, the listener program sends the connection request to the server to establish a connection between the two, and the server and the client can communicate. The listener program is also the distinguishing feature of using stream sockets or datagram sockets. The existence of the listener program provides a reliable and error-free connection for network communication. (2) Connect() (Connect program) (Connect program) is a program unique to the client and is written to send connection requests to the server. After receiving a request from the client to connect to the server, the connection program will send the IP address and port of the server to be connected. After sending, it will wait for the feedback message of the connection message to confirm whether the client has successfully connected. (3) The Accept() program is written on the client side in response to the client connection program. This program can provide feedback to the connection program. When the program receives a connection request from the client program, it will send a message back to the client indicating whether the connection was successful. Moreover, this program can obtain the IP address and port of the client requesting the connection so that the server can record the connection status information of the client. (4) The Send() program can send control information from the remote operator to the server in real time, and the robot's status information is obtained by various sensors (such as vision sensors, force sensors, etc.) and then fed back to the remote client by the server. (5) The Receive() program can receive data messages sent by the other party from the client or the server. This program is consistent in both the server and the client, and together with the Receive() program, it realizes data message communication between the client and the server. 2.2 Experimental Results The interface output image of the network communication platform after it runs is shown in Figure 4. Figure 4(a) shows the interface after the server runs. The server is the core of the program. All client data will be transmitted to the server, and communication between clients needs to be relayed through the server. The server in the program designed in this paper can not only send information to all clients connected to the server in the form of broadcast, but also communicate with a single client in a one-to-one communication manner. Figure 4(a) shows the server communicating using these two methods respectively. Clicking the send button in the interface sends information in the broadcast manner, while clicking the 1 and 2 buttons in the interface sends data to a specific client. The program designed in this paper can support multiple different [align=center] (a) (b) (c)[/align] communication platform running interface The client and server connect and communicate. Figure 4(b) shows the communication between the client and server after establishing a connection with IP address "192.168.0.106", while Figure 4(c) shows the communication interface between the client and server with IP address "192.168.0.110". 3. Experimental Performance Analysis 1. Latency and Data Loss Issues Robot teleoperation requires reliable and ordered data transmission. The TCP protocol provides reliable and ordered transmission. Based on this characteristic, error detection and correction strategies such as timeout retransmission, segmentation, and reassembly can be used during transmission. These error detection and correction strategies can ensure the reliability and orderliness of data transmission and effectively prevent data loss. The adoption of remote teleoperation control of robots does not mean that real-time control is moved to the network. Real-time control is still performed by the control unit on site. Network teleoperation focuses more on monitoring and managing on-site information and non-real-time control of the robot. Therefore, the latency issue in TCP communication during transmission has little impact. 2. Data Sharing Problems and Solutions Since the program in this paper is multi-tasking and multi-threaded, when multiple clients connect to the server simultaneously, multi-tasking and multi-threading can easily cause data sharing problems. The data sharing problem can be explained as follows: Suppose multiple functions (or ISRs, tasks) share a variable. If at some point there is an operation on the value of this variable, and during the operation, only part of the operation is completed while the other part is not, if an interrupt occurs at this time, and if another function is also sharing the variable at this time, and the previous operation has been completed, the value of the variable may be different from the expected value. Therefore, when one function shares a variable with another function, the called ISR or another function may change this variable, causing its value to change. Upon return, the new value of this variable will be loaded from the stack into four registers. Unfinished operations will be executed according to the new value in the registers, and the program will encounter an error. In this paper, the following measures are used to eliminate errors caused by shared data problems in the program: 1) For variables returning from an interrupt, the declaration uses `volatile`. This declaration warns the compiler that these variables are mutable. 2) Reproducible functions are used for atomic instructions in the section that will be fully executed before interruption; this section is called the critical section. 3) Shared variables are placed in a circular queue. Functions that need to use the value of a variable are always removed from the front of the queue. Other functions that write the value of the variable are always operated on from the back of the queue. 4) Interrupts are disabled using semaphores before the critical section begins execution and enabled when it completes. 4. Conclusion This paper designs a network communication platform based on the TCP protocol. This platform enables information communication between remote clients and local servers, ensuring the reliability and order of data transmission, and providing reliable network communication conditions for robot teleoperation. The establishment of this network communication platform expands the remote operation distance of robots, and the platform has advantages such as easy architecture, low cost, and convenient maintenance, which will contribute to the technological advancement of robot teleoperation. References [1] Brady K, Tzyh-Jong. Internet-based remote teleoperation [A]. In International Conference on Robotics and Automation [C]. Leuven Belgium, 1998, 65. [2] Chen Ning, Wang Qingpeng, Tan Dalong. Design and implementation of Internet-based robot teleoperation experimental platform [J]. Robot. 2000, 22(7): 211-214. [3] Guo Jianguang, Fu Xiuhui. Experimental study on network robot teleoperation [J]. Journal of Instrumentation. 2005, 25(8): 477-478. [4] Fu Zhongjian. Network communication program design based on MFC [J]. Journal of Changsha Electric Power University, Hunan. 1999, 14(4): 325-327.