CN108696513B - Unmanned aerial vehicle control system - Google Patents

Unmanned aerial vehicle control system Download PDF

Info

Publication number
CN108696513B
CN108696513B CN201810389995.3A CN201810389995A CN108696513B CN 108696513 B CN108696513 B CN 108696513B CN 201810389995 A CN201810389995 A CN 201810389995A CN 108696513 B CN108696513 B CN 108696513B
Authority
CN
China
Prior art keywords
aerial vehicle
unmanned aerial
data
flight
socket
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201810389995.3A
Other languages
Chinese (zh)
Other versions
CN108696513A (en
Inventor
兰朝凤
兰袁瑞
冯荣方
罗大钧
张国梁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin University of Science and Technology
Original Assignee
Harbin University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Harbin University of Science and Technology filed Critical Harbin University of Science and Technology
Priority to CN201810389995.3A priority Critical patent/CN108696513B/en
Publication of CN108696513A publication Critical patent/CN108696513A/en
Application granted granted Critical
Publication of CN108696513B publication Critical patent/CN108696513B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C23/00Combined instruments indicating more than one navigational value, e.g. for aircraft; Combined measuring devices for measuring two or more variables of movement, e.g. distance, speed or acceleration
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/10Simultaneous control of position or course in three dimensions
    • G05D1/101Simultaneous control of position or course in three dimensions specially adapted for aircraft
    • G05D1/102Simultaneous control of position or course in three dimensions specially adapted for aircraft specially adapted for vertical take-off of aircraft
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Radar, Positioning & Navigation (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Remote Sensing (AREA)
  • Signal Processing (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Automation & Control Theory (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides an unmanned aerial vehicle control system with low packet loss rate, no delay and no blockage, and belongs to the field of unmanned aerial vehicle communication. The flight data acquisition system is arranged on the ground and comprises a data communication module, a data display module, a task control module and a flight data storage module; the data communication module is used for realizing interaction with the unmanned aerial vehicle by utilizing a socket network under a UDP protocol, and comprises the steps of receiving flight state data of the unmanned aerial vehicle and sending a control command to the unmanned aerial vehicle; the data display module is used for displaying real-time flight state information of the unmanned aerial vehicle according to the received flight state of the unmanned aerial vehicle; the data storage module is used for storing the flight state data of the unmanned aerial vehicle to a database; and the task control module is used for obtaining a control instruction according to the flight state data of the unmanned aerial vehicle and controlling the flight route of the unmanned aerial vehicle. The invention is realized on the basis of UDP protocol, and has good controllability and reliability.

Description

Unmanned aerial vehicle control system
Technical Field
The invention relates to a control system, in particular to an unmanned aerial vehicle control system, and belongs to the field of unmanned aerial vehicle communication.
Background
With the rapid development of economy and society and the continuous promotion of airspace management reform, the low-altitude airspace is gradually opened, the unmanned aerial vehicle can be vigorously developed and widely applied, and can be applied to the fields of electric power, communication, meteorology, agriculture and forestry, oceans, exploration, insurance and the like, and particularly can be used for earth observation, forest fire prevention and extinguishment, disaster detection, communication relay, offshore monitoring, oil and gas pipeline inspection, pesticide spraying, land resource investigation, wild animal monitoring, flood prevention and drought resistance monitoring, fish school detection, film and television aerial photography, drug and public law enforcement, border patrol, security and counter-terrorism and the like. In addition, the interactive communication between the unmanned aerial vehicle and the satellite can be utilized, and the communication between the ground control end and the satellite is utilized, so that the requirements of controlling the unmanned aerial vehicle and receiving the image of the unmanned aerial vehicle are met. However, the relay forwarding is performed by using the satellite, so that the time delay is large and the real-time performance is poor; the satellite frequency band needs to be leased, the use is limited, and common users cannot use the satellite frequency band.
In modern technology, unmanned aerial vehicle's real-time remote control all needs to satisfy the prerequisite of stadia, if needs beyond the horizon remote control and image transmission, needs to use lower frequency channel, for example 300MHz ~ 400MHz frequency channel or lower frequency channel, utilizes diffraction of low-frequency channel to accomplish beyond the horizon transmission of certain degree. However, in this case, the reliability by the low-frequency diffraction is low, and the influence of the environment is large.
However, the existing unmanned aerial vehicle control system has the following defects that on one hand, the positioning accuracy is not high, the hovering reliability is poor, and a great risk exists, on the other hand, signals are easy to lose, so that the signals cannot be controlled, and on the other hand, the signals are easy to enter a no-fly area and collide with obstacles. Therefore, the existing unmanned aerial vehicle control system has the problem of poor reliability of data transmission.
Disclosure of Invention
Aiming at the problem of poor reliability of data transmission of the existing unmanned aerial vehicle control system, the invention provides the unmanned aerial vehicle control system which is low in packet loss rate, free of delay and free of blockage.
The unmanned aerial vehicle control system is arranged on the ground and comprises a data communication module, a data display module, a task control module and a flight data storage module;
the data communication module is used for realizing interaction with the unmanned aerial vehicle by utilizing a socket network under a UDP protocol, and comprises the steps of receiving flight state data of the unmanned aerial vehicle and sending a control command to the unmanned aerial vehicle;
the data display module is used for displaying real-time flight state information of the unmanned aerial vehicle according to the received flight state of the unmanned aerial vehicle;
the data storage module is used for storing the flight state data of the unmanned aerial vehicle to a database;
and the task control module is used for obtaining a control instruction according to the flight state data of the unmanned aerial vehicle and controlling the flight route of the unmanned aerial vehicle.
Preferably, the data communication module communicates with the drone by using a UDP server of a socket network under a UDP protocol, and the communication process includes:
firstly, the unmanned aerial vehicle sends a request instruction to a UDP server;
the UDP server locks the IP address of the unmanned aerial vehicle and sends a control instruction to the unmanned aerial vehicle;
after the unmanned aerial vehicle obtains the control instruction, the unmanned aerial vehicle can directly transmit the control instruction to the designated end of 192.168.1.1 to realize wireless remote control.
Preferably, the process of the UDP server communicating with the drone includes:
the unmanned aerial vehicle establishes a socket by using a function socket () and calls a function sendto () to send a request instruction to a UDP server;
after the UDP server creates a socket by using the function socket (), the function bind () allocates an address to the interface to be used for receiving a data request for the function recvfrom ();
in the UDP server, as the request instruction messages of the unmanned aerial vehicle using the function socket () are too many, the UDP server can generate the phenomena of blocking and the like;
after receiving and processing the request instruction, the UDP server calls a function sendto () to reply a data response of the drone, that is: a control instruction;
after the UDP server completes message processing, the process is closed by using the function Close (), and meanwhile, the unmanned plane also closes the process by using the function Close ().
Preferably, the data display module decodes the attitude angle, the acceleration, the speed, the sonar, the operation amount and the position information of the unmanned aerial vehicle according to a set format and displays the decoded attitude angle, the acceleration, the speed, the sonar, the operation amount and the position information in real time; the pitch angle, the roll angle and the course angle are displayed in a state instrument column and respectively drive each instrument panel, and the instrument panels simulate instrument display of the flight state of the unmanned aerial vehicle; and (5) utilizing a real-time curve to draw changes of a pitch angle, a roll angle and a yaw angle in a set time period.
Preferably, the mission control module controls the flight path of the unmanned aerial vehicle in two modes: a manual control mode and an autonomous flight control mode;
the manual control mode includes:
the task control module is also used for manually inputting target attitude information and throttle amount, comparing the target attitude information with actual attitude information of the unmanned aerial vehicle to obtain target throttle amount of a motor of the unmanned aerial vehicle, and sending the target throttle amount to the unmanned aerial vehicle;
the autonomous flight control mode includes:
the task control module is also used for inputting control information and sending the control information to the unmanned aerial vehicle;
and the unmanned aerial vehicle resolves the control information into target position information, sequentially resolves the target position information into speeds and angular velocities in three coordinate axis directions according to the target position information, obtains a target throttle amount of the unmanned aerial vehicle motor reaching the target position through the three coordinate axis angular velocities, and sends the target throttle amount to the unmanned aerial vehicle.
Preferably, the communication process of the data communication module, the data display module and the task control module includes:
step 1: initializing network connection;
step 2: judging whether the initialization is successful, if so, entering the step 3, otherwise, returning to the step 1;
and step 3: after waiting for the set time, judging whether the data information received from the unmanned aerial vehicle is subjected to data updating, sending the required data information to the data display module according to the updating condition, sending the updated data to the task control module, and turning to the step 4; if the data is not updated, performing data connection on the unmanned aerial vehicle, and updating flight data;
and 4, step 4: if the transmission is successful, returning to the step 3, if the transmission is failed, retransmitting the transmission, and if the transmission fails for 10 times, entering a fault state.
Preferably, in step 3, when data transmission is performed between the data communication module and the data display module and between the data communication module and the task control module, a point-to-point connection is established through a network.
Preferably, the database comprises two tables:
the first table is used for recording flight time, attitude angle, acceleration, angular velocity, sonar, operation amount, position information, flight stage and GPS working mode;
the second table is used to record the planning coordinates, the reference altitude at the planning coordinates, the hover time.
Preferably, the unmanned aerial vehicle control system is realized by a Linux system in a virtual machine.
The features mentioned above can be combined in various suitable ways or replaced by equivalent features as long as the object of the invention is achieved.
The invention has the advantages that the communication between the control system and the unmanned aerial vehicle is realized on the basis of the UDP protocol, the transmission is fast, the packet loss rate is lower than 5 percent, and no delay or blockage is realized. Possess good controllability and reliability, can realize four rotor unmanned aerial vehicle's control.
Drawings
Fig. 1 is a schematic structural diagram of a ground console of a quad-rotor unmanned aerial vehicle system of the present invention;
FIG. 2 is a schematic diagram of the Socket status in the network model according to the embodiment of the present invention;
FIG. 3 is a flowchart of the operation of a TCP client/server program;
fig. 4 is a flowchart of the operation of the UDP server/client program.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The invention is further described with reference to the following drawings and specific examples, which are not intended to be limiting.
The present embodiment is described with reference to fig. 1 to 4, and the present embodiment is a quad-rotor unmanned aerial vehicle system including a ground control station and an unmanned aerial vehicle; the ground control station of the embodiment is used for sending a control command to control the unmanned aerial vehicle; the ground control platform uses a timer to start a new thread to continuously and circularly receive the flight data transmitted by the unmanned aerial vehicle, and responds to the operation of the ground control platform user at any time; the ground control station sends PWM parameter adjustment value and track coordinate control value to unmanned aerial vehicle, controls unmanned aerial vehicle flight route to adjustment unmanned aerial vehicle's flight orbit makes unmanned aerial vehicle carry out effectual avoidance to the barrier.
The ground control station of the embodiment comprises a data communication module, a data display module, a data storage module and a task control module;
the data communication module is used for realizing interaction with the unmanned aerial vehicle by utilizing a socket network under a UDP protocol, and comprises the steps of receiving flight state data of the unmanned aerial vehicle and sending a control command to the unmanned aerial vehicle;
the UDP (User Datagram Protocol) Protocol has a multiplexing and demultiplexing function and an error detection function. Under a Linux operating system, through a UDP/IP communication protocol, interaction and timely communication between the unmanned aerial vehicle and a ground control platform are realized;
the data display module is used for displaying real-time flight state information of the unmanned aerial vehicle according to the received flight state of the unmanned aerial vehicle;
the data display module in the embodiment is used for displaying in real time through the view area and storing in the database in the software background, the data stored in the database can be stored in an MD5 encryption mode, so that the data is not easy to be cracked and read by a third party, the data storage function of the database is more convenient than other storage functions, the data storage and the tables of the database are taken as the main, and the data is stored in each table in a classified manner. The display of the flight state is one of the core functions of the ground control platform, and the display of the flight state is required to have the state monitoring capability of the whole flight process of the unmanned aerial vehicle. The data classification video capability of the unmanned aerial vehicle is also required;
the data display module in the embodiment decodes the attitude angle, the acceleration, the speed, the sonar, the operation amount and the position information of the unmanned aerial vehicle according to a set format and then displays the decoded attitude angle, the acceleration, the speed, the sonar, the operation amount and the position information of the unmanned aerial vehicle in real time, so that the state of the unmanned aerial vehicle can be conveniently observed; the pitch angle, the roll angle and the course angle are displayed in a state instrument column and respectively drive each instrument panel, and the instrument panels simulate instrument display of the flight state of the unmanned aerial vehicle; the change of a pitch angle, a roll angle and a yaw angle in a set time period is drawn by using a real-time curve, so that a developer can detect flight faults through the change curve and judge the overall flight trend of the unmanned aerial vehicle, the developer can adjust the flight track of the unmanned aerial vehicle in real time, and the flight of the unmanned aerial vehicle can be controlled better;
the data storage module is used for storing flight state data of the unmanned aerial vehicle;
in this embodiment, the flight status data is stored in a database, which is mainly divided into two tables:
the first table is used for recording data such as flight time, attitude angle, acceleration, angular velocity, sonar, operation amount, position information, flight phase, GPS working mode and the like;
the second table is used to record data for the planning coordinates, reference altitude at the planning coordinates, hover time, etc.
The combination of the two tables can obtain the flight state data of the unmanned aerial vehicle.
And the database data file takes the starting receiving time as a file name and stores the received valid data packet and the uploaded data packet. By querying the database, previously stored data is obtained, which can be played back and compared and analyzed at the ground station for later data.
The task control module is used for obtaining a control instruction according to the flight state data of the unmanned aerial vehicle and controlling the flight route of the unmanned aerial vehicle;
the control of the unmanned aerial vehicle in the embodiment comprises a manual control mode and an autonomous flight control mode, and the control modes are flexible and various;
if the manual control mode is selected, for example, target attitude information and throttle amount sent by a remote controller are received, actual attitude information of the unmanned aerial vehicle calculated by the task control module is compared with the target attitude information, and target throttle amounts corresponding to four motors of the quad-rotor unmanned aerial vehicle are calculated to control the flight track of the unmanned aerial vehicle.
If the autonomous flight control mode is selected, the unmanned aerial vehicle receives control information of a ground control console, target position information is settled according to an instruction sent by the ground, the position information is sequentially resolved into speeds and angular velocities in three coordinate axis directions, and target throttle amounts of four motors reaching the target position are calculated through the three coordinate axis angular velocities to control the flight track of the unmanned aerial vehicle.
The task control module provides a function of freely switching between two modes, and data is recorded in a database by different data tables during each switching. The data of the two modes are respectively stored in different tables, so that developers can analyze the data. The analysis of the embodiment comprises two aspects of PID automatic parameter setting and navigation planning. PID parameter tuning provides a function of flight control parameter on-line tuning. And uploading information such as PWM values, maximum flight speeds, filter coefficients and the like of the three angles to the unmanned aerial vehicle through a UDP protocol, and controlling the flight of the unmanned aerial vehicle. For the navigation planning function, the preset flight path and the real-time flight path of the unmanned aerial vehicle are displayed together, the difference between the preset flight path and the real-time flight path of the unmanned aerial vehicle can be visually compared, and the accuracy of the flight path control is reflected.
And displaying the two-dimensional flight path of the airplane by taking the real-time longitude and latitude coordinates in the flight simulation of the unmanned aerial vehicle as input and projecting the coordinates onto the flight path diagram control in a certain mode. The longitude and latitude coordinates need to be projected into the track planning chart according to a certain scale.
The data storage module of the embodiment replaces the original text file with the embedded database to perform storage and query operations.
The communication process of the data communication module, the data display module and the task control module in the embodiment comprises the following steps:
step 1: initializing network connection;
step 2: judging whether the initialization is successful, if so, entering the step 3, otherwise, returning to the step 1;
and step 3: after waiting for the set time, judging whether the data information received from the unmanned aerial vehicle is subjected to data updating, sending the required data information to the data display module according to the updating condition, sending the updated data to the task control module, and turning to the step 4; if the data is not updated, performing data connection on the unmanned aerial vehicle, and updating flight data;
and 4, step 4: if the transmission is successful, returning to the step 3, if the transmission is failed, retransmitting the transmission, and if the transmission fails for 10 times, entering a fault state.
In step 3, when data transmission is performed among the data communication module, the data display module and the task control module, point-to-point connection is established through a network.
UDP two-way communication is applied to the unmanned aerial vehicle, the unmanned aerial vehicle serves as a client, and the data communication module of the embodiment serves as a server. However, after the PPP dialing of the 3G module in ar.drone2.0 succeeds, ping goes to the external network and cannot determine the local IP address. Because the IP address changes every time it is restarted, UDP two-way communication is difficult to implement. The solution is that firstly, the unmanned aerial vehicle client sends a request instruction to the server, the server locks the IP address of the client, and then returns a control instruction. After the client obtains the control instruction, the client can directly forward the control instruction to the specified end of 192.168.1.1 to realize wireless remote control.
In this embodiment, the data communication module communicates with the unmanned aerial vehicle by using a UDP server of a socket network under a UDP protocol, and after the client and the server ping each other, the sending end uses a sendto () function and the receiving end uses a recvfrom () function. The method specifically comprises the following steps:
the unmanned aerial vehicle establishes a socket by using a function socket () and calls a function sendto () to send a request instruction to a UDP server;
after the UDP server creates a socket by using the function socket (), the function bind () allocates an address to the interface to be used for receiving a data request for the function recvfrom ();
in the UDP server, as the request instruction messages of the unmanned aerial vehicle using the function socket () are too many, the UDP server can generate the phenomena of blocking and the like;
after receiving and processing the request instruction, the UDP server calls a function sendto () to reply a data response of the drone, that is: a control instruction;
after the UDP server completes message processing, the process is closed by using the function Close (), and meanwhile, the unmanned plane also closes the process by using the function Close ().
Through the communication of the UDP server and the socket of the customer service end, the basic data transmission of the state of the unmanned aerial vehicle can be completed, and the state of the unmanned aerial vehicle can be changed by sending an instruction through the client.
Development of this embodiment:
the embodiment adopts an ubuntu development platform on a Linux operating system, is developed by using C language, is matched with a database to complete various functions, and also supports a plurality of terminal displays. Over 20 years of rapid development, it has become a powerful and stable operating system that provides support for many hardware platforms. In Linux, the GUI consists of several parts, including a windowing system, a window manager, a toolkit, and a style. The window system is used for organizing graphic output on a display screen, the window manager is used for operating windows, such as minimization and the like, the tool kit is a library for programming interfaces, and the style is a user interface of an application program. Other control systems also need to access other hardware facilities for display, and the interview interface and the control interface cannot be perfectly combined together. Linux is a Unix-like operating system. The development language under traditional Unix is the C language. Because C is the most adaptive language of the platform, C is also easier to migrate, and therefore, the optimal language for programming under Linux should be C, and many application programs on Linux are written in C.
A C compiler gcc is provided in a general Linux release version, a C source code can be compiled by using the gcc, the compiled object code has very good quality, and the compiling speed is very high. To ensure portability of the program, gcc does not use a general C function library, but uses a function library called glib. It contains some alternative functions to standard functions (e.g. string handling functions) and implementations of basic data structures (single linked lists, double linked lists, trees, hash tables, etc.). The function contained in the glib eliminates the security hole of some functions, so that the function is more reliable and is more convenient to transplant on different platforms. Many tools can be used to improve the programming efficiency under Linux, for example, gdb is an excellent C language debugger and has very rich debugging instructions; the automake and autoconf are used for configuring compiling options by the source code structure and generating a Makefile required by compiling.
The Linux operating system is a multi-user, multi-task operating system. In operating systems, threads are evolved from processes, the primary objective being to better support multiprocessors and reduce the overhead of context switching. The processes are one-time execution activities of programs on a computer, each process has a respective independent memory space, and communication between the processes needs a special interface mechanism, which increases some form of extra system kernel overhead, thereby reducing performance, and can also operate the memory, which cannot be achieved by other communication modes. The memory is bigger, and is far greater than 51 singlechips. Threads are a powerful means to improve code response and performance. Similar to the process, threads are managed by the system kernel in time slices. The same process W may include multiple threads, which may share memory space. The kernel overhead of the thread is relatively low, and the kernel of the system does not need to independently copy the memory space or the file description of the process, so that a large amount of CPU time is saved, and the use of the thread is 10-100 times faster than that of the process. A large number of threads can be used without worrying about CPU or memory deficiencies. The time for processing data is greatly accelerated. Threads in the same process may share the following: global variables, heap data, open file descriptors, current working directories, user groups. But each thread is independent: thread ID, heap, errao variables, and priority.
The Linux operating system is closely connected with the network, supports various network protocols such as IPv4, IPv6, X125, IPX, NETB IOS, DDP and the like, has the characteristics of stability, simplicity, high efficiency, good compatibility and the like, and is widely applied to the field of network services. The Linux operating platform is used for Socket network programming, and in a Linux system, a Socket interface is a necessary path for an application program to access a lower-layer network protocol. Socket is a programming interface between the application and transport layers that provides a number of system calls and corresponding data structure functions for accessing the underlying communication protocol. Socket's position in the network model is shown in fig. 2, Socket creates a Socket, specifies an address cluster (IP) and a Socket type/transport layer protocol (TCP) to be used, and returns a Socket descriptor, called sockfd () for identifying this Socket in a function call. The function Bind () assigns a local IP to a socket, defining the socket to receive only the client connection, process assignment, destined for the specified local IP, port. The function Linsen () is called only by TCP server. When a socket is created by function socket (), an active socket, that is, a socket that will call function connect () to actively initiate a connection, will be assumed. linsen () converts an unconnected socket to a passive socket, informing the kernel that a connection request directed to the socket should be accepted (passive open). At which time the status of the socket goes from CLOSED to LISTEN.
The kernel maintains two queues for each listening socket: the outstanding connection queue, which receives the client's SYN, is waiting for the TCP three-way handshake to complete. The socket state at this time is SYN _ RCVD. The sockets are in the ESTABLISHED state, having completed the connection queue, and having completed the clients of the TCP three-way handshake. Upon receiving the client's SYN, TCP creates a new entry in the outstanding connection queue while inheriting the parameters of the listening socket and then returns a SYS, ACK, which remains in the outstanding connection queue until the ACK is received or the entry times out. If the three-way handshake completes normally, the entry is moved from the incomplete connection queue to the tail of the completed connection queue. Backlog, i.e., the sum of the two queue lengths, is specified. Accept is only called by TCP server, a completed connection is obtained from the head of queue of completed connection, if the queue of completed connection is empty, the process is suspended to enter sleep state (assuming socket is the default blocking mode) until there is an entry in the queue. The listening socket descriptor is received, and the connected socket descriptor automatically generated by the kernel for the obtained completed connection is returned, along with the corresponding connected socket. The function Connect () is called only by the TCP client, receives the socket descriptor returned by the socket, actively sends a request for establishing a connection to the TCP server (actively opens), and triggers a three-way handshake. The call connect is not necessarily preceded by a call function bind () to bind the local ip and the local port, so that the kernel determines the source ip through the data egress and selects a temporary port as the source port.
Return once in the parent process, return a new child process ID number (pid) to record and track all child processes, return once in the child process, always 0, because each child process has only one parent process and can get the parent ID (ppid) through the function getppid (). All descriptors opened before the parent process calls the function fork () are shared with the child process after the function fork () is executed and returned (the program code and the descriptors are copied). Each file/socket has a reference counter maintained in the file entry that indicates the number of descriptors currently open that reference the file/socket. The function close () simply decrements the count value by one, actually clears the socket and releases the resources, requiring a count value of 0.
Two typical usages of function fork ():
a process wants to execute another function fork (), and a new process is created, running the same program code in memory
exec, replacing the program code with another program code, and creating a copy of the program code by a process, wherein each program code processes each operation simultaneously.
As described in the communications, Socket in Linux means communication over a network, because Socket enables network connection and data exchange between two applications at the user level. In the socket interface of the embodiment, under the Linux operating platform, all I/O operations are generated by reading and writing a file descriptor, where the file descriptor is an integer associated with an open file, the file does not only include a file really stored on a disk, including a network connection, a named pipe, a terminal, and the like, and the socket is a method for communicating a system process and the file descriptor. socket is one end of two-way communication between two programs running on a network, and can send a command request and receive the command request, so that data communication transmission on the network can be conveniently carried out through the socket. Each socket describes one end of a communication connection, communication programs at two ends of a network communication connection respectively have a socket to describe the end of the socket, and two processes in different hosts send and receive messages through respective sockets, so that cross-network communication among the processes is realized. Each socket is represented by a semi-coherent description: protocol, local address, local port; a complete socket is then represented by a relational description: protocol, local address, local port, remote address, remote port, each socket having a local unique socket number assigned by the operating system.
And 058, the Socket also has a function call Socket () similar to the open file, the function returns an integer Socket descriptor, and the subsequent operations of connection establishment, data transmission and the like are realized through the Socket.
Linux socket type, including three types, SOCK _ STREAM (data STREAM socket interface), SOCK _ DGRAM (data STREAM socket interface) and SOCK _ RAW (original socket interface); SOCK _ STREAM (data STREAM socket interface), the most common type of socket, provides a connection-oriented duplex sequential data STREAM transmission and reliable data transmission service. Errors such as data loss, damage or repeated occurrence are avoided, the reliability of data transmission can be ensured, and the condition that the transmitted data flow exceeds the limit can be avoided by flow control. The File Transfer Protocol (FTP) uses a streaming socket transfer service, and the TCP protocol in network transport also supports streaming sockets. SOCK _ DGRAM (datagram socket interface) provides a connectionless and unreliable duplex data transmission service. Data packets are sent and received in the form of independent packets, data may be lost, damaged, or repeatedly received during transmission, and no error-free guarantee cannot be provided for data transmission. The UDP protocol in network transport supports such sockets. SOCK _ RAW (RAW socket), which type of socket allows direct access to lower layer protocols, such as IP or ICMP; the header of the IP, TCP, UDP or ICMP can be directly filled, and the IP packet or ICMP packet defined by the user can be sent. The method is mainly used for developing related protocols.
In the Socket network model in the present embodiment, a client/server (C/S) based network communication model is the most widely used and basic communication model. In such a mode, one of the network programs is called a client (client) and the other is called a server (server). In the Socket network model of this embodiment, the difference between the client and the server (C/S) is: the method comprises the following steps that when a service program is started and initialized, a connection waiting state is entered, and the service program waits for connection all the time; after the client program is started, a connection request is sent to the remote service program, after the service program receives the request, connection is established according to a certain rule, and after the connection is completed, a virtual data communication link is established between the two programs. These programs can read and write data directly from their own open sockets without concern for the actual data link.
TCP/UDP connection service flow:
the Internet provides two types of services to distributed applications: one is connection-oriented services; the second is connectionless service. The connection-oriented service is provided by the TCP protocol, and the client and the server perform a 3-way handshake mechanism before sending data to each other, so as to ensure that the data at the sending end is finally transmitted to the receiving end in sequence without errors. The connectionless service is provided by the UDP protocol, and the sender and receiver have no handshaking mechanism before transmitting data, which causes no delay compared with the TCP.
The work flow of the TCP client/server program is shown in figure 3.
In the connection-oriented service mode, TCP is a connection-based communication protocol that establishes a stable and reliable connection through a network when reliable data transmission is required between two computers. And is point-to-point, and both parties of the communication transmit data through the data connection.
In connectionless mode, the client specifies the remote destination each time a datagram is sent, and does not have a fixed connection for the socket to a specified remote endpoint. Thus, UDP communication has a great flexibility, and the client can decide which server to communicate with before deciding to send. During data transmission, UDP does not maintain the connection state between the transmitting end and the receiving end, i.e. it does not track parameters such as the transmission and reception buffers, the data arrival sequence, and congestion control, so that data packets transmitted by UDP may be erroneous or even lost, and reliability is difficult to guarantee. However, UDP has its own advantages over TCP:
compared with TCP, the method has no time delay for connectionless data transmission and has much higher transmission speed;
secondly, the data segment structure is compared to find that the data packet head cost of the UDP is much smaller than that of the TCP;
UDP does not track a plurality of parameters between the sending end and the receiving end, so that the UDP has the capability of supporting more clients in an active state and has stronger flexibility;
because of no congestion control mechanism, the speed of sending data by the UDP is limited only by the speed of generating data by the application program, the performance of the source end (CPU, clock speed, etc.), and the bandwidth that can be achieved by the physical device.
Therefore, UDP is still widely used in the fields of DNS resolution, real-time video conferencing, IP telephony, storable audio video streams, and the like.
Fig. 4 shows the workflow of the UDP server/client program.
The client needs only two steps (socket and sendto) to initiate a request, and the server needs only three steps to receive the message from the client (socket, bind, revfrom).
The specific composition of the function to be obtained in this embodiment is:
sendto () is adapted to send UDP packets (parameter SOCK _ DGRAM) for which no connection is established. sendto (int sockfd, const void buf, size _ tlen, int flags, const struct sockaddr × dest _ addr, socklen _ tdrlen);
wherein, the first parameter sockfd is the socket file descriptor of the monitoring port, and is obtained through socket;
the second parameter buf: a transmit buffer, often a user-defined array, which holds the data to be transmitted;
the third parameter len is the size of the send buffer in bytes;
filling 0 in the fourth parameter flags;
a fifth parameter dest _ addr, which is a structure of host address information pointing to the received data, i.e., the parameter specifies to which host and which process the data is to be sent;
a sixth parameter addrlen representing the length of the content pointed to by the fifth parameter;
return value of function sendto (): the success is as follows: returning the data length of successful sending; failure: -1;
functions recvfrom (int sockfd, void × buf, size _ tlen, int flags, struct sockaddr × src _ addr, socklen _ t × addrlen);
wherein, the first parameter sockfd is the socket file descriptor of the monitoring port, and is obtained through socket;
the second parameter buf: a receive buffer, often a user-defined array, which holds the received data;
the third parameter len is the size of the receiving buffer in bytes;
filling 0 in the fourth parameter flags;
a fifth parameter src _ addr, which is a structure that points to host address information of the sending data, that is, from the parameter, who sends the data can be obtained;
a sixth parameter addrlen representing the length of the content pointed to by the fifth parameter;
return value of function recvffrom (): the success is as follows: returning the data length successfully received; failure: -1;
function bind (int sockfd, const struct sockaddr my _ addr, socklen _ t addrlen);
wherein, the first parameter sockfd is the socket file descriptor of the monitoring port, and is obtained through socket;
a second parameter my _ addr, which is the IP and the port needing to be bound;
the third parameter addrlen: size of the structure of my _ addr;
return value of function bind (): the success is as follows: 0; failure: -1;
the function Close () (int fd), Close function is Close function, as long as the fd generated by socket is filled.
The ground console of the embodiment is different from other control systems, and most of the other systems are loaded in the Windows system, so that the operation is inconvenient, the memory consumption is high, and conflicts can be caused with other software. In Ubuntu of the Linux system loaded in the virtual machine, two systems can exist in the same computer at the same time, Linux is loaded in the virtual machine, the memory is virtually independent, the memory occupied by the computer is small, and the operation interface is different from Windows. The phenomena of blocking and the like can not be caused when other software runs on the computer.
According to the embodiment, through UDP communication, the UDP protocol provides reliable network guarantee for UDP stability by virtue of the advantages of simplicity and quick transmission. The packet loss rate of UDP transmission data is lower than 5%, and the data transmission method has no delay and no blockage. This is not achievable by other network protocols. The data of the embodiment is independently stored in the Linux memory, and developers cannot cause operation errors such as data loss or missing. The disadvantage is that the data stored in the database running in Linux cannot be retrieved if deleted, which is a drawback that Linux has not yet solved.
Although the invention herein has been described with reference to particular embodiments, it is to be understood that these embodiments are merely illustrative of the principles and applications of the present invention. It is therefore to be understood that numerous modifications may be made to the illustrative embodiments and that other arrangements may be devised without departing from the spirit and scope of the present invention as defined by the appended claims. It should be understood that features described in different dependent claims and herein may be combined in ways different from those described in the original claims. It is also to be understood that features described in connection with individual embodiments may be used in other described embodiments.

Claims (8)

1. The unmanned aerial vehicle control system is arranged on the ground and comprises a data communication module, a data display module, a task control module and a flight data storage module;
the data communication module is used for realizing interaction with the unmanned aerial vehicle by utilizing a socket network under a UDP protocol, and comprises the steps of receiving flight state data of the unmanned aerial vehicle and sending a control command to the unmanned aerial vehicle;
the data display module is used for displaying real-time flight state information of the unmanned aerial vehicle according to the received flight state of the unmanned aerial vehicle;
the data storage module is used for storing the flight state data of the unmanned aerial vehicle to a database;
the task control module is used for obtaining a control instruction according to the flight state data of the unmanned aerial vehicle and controlling the flight route of the unmanned aerial vehicle;
the data communication module is characterized in that the data communication module communicates with the unmanned aerial vehicle by using a UDP server of a socket network under a UDP protocol, and the communication process comprises the following steps:
firstly, the unmanned aerial vehicle sends a request instruction to a UDP server;
the UDP server locks the IP address of the unmanned aerial vehicle and sends a control instruction to the unmanned aerial vehicle;
after the unmanned aerial vehicle obtains the control instruction, the unmanned aerial vehicle can directly transmit the control instruction to the designated end of 192.168.1.1 to realize wireless remote control.
2. The drone control system of claim 1, wherein the process of the UDP server communicating with the drone includes:
the unmanned aerial vehicle establishes a socket by using a function socket () and calls a function sendto () to send a request instruction to a UDP server;
after the UDP server creates a socket by using the function socket (), the function bind () allocates an address to the interface to be used for receiving a data request for the function recvfrom ();
in the UDP server, as the request instruction messages of the unmanned aerial vehicle using the function socket () are too many, the UDP server can generate the phenomena of blocking and the like;
after receiving and processing the request instruction, the UDP server calls a function sendto () to reply a data response of the drone, that is: a control instruction;
after the UDP server completes message processing, the process is closed by using the function Close (), and meanwhile, the unmanned plane also closes the process by using the function Close ().
3. The drone control system of claim 2,
the data display module decodes the attitude angle, the acceleration, the speed, the sonar, the operation amount and the position information of the unmanned aerial vehicle according to a set format and displays the decoded attitude angle, the acceleration, the speed, the sonar, the operation amount and the position information in real time; the pitch angle, the roll angle and the course angle are displayed in a state instrument column and respectively drive each instrument panel, and the instrument panels simulate instrument display of the flight state of the unmanned aerial vehicle; and (5) utilizing a real-time curve to draw changes of a pitch angle, a roll angle and a yaw angle in a set time period.
4. The drone controlling system of claim 3, wherein the mission control module controls the drone flight path in two modes: a manual control mode and an autonomous flight control mode;
the manual control mode includes:
the task control module is also used for manually inputting target attitude information and throttle amount, comparing the target attitude information with actual attitude information of the unmanned aerial vehicle to obtain target throttle amount of a motor of the unmanned aerial vehicle, and sending the target throttle amount to the unmanned aerial vehicle;
the autonomous flight control mode includes:
the task control module is also used for inputting control information and sending the control information to the unmanned aerial vehicle;
and the unmanned aerial vehicle resolves the control information into target position information, sequentially resolves the target position information into speeds and angular velocities in three coordinate axis directions according to the target position information, obtains a target throttle amount of the unmanned aerial vehicle motor reaching the target position through the three coordinate axis angular velocities, and sends the target throttle amount to the unmanned aerial vehicle.
5. The drone control system of claim 4, wherein the communication process of the data communication module with the data display module and the task control module includes:
step 1: initializing network connection;
step 2: judging whether the initialization is successful, if so, entering the step 3, otherwise, returning to the step 1;
and step 3: after waiting for the set time, judging whether the data information received from the unmanned aerial vehicle is subjected to data updating, sending the required data information to the data display module according to the updating condition, sending the updated data to the task control module, and turning to the step 4; if the data is not updated, performing data connection on the unmanned aerial vehicle, and updating flight data;
and 4, step 4: if the transmission is successful, returning to the step 3, if the transmission is failed, retransmitting the transmission, and if the transmission fails for 10 times, entering a fault state.
6. The drone control system of claim 5, wherein in step 3, the data communication module establishes a point-to-point connection with the data display module and the task control module via a network during data transmission.
7. The drone control system of claim 6, wherein the database includes two tables:
the first table is used for recording flight time, attitude angle, acceleration, angular velocity, sonar, operation amount, position information, flight stage and GPS working mode;
the second table is used to record the planning coordinates, the reference altitude at the planning coordinates, the hover time.
8. The drone control system of claim 6, wherein the drone control system is implemented by a Linux system in a virtual machine.
CN201810389995.3A 2018-04-27 2018-04-27 Unmanned aerial vehicle control system Expired - Fee Related CN108696513B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810389995.3A CN108696513B (en) 2018-04-27 2018-04-27 Unmanned aerial vehicle control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810389995.3A CN108696513B (en) 2018-04-27 2018-04-27 Unmanned aerial vehicle control system

Publications (2)

Publication Number Publication Date
CN108696513A CN108696513A (en) 2018-10-23
CN108696513B true CN108696513B (en) 2020-11-17

Family

ID=63845136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810389995.3A Expired - Fee Related CN108696513B (en) 2018-04-27 2018-04-27 Unmanned aerial vehicle control system

Country Status (1)

Country Link
CN (1) CN108696513B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109283854A (en) * 2018-10-29 2019-01-29 成都飞机工业(集团)有限责任公司 A kind of portable analogue system of unmanned plane
CN109841092A (en) * 2019-01-28 2019-06-04 西安爱生技术集团公司 A kind of unmanned aerial vehicle command and control system
CN110209846A (en) * 2019-04-25 2019-09-06 深圳大学 Data set construction method, device and terminal device based on unmanned plane instruction sequence
CN110398985B (en) * 2019-08-14 2022-11-11 北京信成未来科技有限公司 Distributed self-adaptive unmanned aerial vehicle measurement and control system and method
CN111047945A (en) * 2020-01-15 2020-04-21 中仿智能科技(上海)股份有限公司 Flight training evaluation system of simulation aircraft
CN111667678B (en) * 2020-05-11 2022-01-18 深圳蚁石科技有限公司 Remote controller and airplane short-distance code matching method
TWI742751B (en) * 2020-07-07 2021-10-11 國立陽明交通大學 Drone flight training system and method
CN112148431A (en) * 2020-09-30 2020-12-29 中航(成都)无人机系统股份有限公司 Unmanned aerial vehicle system resource virtualization method, device, equipment and readable storage medium
CN113158116A (en) * 2021-04-20 2021-07-23 联通(广东)产业互联网有限公司 Unmanned aerial vehicle control platform based on mobile internet

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002073129A1 (en) * 2001-03-13 2002-09-19 Tacshot, Inc. Panoramic aerial imaging device
CN101738608A (en) * 2009-12-11 2010-06-16 北京航空航天大学 Telemetry information comprehensive treatment system of unmanned plane and compressive treatment display method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002073129A1 (en) * 2001-03-13 2002-09-19 Tacshot, Inc. Panoramic aerial imaging device
CN101738608A (en) * 2009-12-11 2010-06-16 北京航空航天大学 Telemetry information comprehensive treatment system of unmanned plane and compressive treatment display method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于Linux的无人机地面站设计与实现";徐雷;《中国优秀硕士学位论文全文数据库》;20110315;第24-40页 *

Also Published As

Publication number Publication date
CN108696513A (en) 2018-10-23

Similar Documents

Publication Publication Date Title
CN108696513B (en) Unmanned aerial vehicle control system
Zhou et al. REST API design patterns for SDN northbound API
JP4564697B2 (en) Method and apparatus for activity-based collaboration by a computer system with a communication manager
Park et al. CAVERNsoft G2: a toolkit for high performance tele-immersive collaboration
US7469183B2 (en) Navigating UAVs in formation
US7289509B2 (en) Apparatus and method of splitting a data stream over multiple transport control protocol/internet protocol (TCP/IP) connections
US7467078B2 (en) Portable distributed application framework
US20060248145A1 (en) System and method for providing various levels of reliable messaging between a client and a server
US20060179433A1 (en) Systems and methods for remotely adminstering a target device
CN112689828A (en) Placing container workloads triggered by network traffic for efficient computation at network edge devices
US20050122977A1 (en) Efficient download mechanism for devices with limited local storage
US20120030687A1 (en) Efficient data transfer on local network connections using a pseudo socket layer
US20120185582A1 (en) System and Method For Collecting and Evaluating statistics To Establish Network Connections
Kessler et al. A network communication protocol for distributed virtual environment systems
US7751398B1 (en) Techniques for prioritization of messaging traffic
CN111712799A (en) Automatic distribution of models for execution on non-edge devices and edge devices
Dey et al. A Novel ROS2 QoS Policy-Enabled Synchronizing Middleware for Co-Simulation of Heterogeneous Multi-Robot Systems
US20170214727A1 (en) Using multicasting to concurrently image multiple client devices
CN105827468B (en) Network performance method for real-time monitoring
Riley Using the georgia tech network simulator
CN110083945B (en) Distributed multi-node simulation management method
JP2003030081A (en) System and method for transferring file
US20140258484A1 (en) Transparent message modification for diagnostics or testing
Corpas Rodríguez Publish/Subscribe data communication in Cyber-Physical Systems oriented to Unmanned Aerial Vehicle
Gameiro A distributed delay tolerant data transfer protocol for ISTSAT-1

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201117

Termination date: 20210427