ROS-based flight control method in unmanned aerial vehicle denial environment
By carrying ROS systems and corresponding sensor modules on the drone, the autonomous flight control of the drone in the GPS denial environment is realized, and the problem of traditional drones being unable to fly stably in such environments is solved, and high-precision autonomous flight missions are achieved.
Patent Information
- Application Number
- CN202411602522.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-11
AI Technical Summary
Traditional drones cannot fly stably in GPS denial environments, especially in buildings, underground mines or strong signal interference, it is difficult to achieve tasks such as autonomous takeoff, fixed-high hovering, fixed-point flight and autonomous landing.
It adopts a multi-rotor drone based on robot operating system (ROS), equipped with onboard computer main control module, flight control module, power module, camera module, optical flow module and communication module. Through the ROS system, the drone's autonomous flight control in the GPS denial environment is realized, and the tracking camera and monocular camera are used for visual SLAM positioning. The optical flow module provides height information. The MAVLink communication protocol realizes communication between the upper computer and the onboard computer.
The drone's autonomous takeoff, fixed-high hover, fixed-point flight and autonomous landing in GPS denial environment have been realized, ensuring the accuracy and stability of the flight, and simplifying the functional implementation through the distributed design of ROS.
Smart Images

Figure CN119597000A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle flight control, and in particular to a flight control method for unmanned aerial vehicle in a ROS-denied environment. Background Art
[0002] Unmanned aerial vehicle (UAV) is abbreviated as drone. As an aerial robot, it has many special uses. Its appearance provides a feasible solution for scenes that cannot be touched by humans, replacing humans to perform tasks that are highly repetitive, dangerous environments or complex operations. Among them, quadcopter drones are one of the more mainstream drones today due to their miniaturization, simple structure and flexible movements. They are widely used. In recent years, with the rapid advancement of robot technology, drones equipped with autonomous intelligent systems have been applied to agricultural plant protection, logistics distribution, traffic flow detection, remote sensing detection, power inspection, earthquake rescue, aerial reconnaissance and other directions. However, with the complexity of scene requirements, the disadvantages of traditional drones flying outdoors relying on GPS have become apparent, that is, drones can only fly on the basis of obtaining global positioning system (GPS) signals, and cannot fly stably in GPS-denied situations such as buildings, underground mines or strong signal interference.
[0003] The positioning methods of drones can be divided into external positioning and internal sensor positioning according to the positioning source. External positioning includes external positioning information based on ultra-wideband positioning (UWB) and motion capture systems. The motion capture system requires the deployment of visual sensors in the venue, which is expensive and less flexible. The UWB positioning technology also requires the deployment of tags and base stations in the venue. The price is lower than that of the motion capture system, but the stability is poor when there are obstructions. Internal sensor positioning is an active positioning solution based on the sensors carried by itself. There are positioning solutions based on SLAM synchronous positioning and mapping construction technology, positioning methods based on RFID wireless radio frequency identification technology, and positioning based on optical flow. For SLAM technology, the technology can be divided into two main categories based on vision-based SLAM and laser radar-based SLAM according to the type of sensor. Laser radar SLAM generates dense point clouds by detecting feature quantities in the environment with a laser beam from an airborne radar, and then performs mapping and positioning. Unlike the laser positioning solution, the positioning technology based on visual tracking is a technology that uses visual information for SLAM. It uses airborne high-definition cameras or other visual sensors to perceive environmental information, and determines its own position and direction by tracking specific targets or landmarks. It is a more autonomous positioning method because it does not need to rely on any external base stations, satellites and other facilities, so it has higher flexibility and robustness, and is more suitable for small drones. Davison, as a pioneer of visual SLAM, first proposed MonoSLAM, which uses a freely moving camera to realize SLAM. In the same year, Klein et al. proposed the PTAM algorithm, which is a milestone project of visual SALM. It proposed a dual-thread structure for tracking and mapping, which is more suitable for computer architecture. Later, Raul et al. proposed a relatively complete visual SLAM solution. The system uses ORB features and adds loop detection and closure mechanisms on the basis of dual threads. Its interfaces can be divided into three interfaces: monocular, binocular, and RGB-D. However, the accuracy of this generation of projects is not high for long-term operation. In the control of low-altitude economic flight, how to control the automatic start and stop of drones becomes a major control direction when the existing satellite control or positioning signals are interfered or stationary, and it also becomes a low-cost control direction for low-altitude flight control.
[0004] In recent years, with the rapid development of drone and robot technology, multi-rotor drones have been widely used in military and civilian fields due to their small size and flexible movement. However, in complex environments such as urban street fighting and numerous indoor obstacles, the positioning signal of the drone may be blocked by high-rise buildings and other interferences. It also faces problems such as multipath signal interference and intermittent denial, which causes the drone to obtain incorrect positioning information. For scenarios where the global positioning system is restricted, the autonomous flight capability of multi-rotor drones still needs to be further improved. Therefore, a multi-rotor autonomous drone based on a robot operating system is designed in a GPS-denied environment. Summary of the invention
[0005] The purpose of the present invention is to provide a flight control method for a drone in a denied environment based on ROS to solve the technical problems mentioned in the background technology.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A flight control method for a drone in a denied environment based on ROS. The drone system for implementing the control method comprises an onboard computer main control module, a flight control module, a power module, a camera module, an optical flow module, a communication module and a host computer module. The host computer module is connected to the onboard computer main control module via the communication module. The flight control module, the camera module and the optical flow module are all connected to the onboard computer main control module. The flight control module is connected to the power module. The camera module comprises a tracking camera module and a monocular camera module. The tracking camera module and the monocular camera module are both connected to the onboard computer main control module.
[0008] The control method is as follows: the drone is equipped with an onboard computer main control module running the ROS system. The onboard computer main control module sends instructions to the flight control module. The flight control module controls the attitude loop and position loop of the drone through PID. The information output by the flight control module is transmitted to the power module, which provides power. The tracking camera module and the monocular camera module perform target perception. The tracking camera module performs simultaneous mapping and positioning based on vision to provide active positioning information for the drone. The monocular camera uses the alvar package encapsulated by ROS to identify and return the position of the QR code relative to the drone. The optical flow module provides altitude information for the drone. The host computer module uses the communication module as the medium and uses the MAVLink communication protocol to communicate with the onboard computer. The host computer module then sends instructions to control the drone's autonomous takeoff, fixed-altitude hovering, fixed-point flight and autonomous landing tasks under GPS denial.
[0009] Furthermore, the three-dimensional motion of the drone system controlling the drone's flight is set to be a synthesis of vector motion and rotational motion. The vector motion describes the decomposition of the drone's translational motion in the X, Y, and Z directions at any position direction. The rotational motion is described as the synthesis of the drone's rotational motion in the right-hand spiral direction on the three axes of X, Y, and Z in three-dimensional space. The rotational motion directions are divided into roll motion, pitch motion, and yaw motion.
[0010] Furthermore, the position coordinate system of the UAV is represented by the earth-fixed coordinate system and the body coordinate system. The earth-fixed coordinate system is used to determine the spatial position coordinates of the body, ignoring the curvature of the earth, that is, assuming the surface of the earth to be a plane. The direction of the coordinate system follows the right-hand rule of ROS, and the origin is the initial position of the UAV. The position origin of the body coordinate system is taken at the position where the chassis of the UAV is projected to the center of the ground. The coordinate axes of the body coordinate system also follow the right-hand rule. The X-axis points to the nose in the multi-rotor symmetry plane, and the direction of the nose is related to the multi-rotor cross or X shape. The Z-axis is downward from the vertical axis in the aircraft symmetry plane, and the Y-axis is determined according to the right-hand rule.
[0011] The Earth-fixed coordinate system is used as the parent coordinate system, and the body coordinate system is used as the child coordinate system. The spatial relationship is described as the distance offset on the three axes of X, Y, and Z. The spatial relationship is described as the angular deviation value of the child coordinate system relative to the parent coordinate system in the directions of X, Y, and Z axes. When using sensor data and estimating the motion state, it needs to be converted into a description in the reference coordinate system. When describing the motion, a transformation matrix is usually used to represent the conversion between different coordinate systems. In the Euclidean transformation theory, the motion of any rigid body can be regarded as consisting of a translation transformation and a rotation transformation. The expression of the rotation transformation is more complex than the translation transformation, and is mainly reflected by the attitude angle during the motion of the system.
[0012] Furthermore, the UAV system also includes an inertial measurement module, which is set inside the flight control or on the deep binocular camera, and publishes the rotation and tilt attitude information of the UAV in real time. The inertial measurement module is composed of a gyroscope and an accelerometer, which measures its own three-axis angular velocity and three-axis acceleration, and measures the changes in its own direction and acceleration;
[0013] Furthermore, the specific process of controlling the autonomous takeoff and fixed-altitude hovering of the drone is as follows: after connecting the hardware equipment, connecting to the self-starting hotspot of the onboard computer, using the SSH tool to remotely connect to the onboard computer, and then starting the launch program for fixed-point flight. First, initialization is performed, and the program requests to enter the offboard mode. After entering this mode, it is determined whether the current mode is offboard. If so, use the remote control to open the safety switch, and then unlock the throttle. After unlocking, the drone can start to perform the flight mission. The fixed-point flight mission is executed in the order of position 1, position 2, position 3, position 4, and then back to position 1. When returning to position 1, manually switch to position fixed-point mode and manually take over landing.
[0014] Furthermore, the process of controlling the autonomous landing of the drone is as follows: use the SSH tool to remotely connect to the onboard computer, and then start the launch program for fixed-point flight. First, initialize and the program requests to enter the offboard mode. After entering this mode, the code automatically executes to determine whether the drone is unlocked. If unlocked, check the conditions of the height transmitted by the optical flow and the time when the onboard computer enters the offboard mode. If the height is within the range and exceeds three seconds, or exceeds 8 seconds, exit the mode switching loop and enter the QR code detection part. If the QR code is not detected, maintain the current position and re-enter the flight mode judgment. If the QR code is detected, continue to judge whether the position error is less than the threshold. If it is less than the threshold, adjust the horizontal speed of the drone and enter the height threshold judgment. If the position error is less than the threshold, land stably and then enter the height threshold judgment mode. If the height is not less than the threshold, readjust the height to enter the height threshold judgment mode. If the height is less than the threshold, end the landing, and then issue the landing end command and the program ends.
[0015] Furthermore, the process of controlling the autonomous landing of the drone is as follows: use the SSH tool to remotely connect to the onboard computer, and then start the launch program for fixed-point flight. First, initialize and the program requests to enter the offboard mode. After entering this mode, the code automatically executes to determine whether the drone is unlocked. If unlocked, check the conditions of the height transmitted by the optical flow and the time when the onboard computer enters the offboard mode. If the height is within the range and exceeds three seconds, or exceeds 8 seconds, exit the mode switching loop and enter the target position loop control. If the QR code is not detected, maintain the current position. If the target is recognized, determine whether the position error is less than the threshold. If it is less than the threshold, adjust the horizontal speed of the drone and move to the target position. If the position error is less than the threshold, set the status flag flag_arrive to true, and then update the current position. When reaching the target position, adjust the height, then land stably, and finally end the landing, and the program ends.
[0016] Furthermore, the specific process of controlling the unmanned aerial vehicle to take over is as follows: when the unmanned aerial vehicle is out of control due to various factors, human intervention is required to take over manually. At this time, you only need to dial the remote control into the self-stabilizing mode or the fixed-point mode to exit the offboard mode, or in an emergency, you can directly turn on the safety switch to lock the motor of the unmanned aerial vehicle. At this time, you can observe that the motor has stopped rotating.
[0017] The present invention has the following beneficial effects due to the adoption of the above technical solution:
[0018] The present invention can realize precise control of tasks such as autonomous take-off, hovering at a fixed altitude, flying at a fixed point, and autonomous landing in GPS-denied conditions. Due to the distributed design thinking of ROS, the function implementation of the UAV becomes simple. It only needs to encapsulate the used modules and then write them in the launch program, and then the corresponding functions without setting can be started with one click. At the same time, the five functions of out-of-control takeover, autonomous take-off, autonomous hovering, fixed-point flight, and autonomous landing can be realized, and tasks can be stably performed in a GPS-denied environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a block diagram of the UAV system module for implementing the control method of the present invention;
[0020] Figure 2 It is a flowchart of the autonomous fixed-point flight mission of the present invention;
[0021] Figure 3 This is the first autonomous landing mission flow chart of the present invention;
[0022] Figure 4 This is a second autonomous landing mission flow chart of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many details listed in the specification are only for the purpose of enabling the reader to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.
[0024] like Figure 1As shown, a flight control method for a drone in a denied environment based on ROS is provided. The drone system for implementing the control method includes an onboard computer main control module, a flight control module, a power module, a camera module, an optical flow module, a communication module and a host computer module. The host computer module is connected to the onboard computer main control module via the communication module, the flight control module, the camera module and the optical flow module are all connected to the onboard computer main control module, the flight control module is connected to the power module, the camera module includes a tracking camera module and a monocular camera module, and the tracking camera module and the monocular camera module are both connected to the onboard computer main control module.
[0025] The design of multi-rotor drone based on ROS in GPS denial environment consists of two parts: sky end and ground end. The upper computer module of the ground end consists of a laptop (Personal Computer, PC) with a data transmission module and a Ledi AT9SPro remote controller. The PC on the ground end runs an Ubuntu virtual machine, which runs the ground station software (QGroundConrol, QGC). The virtual machine is connected to the sky end through a WIFI module and a data transmission module. The hardware part of the sky end is composed of the NVIDIA Jetson nano B01 airborne computer as the control center, combined with Pixhawk2.4.8 as the lower-level flight control, and also includes a camera module, a power module, a battery module, an optical flow module, and a communication module.
[0026] The battery module is powered by a 3S (10.5V-12.5V) 2800mah aircraft battery connected to the power distribution board of the frame through the XT60 connector to power the entire system. The positive and negative power lines of four ESCs are welded on the power distribution board to power the power module. DC wires and BEC voltage regulator modules are also welded to power the onboard computer. The ammeter is connected to the power distribution board through the XT60 connector to power the flight control. Other sensors such as the camera module and the optical flow module are powered by the onboard computer or the flight control through the serial port. After the system is powered on, the circuits of each module are connected in sequence, and the onboard computer automatically starts to publish WIFI hotspots. When the ground-side computer and the onboard computer are connected in the same local area network, the ground-side computer can send instructions to control the onboard computer to start the ROS system. Driven by ROS: initialize and start the MAVROS communication node to realize the communication between each sensor and the onboard computer; start the tracking camera T265 node to provide active visual SLAM positioning information for the drone; start the optical flow to provide height information; start the monocular camera node to send the video information stream from the monocular camera to the onboard computer. After initializing and starting the ROS nodes of the above sensors, in order to realize autonomous tasks, it is also necessary to start the coordinate conversion node to convert the coordinate system of the sensor and the body coordinate system of the drone and the fixed coordinate system of the earth into the same coordinate system; start the underlying motion control node to control the underlying flight control module and the power module to make position loop and attitude loop control so as to realize the autonomous take-off, fixed-height hovering, fixed-point flight, and autonomous landing tasks of the drone. In addition, through the communication module, you can also view the information of the flight control and sensors displayed by the ground station software QGC running on the ground-side Ubuntu virtual machine.
[0027] The control method is as follows: the drone is equipped with an onboard computer main control module running the ROS system. The onboard computer main control module sends instructions to the flight control module. The flight control module controls the attitude loop and position loop of the drone through PID. The information output by the flight control module is transmitted to the power module, which provides power. The tracking camera module and the monocular camera module perform target perception. The tracking camera module performs simultaneous mapping and positioning based on vision to provide active positioning information for the drone. The monocular camera uses the alvar package encapsulated by ROS to identify and return the position of the QR code relative to the drone. The optical flow module provides altitude information for the drone. The host computer module uses the communication module as the medium and uses the MAVLink communication protocol to communicate with the onboard computer. The host computer module then sends instructions to control the drone's autonomous takeoff, fixed-altitude hovering, fixed-point flight and autonomous landing tasks under GPS denial.
[0028] To describe the state of the drone, the three-dimensional motion of the drone can be regarded as the synthesis of vector motion and rotational motion. Vector motion can also describe the decomposition of the translational motion of the drone in the X, Y, and Z directions at any position. Rotational motion can also be described as the synthesis of the right-hand spiral rotational motion of the drone on the three axes of X, Y, and Z in three-dimensional space. The rotational motion direction is divided into rolling motion, pitching motion, and yaw motion.
[0029] To describe the position of the drone, that is, the spatial relationship of the drone relative to the origin of the map coordinate system, two coordinate system concepts are often used, one is the earth-fixed coordinate system, and the other is the body coordinate system. Earth-fixed coordinate system: commonly used for the motion state of the robot relative to the ground. Here, for drones, it is used to determine the spatial position coordinates of the body. It ignores the curvature of the earth, that is, the surface of the earth is assumed to be a plane. The direction of the coordinate system follows the right-hand rule of ROS, and the origin is usually the initial position of the drone. Body coordinate system: Usually the origin of the body coordinate system is taken at the position where the drone chassis is projected to the center of the ground. The coordinate axes of the body coordinate system also follow the right-hand rule. The X-axis points to the nose in the multi-rotor symmetry plane (the direction of the nose is related to the multi-rotor cross or X shape). The Z-axis is downward from the vertical axis in the aircraft symmetry plane. Then, the Y-axis is determined according to the right-hand rule.
[0030] The Earth-fixed coordinate system is used as the parent coordinate system and the body coordinate system is used as the child coordinate system. Their spatial relationship can be described as the distance offset on the three axes of X, Y, and Z. Their spatial relationship can also be described as the angular deviation value of the child coordinate system relative to the parent coordinate system in the directions of X, Y, and Z axes. When using sensor data and estimating the state of motion, it is necessary to convert it into a representation in the reference coordinate system. Therefore, the transformation between different coordinate systems is very important. When describing motion, a transformation matrix is usually used to represent the transformation between different coordinate systems. In the Euclidean transformation theory, the motion of any rigid body can be regarded as consisting of a translation transformation and a rotation transformation. The expression of a rotation transformation is more complex than that of a translation transformation, and is mainly reflected by the attitude angle during the motion of the system.
[0031] The rotational motion of a drone can be represented by Euler angles and quaternions. The angle value of the axis direction is the angle between the body coordinate system and the ground earth-fixed coordinate system. The attitude angle of the aircraft is usually described by Euler angles, such as Figure 2-4 As shown in the figure, the Euler angle can be used to transform the Earth-fixed coordinate system to the body coordinate system by rotating the Euler angle around the axis. However, the Euler angle has a universal lock problem, and the description is not unique when representing 90° and 180°.
[0032] Rotational motion can also be represented by quaternions. The representation of quaternions consists of 3 imaginary parts and 1 real part. The real part and the imaginary part satisfy the expression shown in (1-1):
[0033] q=q0+q1i+q2j+q3k (1-1)
[0034] The three imaginary parts i, j, and k satisfy the relationship, as shown in (1-2):
[0035]
[0036] Quaternions and Euler angles can be converted to each other. If the Euler angles [φ, θ, ψ] are known T and quaternion [q0,q1,q2,q3] T Given the following conversion expressions as shown in (1-2) and (1-3):
[0037]
[0038]
[0039] In summary, if we use R 3×3 represents the three-dimensional rotation matrix, t 3×1 Represents the translation vector, then the expression for any state transition between coordinate systems is shown in (1-5):
[0040]
[0041] where x w Represents the state quantity in the world coordinate system, x r Represents the state quantity in the camera coordinate system or the body coordinate system, T r w is the transformation matrix. Therefore, the transformation between any two coordinate systems can be calculated similarly to the above formula.
[0042] The communication protocol for connecting micro-aircraft is MAVLink protocol. MAVLink protocol is a higher-level open source communication protocol based on serial communication. It is a lightweight communication protocol mainly used for communication between flight control and ground station. MAVLink message is basically a string of bytes encoded by ground station software and sent to the flight control in the sky via USB serial or data transmission (the two cannot be used at the same time. If inserted at the same time, USB is preferred and data transmission is ignored). The encoding here is just putting the data packet into a data structure and then sending it out in the form of bytes through the channel, with some error correction.
[0043] MAVLink consists of 17 bytes, including message ID, target ID and data. The message ID shows the data content, which can be seen in the messsage ID command set. MAVLink can transmit information from one channel and obtain information from multiple drones. MAVLink is used to read the messages sent by the ROS onboard computer, convert them into uORB messages, and provide them to the underlying flight control. At the same time, MAVLink is used to synchronously subscribe to the uORB messages in the flight control and encapsulate them into MAVLink messages for publication. Generally, after connecting to the ground station, the flight control will actively send a data stream consisting of heartbeat packets, aircraft attitude, system status, remote control signals, etc. to the ground station. Generally, the ground station will send a command when it is just connected to the flight control, requesting the flight control to return all parameters (this is the case with QGC). The flight control determines whether to accept the request of the ground station based on its own situation, and performs corresponding operations according to different commands (some commands require the flight control to reply to the ground station confirmation signal).
[0044] MAVROS is a function package of ROS, which runs on the ROS computer and supports the communication between MAVLink flight control and MAVLink ground station. In layman's terms, MAVROS is a higher-level encapsulation of ROS. MAVROS adds various messages and services for the MAVLink protocol to ROS, which means that we can parse the MAVLink protocol more conveniently.
[0045] Due to the distributed and modular concept, the biggest feature of ROS is that it will decompose a complete task into multiple nodes for implementation. Each sensor can also be regarded as an independent node. Different sensor messages usually have their own independent topic names, and each topic has only one publisher.
[0046] The ROS subscription and publishing mechanism is that the node that publishes the message is called the publisher, and the node that subscribes to the message is called the subscriber. The nodes communicate with each other through the subscription and publishing mechanism of Topic and Message. The data communicated in the topic is called Message. The Message is routed through a transmission system with publish or subscribe semantics. Usually, the message will be continuously sent by the node to a given topic at a certain frequency to ensure the real-time nature of the message data. Topic is a form of continuous communication between nodes, used to identify the name of the message content. Two communicating nodes establish a communication connection through the name of the topic. Nodes interested in a certain data will subscribe to the corresponding topic. A single topic may have multiple concurrent publishers and subscribers, and a single node can publish and / or subscribe to multiple topics. Generally speaking, publishers and subscribers are unaware of each other's existence. This random combination of publishers and subscribers of topics provides great flexibility for the division of node functions, and can be freely combined according to actual conditions.
[0047] The Inertial Measurement Unit (IMU) is a unit module attached to the drone, which belongs to the flight control or the depth binocular camera, and publishes the rotation and tilt of the drone in real time. IMU consists of a gyroscope and an accelerometer, which can measure its own three-axis angular velocity and three-axis acceleration respectively. It usually contains tiny integrated MEMS (micro-electromechanical system) components, which can quickly measure changes in its own direction and acceleration.
[0048] The MEMS three-axis accelerometer uses the piezoresistive, piezoelectric and capacitive working principles, and the specific force (pressure or displacement) generated is proportional to the changes in resistance, voltage and capacitance respectively. These changes can be collected by corresponding amplification and filtering circuits. The disadvantage of this sensor is that it is greatly affected by vibration. The three-axis accelerometer is an inertial sensor that can measure the specific force of an object, that is, the overall acceleration after removing gravity or the non-gravitational force acting on the unit mass. When the accelerometer remains stationary, the accelerometer can sense the acceleration of gravity, while the overall acceleration is zero. In free fall, the overall acceleration is the acceleration of gravity, but the accelerometer is in a state of weightlessness, and the output of the three-axis accelerometer is zero at this time.
[0049] The principle of a three-axis accelerometer can be used to measure angles. The amount of spring compression is determined by the angle between the accelerometer and the ground. The specific force can be measured by the length of the spring compression. Therefore, in the absence of external forces, the accelerometer can accurately measure pitch and roll angles without cumulative errors. In a gyroscope, two masses move at opposite speeds but with the same magnitude. They generate opposite Coriolis forces, which compress the two corresponding capacitor plates to move, resulting in a differential change in capacitance. The change in capacitance is proportional to the angular velocity of rotation. This is the basic principle.
[0050] SLAM, a simultaneous localization and mapping technology, is a robot that starts moving from an unknown position in an unknown environment. During the movement, it uses sensors to estimate its own position while building an incremental map of the surrounding environment to achieve autonomous positioning and navigation of the robot. Mapping in SLAM is mainly used for positioning, planning, obstacle avoidance and other modules. SLAM technology is used to solve the positioning and movement of drones in unknown environments without GPS signals. It consists of sensor data, front-end odometer, back-end optimization, loop detection and mapping.
[0051] The entire flowchart of the visual-inertial navigation odometry method can be decomposed into five parts: data preprocessing, initialization, local nonlinear optimization, loop detection and global optimization. The main functions of each module are: Image and IMU data preprocessing: For images, feature points are extracted. The IMU data is calculated to obtain the current position, speed and rotation angle of the system. During initialization, the visual initialization is first performed to solve the relative position of the camera; then the initialization parameters are aligned with the IMU pre-integration. The visual-inertial navigation nonlinear optimization of the sliding window in the flowchart: that is, the visual constraints and IMU constraints are put into a large objective function for optimization, and the local nonlinear optimization outputs a more accurate position. Loop detection: Loop detection is to save the key frames of the image detected previously, and when returning to the same place as before, it is determined whether it has been here by matching the feature points. Global optimization: Global optimization is to use the camera constraints and IMU constraints, plus the constraints of loop detection, to perform nonlinear optimization when loop detection occurs. Global optimization is performed on the basis of local optimization to output a more accurate position.
[0052] PX4FLOW optical flow algorithm, optical flow refers to a two-dimensional instantaneous velocity field composed of all pixels in the image, in which the two-dimensional velocity vector is the projection of the three-dimensional velocity vector of the visible point in the scene on the imaging surface. Optical flow uses a camera to capture ground images and uses computer vision technology to calculate the optical flow between adjacent frames. Optical flow is an estimate of the movement of ground texture between adjacent frames, which can be used to infer the movement of the drone relative to the ground. Based on the results of the optical flow calculation, the attitude (pitch angle, roll angle, and yaw angle) of the drone can be estimated. By analyzing the movement of texture on the ground, the rotation and translation movement of the drone relative to the ground can be inferred, thereby estimating its attitude. In addition to attitude estimation, optical flow can also be used to estimate the height of the drone relative to the ground. By analyzing the texture changes on the ground, the height change of the drone relative to the ground can be inferred, thereby achieving fixed-point hovering and precise positioning. The implementation of PX4FLOW mainly relies on the optical flow algorithm and computer vision technology, as well as the high precision of cameras and sensors. By integrating optical flow with the flight control system of the drone, more stable, precise and intelligent flight control can be achieved.
[0053] The monocular camera recognition algorithm is implemented using the ar_track_alvar package. ar_track_alvar is a ROS-based package of Alvar. The ar_track_alvar package uses the Alvar library to detect and track the position and pose of augmented reality (AR) tags and QR codes. The QR code positioning process is as follows: based on the captured image, the AR detection tag is identified in the captured image using Alvar's algorithm. The detection process includes thresholding the image to find candidate areas that may contain tags, and then performing pose estimation. For the detected tags, the detected tag corners are projected into three-dimensional space using the PnP (Perspective-n-Point) algorithm, and their pose relative to the camera, including position and orientation, is calculated to determine the precise pose of each tag. Finally, the detected pose and related metadata are published as ROS topics, allowing other nodes in the ROS ecosystem to subscribe to these topics and use the tag information for further processing, such as robot navigation, object manipulation, or augmented reality applications.
[0054] The flight control algorithm uses the Pixhawk 2.4.8 flight controller, which adopts the inner and outer loop control strategy. The inner loop controls the attitude angle of the multi-rotor aircraft, while the outer loop controls the position of the multi-rotor aircraft. The inner and outer loops control the multi-rotor aircraft to achieve the flight modes of lifting, hovering, and side flight.
[0055] Its inner and outer loop controllers are a mixture of P and PID controllers to achieve stability and control of the aircraft. The algorithm controls the attitude and position of the aircraft by adjusting the speed of the motor to ensure that it can fly according to the predetermined trajectory. The overall architecture of this multi-rotor cascade control can be divided into: inner loop and outer loop. The inner loop can be divided into the multi-rotor angular rate controller and the multi-rotor attitude controller, and the outer loop can be divided into the multi-rotor speed controller and the multi-rotor position controller.
[0056] The angular rate controller of the multirotor is a K-PID controller, which is composed by using a low pass filter (LPF) on the derivative path to reduce noise (the gyro provides the filtered derivative to the controller). The attitude controller of the multirotor uses quaternions. The only parameter of interest when tuning this controller is the P gain. The multirotor velocity controller is used to stabilize the velocity, commanding acceleration. This integrator includes an anti-reset uplink (ARW) using a clamping method. The commanded acceleration is not saturated - the saturation will be applied to the converted thrust setpoint in combination with the maximum tilt angle. The multirotor position controller commands the velocity. The commanded velocity is saturated to keep the velocity within a certain range. This parameter sets the maximum possible horizontal velocity. This is different from the maximum required velocity (autonomous mode) and (manual position control mode). Mode-dependent feedforwards, such as the mission mode trajectory generator (acceleration-limited trajectory) calculate position, velocity and acceleration setpoints. The acceleration setpoint (inertial frame) is converted to an attitude setpoint (quaternion) and a collective thrust setpoint.
[0057] Nvidia Jetson nano B01 is selected as the main computer onboard the sky end. NVIDIAJetson nano is a single-board computer for artificial intelligence (AI) and machine learning (ML) applications. It provides high-performance computing power and supports complex AI models and applications. Its core hardware components include: The CPU uses a quad-core ARM Cortex-A57 processor with a 64-bit architecture. The inclusion of a GPU is also the biggest feature of this computer. It supports CUDA and TensorRT, which can accelerate deep learning reasoning tasks and facilitate the expansion of the functions of the drone with deep learning tasks in the future. Memory: 4GB 64-bit LPDDR4 is used, and the memory bandwidth is 25.6GB / s. Storage: Supports microSD card as the main storage device. This design uses a 256G high-speed microSD card.
[0058] The interface includes 4 USB 3.0 ports. This design is connected to the tracking camera T265, monocular camera, and WIFI module through the USB port. Supports HDMI, which can be used to debug the internal code of Nvidia Jetson nano and set up auto-start. Supports 40-pin GPIO interface.
[0059] Connect pins 6, 8, and 10 of the onboard computer to the TELEM 2 interface of the flight controller via a serial cable. In addition, this type of computer also supports three power supply methods: (1) DC power supply, providing 5V / 4A power supply, you need to plug in the J48 jumper cap when using it (2) GPIO pin power supply, this power supply method provides 5V / 3A power supply, with or without the J48 jumper cap (3) MicroUSB power supply, you need to unplug the J48 jumper cap to use, this power supply method provides 5V / 2A, and only supports 5W low power mode. Since this design has a relatively large demand for computer computing power, a DC power supply method with a higher current is used. The DC cable is connected to the onboard computer for power supply.
[0060] The rack options include PCB version and carbon fiber board plus a distributor, that is, the carbon fiber board plus distributor version. Conventional rack sizes can be divided into drone racks with wheelbases of 330mm, 250mm, 450mm, and 380mm. The larger the rack wheelbase, the more wind-resistant it is outdoors, and the smaller the rack wheelbase, the more agile the drone is. Considering the placement of the battery, onboard computer, flight control, and tracking camera, this design chooses a carbon fiber rack with a wheelbase of 330mm. The rack comes with a shock-absorbing plate, an upper carbon plate, a lower carbon plate, and copper columns, which can effectively prevent the explosion of the drone from damaging the sensors on the drone. The shock-absorbing plate is connected by a rubber ring, and the upper and lower plates are connected to the middle carbon fiber rack by copper columns and screws.
[0061] The input end of the power distribution board circuit is a 3S (10.5V-12.5V) 2800mah aircraft model battery. The built-in XT60 male connector of the battery is connected to the XT60 female connector of the frame. After the XT60 female connector is connected, the positive and negative power lines are welded to the corresponding positive and negative poles of the power distribution board to provide a 12V voltage for the input end. Then the four ESCs are welded to the positive and negative poles of the power distribution board through the positive and negative power lines to provide a 12V voltage for the ESCs. Finally, the positive and negative power lines of the BEC regulator are welded to the positive and negative poles of the power distribution board. The BEC regulator can reduce the voltage of the power distribution board of about 12V to the working voltage of the onboard computer NVIDIA Jetson nano, which is about 5V.
[0062] ESC, choosing the right ESC requires considering several factors, including:
[0063] (1) Rated current of the ESC: It is generally recommended that the current rating of the ESC should be 20% higher than the maximum discharge current of the motor. If the motor voltage is 12V, the ESC needs to be higher than 14.4V.
[0064] (2) Rated voltage: The battery input voltage range supported by the ESC, which is usually indicated in the parameter table on the purchase page.
[0065] (3) Communication protocol: Common protocols include PWM protocol, OneShot protocol, DShot protocol, etc. Different protocols differ in terms of control accuracy and delay. The update speed of the PWM protocol is limited by the communication speed between the flight control and the ESC. The OneShot protocol is similar to the PWM protocol, but this protocol reduces the delay of command transmission by increasing the update speed. The DShot protocol is a digital communication protocol that can provide more accurate transmission signals, send specific commands, and even achieve constant speed. You need to choose the appropriate protocol according to your needs.
[0066] Taking all the above factors into consideration, the Haoying Letian XRotor 20A ESC is used. The continuous output current of the ESC is 20A, each weighs 14g, and is suitable for quadrotor drones with a wheelbase of 330mm.
[0067] I mainly choose the motor through the following steps:
[0068] (1) First, determine the total weight of the drone, including the weight of all external devices and motors. The final weight of the drone is approximately 1.6 kg.
[0069] (2) Then determine the lift required by the drone. Lift is the work done by the drone to overcome its own gravity. Then calculate the lift that each motor needs to provide, which is usually the maximum takeoff weight divided by the number of motors.
[0070] (3) Secondly, refer to the motor parameter table to select the appropriate motor size and Kv value. In the parameter table, the most important factor in motor selection is the Kv value. The Kv value refers to the increase in speed when the motor voltage increases by one volt. Generally speaking, the smaller the Kv value, the greater the torque and pulling force of the motor, which is suitable for large drones that require greater lift. On the contrary, for small drones, higher sensitivity and speed are required, so it is suitable to select a motor with a higher Kv value. Since the use scenario of the drone designed in this design is mainly indoor environment, the drone should be selected with a smaller size, and the corresponding Kv value should be larger. When selecting the size parameters of the drone motor, it is necessary to consider the diameter and height of the motor stator. Usually two sets of numbers are marked on the motor, such as 2216, where 22 represents a stator diameter of 22mm and 16 represents a stator height of 16mm. The wider the motor, the greater the torque generated, which is suitable for drones with large loads. The taller and narrower the motor, the faster the response and speed, which is suitable for small drones with high speed sensitivity requirements.
[0071] (4) Pay attention to the maximum current requirement and available voltage range of the motor, and then select a matching battery based on the motor current requirement and the battery parameters of the drone (such as voltage and maximum discharge current).
[0072] (5) Finally, consider the effect of blade type on motor selection.
[0073] Therefore, based on the above steps, two pairs of Dongxingwei DXW2216 brushless motors with positive and negative thread motors are selected for this design. The KV value of the motor is 1000KV. Each motor provides 1kg of lift, and a total of 4kg of lift is provided.
[0074] The working principle of the propeller is to generate lift through the rotation of the propeller. Adjusting the propeller speed and pitch can control the flight action of the drone, such as rising, hovering and yaw. The size of the propeller is generally selected to prevent collision, which is half the distance between two adjacent motors. The advantages of propellers with smaller diameters are lighter weight and smaller diameter. The weight of the entire propeller is relatively light, which is conducive to reducing the overall weight of the drone and improving maneuverability and flight efficiency. Propellers with smaller diameters are also easier to change the acceleration of the drone by changing the motor speed. The lift generated is relatively small, which is suitable for small drones with higher sensitivity requirements. The pitch is the distance the propeller moves forward when it rotates 360 degrees in a solid. Under the same speed and the same propeller diameter, as the pitch increases, the lift generated by the propeller will also increase, and the acceleration of the drone will also increase. However, since lift and resistance coexist, the current required by the motor will eventually increase.
[0075] When selecting propellers, you also need to consider lift requirements and motor matching. Select two pairs of 8045 forward and reverse self-locking propellers according to the tension reference value provided in the parameter table. The use of self-locking propellers not only avoids the risk of propeller shooting, but also ensures the safety of personnel during flight, debugging, and take-off and landing. The first two digits of the propeller model represent the diameter of the propeller, and the last two digits represent the pitch of the propeller (for example: 8045 represents a propeller length of 8 inches and a pitch of 4.5 inches). The rotation direction and size parameters of the propeller blades have an important impact on the performance of the drone. Choosing lightweight, efficient and durable propeller blade materials, such as carbon fiber and high-strength plastic, can reduce the weight of the drone.
[0076] Optical flow PX4FLOW is used to realize the height determination function of multi-rotor drones. Optical flow PX4FLOW is an intelligent optical flow sensor with a native 752×480 pixel resolution. In the process of calculating optical flow, a 4x classification and clipping algorithm is used. The calculation speed can reach 250Hz outdoors during the day. It has a very high sensitivity. Unlike other sensors, it can work at a calculation speed of 120Hz in a dark room without LED lighting. The optical flow is connected to the flight control Pixhawk2.4.8 via I2C and is also small in size, only 45.5×35mm.
[0077] The camera module includes a monocular camera and a T265 tracking camera. When installing the monocular camera, the lens needs to be vertically facing downward to identify the QR code on the ground. When the drone identifies the QR code on the ground, it will land autonomously. Since the onboard computer NVIDIA Jetson nano of this design has a USB3.0 port, a USB monocular camera is selected and the monocular camera is plugged into the onboard computer.
[0078] The T265 tracking camera is connected to the onboard computer NVIDIA Jetson nano via a MicroUSB to USB3.0 adapter. The T265 tracking camera has built-in V-SLAM technology for visual mapping and positioning
[26] . Since the T265 tracking camera also has a built-in inertial measurement IMU, the camera will also return its current posture state to the onboard computer NVIDIA Jetson nano.
[0079] The onboard computer NVIDIA Jetson nano is used as the core control. The onboard computer runs the Ubuntu 18.04 operating system, and ROS and QGC ground station software are run on this operating system. The ROS operating system is an open source operating system that runs on the Linux system. It is used to simplify the software development of robots and provides a series of tools and services to support the application of robots. Using the ROS system, various sensors connected to ROS can be directly controlled, including Pixhawk 2.4.8 flight control, monocular camera and tracking camera T265. At the same time, multiple sensors can also be indirectly controlled. For example, the electronic speed controller connected to the flight control can be indirectly controlled through the flight control to control the speed of the motor. ROS can divide tasks into blocks through a distributed architecture. By starting the node nodes, data conversion and task nodes of each sensor, the autonomous tasks of the drone can be realized.
[0080] In the catkin_ws workspace of the ROS system, put each required node in the src directory for calling. By writing a launch program, multiple nodes can be integrated into one program to start the corresponding task with one click. In order to realize the autonomous landing function, fixed-point flight function, autonomous take-off function, fixed-height hovering function, and out-of-control takeover function, the above tasks need to start the mavros node together; for the out-of-control takeover function, fixed-point flight function, autonomous take-off function, and fixed-height hovering function, it is necessary to uniformly start the mavros node, realsense-ros node, and t265_to_mavros coordinate conversion node in the above tasks. The rest are customized according to the needs of the task, such as: multi_position, single_position, track_landing and other node programs; in addition, for the autonomous landing function, it is necessary to start the relevant nodes of the monocular camera, such as usb_cam, robot_vision, and track_landing node programs. The software level program design of this design is mainly based on ROS.
[0081] like Figure 2 As shown in the figure, the specific process of controlling the autonomous takeoff and fixed-altitude hovering of the drone is as follows: after connecting the hardware equipment, connecting to the self-starting hotspot of the onboard computer, use the SSH tool to remotely connect to the onboard computer, and then start the launch program for fixed-point flight. First, initialize, and the program requests to enter the offboard mode. After entering this mode, determine whether it is currently in offboard mode. If so, use the remote control to open the safety switch, and then unlock the throttle. After unlocking, the drone can start to perform the flight mission. The fixed-point flight mission is executed in the order of position 1, position 2, position 3, position 4, and then return to position 1. When returning to position 1, manually switch to position fixed-point mode and manually take over landing.
[0082] like Figure 3As shown in the figure, the process of controlling the autonomous landing of the drone is: use the SSH tool to remotely connect to the onboard computer, and then start the launch program for fixed-point flight. First, initialize it, and the program requests to enter the offboard mode. After entering this mode, the code automatically executes to determine whether the drone is unlocked. If unlocked, check the height transmitted by the optical flow and the time when the onboard computer enters the offboard mode. If the height is within the range and exceeds three seconds, or exceeds 8 seconds, exit the mode switching loop and enter the QR code detection part. If the QR code is not detected, keep the current position and re-enter the flight mode judgment. If the QR code is detected, continue to judge whether the position error is less than the threshold. If it is less than the threshold, adjust the horizontal speed of the drone and enter the height threshold judgment. If the position error is less than the threshold, it will land stably and then enter the height threshold judgment mode. If the height is not less than the threshold, readjust the height to enter the height threshold judgment mode. If the height is less than the threshold, end the landing, and then issue the landing end command and the program ends.
[0083] like Figure 4 As shown in the figure, the process of controlling the autonomous landing of the drone is: use the SSH tool to remotely connect to the onboard computer, and then start the launch program for fixed-point flight. First, initialize it, and the program requests to enter the offboard mode. After entering this mode, the code automatically executes to determine whether the drone is unlocked. If unlocked, check the height transmitted by the optical flow and the time when the onboard computer enters the offboard mode. If the height is within the range and exceeds three seconds, or exceeds 8 seconds, exit the mode switching loop and enter the target position loop control. If the QR code is not detected, keep the current position. If the target is recognized, determine whether the position error is less than the threshold. If it is less than the threshold, adjust the horizontal speed of the drone and move to the target position. If the position error is less than the threshold, set the status flag flag_arrive to true, and then update the current position. When it reaches the target position, adjust the height, then land stably, and finally end the landing, and the program ends.
[0084] The specific process of taking over the uncontrolled drone is as follows: when the drone is out of control due to various factors, human intervention is required to take over manually. At this time, you only need to dial the remote control into the self-stabilization mode or the fixed-point mode to exit the offboard mode, or in an emergency, you can directly turn on the safety switch to lock the drone's motor. At this time, you can observe that the motor stops.
[0085] To realize the autonomous flight, autonomous landing and fixed-point flight functions of the drone, Pixhawk 2.4.8 needs to subscribe to and publish some key ROS function packages. These function packages are mainly implemented through MAVROS, which is a ROS-MAVLink interface that allows ROS to communicate with the flight control (such as Pixhawk). The topics subscribed and published by the flight control are shown in Table 4-2. ROS receives the flight status information of the drone, the local position and attitude of the drone, the global position of the drone, and the IMU data of the drone by subscribing to the relevant topics of mavros. By publishing the MAVROS topic, the position, speed, and attitude control of the drone can be realized.
[0086] Due to the superposition of the weight of each sensor, the change in weight causes the center of gravity of the drone to change. Therefore, it cannot be quickly controlled by the remote control at the beginning, and its position and posture cannot remain stable. In order to better operate the drone and obtain a more stable drone response, it is necessary to perform PID debugging on the drone. PID debugging is divided into attitude loop and position loop. These two loops control the state of the drone in parallel. For these two loops: after adjusting the attitude loop, the drone responds sensitively to the action attitude, and after adjusting the position loop, the drone responds sensitively to the position. The attitude loop can be divided into outer loop angle loop control and inner loop angular rate loop control; the position loop can be divided into inner loop rate loop control and outer loop position loop control.
[0087] First, adjust the outer ring angle ring MC_PITCH_P in the attitude loop in the self-stabilization mode to adjust the Pitch angle of the drone. Therefore, place the drone head vertically on the PID debugging frame, then power on, and turn the throttle to 50%. At this time, the drone is just in a state where it can be started. Then set the MC_PITCH_P parameter to 1. When MC_PITCH_P is too small,
[0088] Adjust the inner angular rate loop of the attitude loop. The inner loop includes three parameters: MC_PITCHRATE_P: pitch angular rate loop P item, MC_PITCHRATE_I: pitch angular rate loop I item, and MC_PITCHRATE_D: pitch angular rate loop D item. After adjustment, the response curve fits the expected curve. The D item is used to suppress oscillation, and the I value is used to eliminate static error. At this time, the inner and outer attitude loops of the attitude loop Pitch angle are adjusted.
[0089] Since the drones are balanced in pairs, after adjusting the attitude ring of the Pitch angle, the attitude ring of the Roll angle is symmetrical with it, so the parameters are the same as the Pitch attitude ring. The parameter adjustment method of Yaw is similar, except that the D item is generally 0.
[0090] Then adjust the position loop. The position loop can be divided into the horizontal XY axis and the height Z axis. The horizontal XY axis can be divided into the PID value of the inner speed loop and the P value of the outer loop. The same is true for the Z axis. First, adjust the PID of the inner speed loop of the height Z axis. After checking Vz, it can be observed that the response curve is quite different from the expected curve. Adjust the MPC_Z_VEL_P value, MPC_Z_VEL_D value, and MPC_Z_VEL_I value in turn. It can be observed that the adjusted response curve is relatively close to the expected curve. Similarly, adjust the MPC_XY_VEL_I, MPC_XY_VEL_P, MPC_XY_VEL_D, MPC_XY_P, and MPC_Z_P values of the inner and outer position loops of the XY axis.
[0091] First, realize the human intervention takeoff under GPS denial, without GPS providing positioning. Since the tracking camera T265 has built-in IMU and V-SLAM functions, this design uses the tracking camera T265 to provide positioning information. After the ground-side laptop remotely SSHs to the airborne computer NVIDIAJetson nano, start the launch program. The launch program contains the start MAVROS communication node, realsense2_camera node and t265_to_mavros node. The functions of these three node programs are to start ROS communication, start the tracking camera T265 through the airborne computer, and transmit the collected information of T265 to MAVROS for use. Then, after the safety switch is turned off by the Ledi AT9S Pro remote control, the left hand unlocks the left eight, and the left joystick is pushed up to push the throttle of the drone. The left joystick is turned horizontally to the left and right to control the left and right rotation of the drone. The right hand turns up and down and left and right to control the front, back, left and right directions of the drone. You can observe the remote control flight of the drone under GPS denial.
[0092] Since the onboard computer NVIDIAJetson nano is equipped, the computing power is sufficient to realize the autonomous function of the drone. This section introduces the autonomous takeoff of the drone. The launch task of autonomous takeoff consists of four nodes. The first three nodes are the same as above, which successively realize the communication of starting ROS, start the tracking camera T265 through the onboard computer, and transmit the collected information of T265 to MAVROS for use. In other words, the first three nodes are to provide positioning information for the takeoff of the drone, and the last node is to control the autonomous takeoff of the drone. This node is in the package named offboard_single_position, and the node name is also offboard_single_position. In a new terminal, after running this node, you can observe that the drone enters the offboard mode and hovers after autonomous takeoff.
[0093] The tracking camera T265 has built-in IMU and V-SLAM, so the drone can be provided with positioning information whether it is under manual takeover or offboard. Taking manual takeover as an example, in manual takeover mode, when the remote controller is in fixed-point mode (Position) or fixed-height mode (Attitude), it can be observed that the drone can still hover at a constant height in the air and its position will not change after the two joysticks of the remote controller are released. This is achieved by the PID function of the flight control and the tracking camera T265 that provides positioning information. If the remote controller is in self-stabilization mode (hold), it can be regarded as not being provided by the tracking camera T265. The position and posture of the drone need to be adjusted manually in real time. At this time, the two remote controller joysticks cannot be released, and the fixed-point hovering function cannot be achieved.
[0094] There are two ways to implement the fixed-point flight function. One is to manually plan the waypoints on the QGC ground station software. After uploading the task, the drone can achieve fixed-point flight or pointed flight. The other way is to write the drone's waypoint information in the program, and the ground end can control the sky end to execute the written launch program, publish the designated waypoints in the lower-level flight control, and then the flight control can execute it to realize the drone's autonomous designated waypoint flight.
[0095] The autonomous landing function is achieved by controlling the drone to land after the monocular camera detects the QR code on the ground and returns the position of the QR code relative to the drone. The drone first switches to the fixed-point mode by the remote controller to fly above the QR code or writes a launch program that takes off autonomously and flies to the specified position. Then, the autonomous landing launch program on the sky side is started on the ground side. The program will start the MAVROS communication node, the monocular camera node, the coordinate conversion node between the monocular camera and the drone in turn, and finally start the motion control node to enter the offboard mode and land at the QR code position detected by the monocular camera.
[0096] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A flight control method for a drone in a ROS-based denial environment, characterized by: The unmanned aerial vehicle system for implementing the control method comprises an onboard computer main control module, a flight control module, a power module, a camera module, an optical flow module, a communication module and a host computer module, wherein the host computer module is connected to the onboard computer main control module via the communication module, the flight control module, the camera module and the optical flow module are all connected to the onboard computer main control module, the flight control module is connected to the power module, the camera module comprises a tracking camera module and a monocular camera module, and the tracking camera module and the monocular camera module are all connected to the onboard computer main control module; The control method is as follows: the drone is equipped with an onboard computer main control module running the ROS system. The onboard computer main control module sends instructions to the flight control module. The flight control module controls the attitude loop and position loop of the drone through PID. The information output by the flight control module is transmitted to the power module, which provides power. The tracking camera module and the monocular camera module perform target perception. The tracking camera module performs simultaneous mapping and positioning based on vision to provide active positioning information for the drone. The monocular camera uses the alvar package encapsulated by ROS to identify and return the position of the QR code relative to the drone. The optical flow module provides altitude information for the drone. The host computer module uses the communication module as the medium and uses the MAVLink communication protocol to communicate with the onboard computer. The host computer module then sends instructions to control the drone's autonomous takeoff, fixed-altitude hovering, fixed-point flight and autonomous landing tasks under GPS denial.
2. The flight control method in a ROS-based drone denial environment according to claim 1, characterized in that: The three-dimensional motion of the drone system to control the drone's flight is set as a synthesis of vector motion and rotational motion. The vector motion describes the decomposition of the drone's translational motion in the X, Y, and Z directions at any position. The rotational motion is described as the synthesis of the drone's rotational motion in the right-hand spiral direction on the three axes of X, Y, and Z in three-dimensional space. The rotational motion directions are divided into roll motion, pitch motion, and yaw motion.
3. The flight control method in a ROS-based drone denial environment according to claim 1, characterized in that: The position coordinate system of the drone is represented by the earth-fixed coordinate system and the body coordinate system. The earth-fixed coordinate system is used to determine the spatial position coordinates of the body, ignoring the curvature of the earth, that is, assuming the surface of the earth as a plane. The direction of the coordinate system follows the right-hand rule of ROS. The origin is the initial position of the drone. The position origin of the body coordinate system is taken at the position where the drone chassis is projected to the center of the ground. The coordinate axes of the body coordinate system also follow the right-hand rule. The X-axis points to the nose in the multi-rotor symmetry plane. The direction of the nose is related to the multi-rotor cross or X shape. The Z-axis is downward from the vertical axis in the aircraft symmetry plane, and the Y-axis is determined according to the right-hand rule. The Earth-fixed coordinate system is used as the parent coordinate system, and the body coordinate system is used as the child coordinate system. The spatial relationship is described as the distance offset on the three axes of X, Y, and Z. The spatial relationship is described as the angular deviation value of the child coordinate system relative to the parent coordinate system in the directions of X, Y, and Z axes. When using sensor data and estimating the motion state, it needs to be converted into a description in the reference coordinate system. When describing the motion, a transformation matrix is usually used to represent the conversion between different coordinate systems. In the Euclidean transformation theory, the motion of any rigid body can be regarded as consisting of a translation transformation and a rotation transformation. The expression of the rotation transformation is more complex than the translation transformation, and is mainly reflected by the attitude angle during the motion of the system.
4. The flight control method in a ROS-based drone denial environment according to claim 1, characterized in that: The UAV system also includes an inertial measurement module, which is installed inside the flight control system or on the deep binocular camera. It publishes the rotation and tilt attitude information of the UAV in real time. The inertial measurement module is composed of a gyroscope and an accelerometer, which can measure its own three-axis angular velocity and three-axis acceleration, and measure the changes in its own direction and acceleration.
5. The flight control method in a ROS-based drone denial environment according to claim 1, characterized in that: The specific process of controlling the drone to take off and hover at a fixed altitude is as follows: after connecting the hardware equipment, connect to the self-starting hotspot of the onboard computer, use the SSH tool to remotely connect to the onboard computer, and then start the launch program for fixed-point flight. First, initialize, and the program requests to enter the offboard mode. After entering this mode, determine whether it is currently in offboard mode. If so, use the remote control to open the safety switch, and then unlock the throttle. After unlocking, the drone can start to perform the flight mission. The fixed-point flight mission is executed in the order of position 1, position 2, position 3, position 4, and then return to position 1. When returning to position 1, manually switch to position fixed-point mode and manually take over landing.
6. The flight control method in a ROS-based drone denial environment according to claim 1, characterized in that: The process of controlling the autonomous landing of the drone is as follows: use the SSH tool to remotely connect to the onboard computer, and then start the launch program for fixed-point flight. First, initialize it, and the program requests to enter the offboard mode. After entering this mode, the code automatically executes to determine whether the drone is unlocked. If unlocked, check the height transmitted by the optical flow and the time when the onboard computer enters the offboard mode. If the height is within the range and exceeds three seconds, or exceeds 8 seconds, exit the mode switching loop and enter the QR code detection part. If the QR code is not detected, keep the current position and re-enter the flight mode judgment. If the QR code is detected, continue to judge whether the position error is less than the threshold. If it is less than the threshold, adjust the horizontal speed of the drone and enter the height threshold judgment. If the position error is less than the threshold, it will land stably and then enter the height threshold judgment mode. If the height is not less than the threshold, readjust the height to enter the height threshold judgment mode. If the height is less than the threshold, end the landing, and then issue the landing end command and the program ends.
7. The flight control method in a ROS-based drone denial environment according to claim 1, characterized in that: The process of controlling the autonomous landing of the drone is: use the SSH tool to remotely connect to the onboard computer, and then start the launch program for fixed-point flight. First, initialize it, and the program requests to enter the offboard mode. After entering this mode, the code automatically executes to determine whether the drone is unlocked. If unlocked, check the height transmitted by the optical flow and the time when the onboard computer enters the offboard mode. If the height is within the range and exceeds three seconds, or exceeds 8 seconds, exit the mode switching loop and enter the target position loop control. If the QR code is not detected, keep the current position. If the target is recognized, determine whether the position error is less than the threshold. If it is less than the threshold, adjust the horizontal speed of the drone and move to the target position. If the position error is less than the threshold, set the status flag flag_arrive to true, and then update the current position. When it reaches the target position, adjust the height, then land stably, and finally end the landing, and the program ends.
8. The flight control method in a ROS-based drone denial environment according to claim 1, characterized in that: The specific process of taking over the uncontrolled drone is as follows: when the drone is out of control due to various factors, human intervention is required to take over manually. At this time, you only need to dial the remote control into the self-stabilization mode or the fixed-point mode to exit the offboard mode, or in an emergency, you can directly turn on the safety switch to lock the drone's motor. At this time, you can observe that the motor stops.
Citation Information
Cited By
Pier damage identification method based on dual-area flight and dual-trunk optimization network
CN121661550A