Computer simulation algorithm of gymnastics formation change path based on wireless sensor

Today with the rapid development of the information age, the exchange of science and technology has brought closer the closeness of countries, and our country has also begun to conduct in-depth research on WSN. This research mainly discusses the computer simulation algorithm of gymnastics formation change path based on wireless sensor. In this research, an improved Leader-Follower method is designed. In the research of gymnastics formation transformation of mobile nodes in the wireless sensor network environment, the traditional three types of nodes are divided into four categories according to the different formation responsibilities, namely, coordinator, beacon node, master mobile node (Leader), slave mobile node (Follower). After it accurately locates itself with the help of the information of the beacon node, the information should be sent out in the form of broadcast, and the coordinator sends the information to the host computer through the serial port for tracking display. In order to enable the mobile nodes in the network to keep the current gymnastic formation moving toward the target point after completing the gymnastic formation transformation, this paper uses the l-φ closed-loop control method to modify the gymnastic formation in real time. The method based on the received signal strength is selected to realize the positioning of the beacon node to the mobile node, and combined with the positioning engine in the core processor CC2431 of the mobile node, efficient and low-energy wireless positioning can be realized. Multiple mobile nodes coordinate with each other to control communication between each node in a wireless manner, and sense their own heading angle information through geomagnetic sensors, so as to make judgments and adjustments on the maintenance and transformation of the current gymnastics formation. During the formation change, after analysis, it is concluded that the maximum offset of Follower2 from the ideal path in the process of traveling to the desired position in the triangular queue is + 0.28 m. This research effectively realized the computer simulation of autonomous formation.


Introduction
Wireless sensor network has the advantages of low cost and simple node layout, while mobile gymnastics has strong initiative.Researching the formation control problem of multi-mobile gymnastics under wireless sensor network is to combine the advantages of wireless sensor networks and multi-mobile gymnastics groups.It makes the multimobile gymnastics formation control more effective and reliable, and the efficiency of completing tasks is also higher.Therefore, the research on multi-mobile gymnastics formation control based on WSN deserves to be further deepened.
Whether in the scientific research of universities or the military field, the increase in investment in this area shows that the research boom of wireless sensor networks has entered a new height.At present, WSN technology has been used in various aspects such as warehouse monitoring and expedition and disaster relief.It can also be applied to a wider range of areas according to different environments and tasks, leading researchers to continue in-depth exploration and make research into one brand new stage.
Behera SK proposed a method to analyze 3D signatures captured using Leap motion sensors.He extended the original 2D function from the original signature to 3D and applied a well-known classifier for identification and verification.Although he used the Leap motion interface to create a large data set containing more than 2000 signatures registered by 100 volunteers, his research method is still not new enough [1].Motion sensor technology and automatic fall detection systems have become reliable and lowcost solutions for falls.Yu S has developed a fall detection system based on hidden Markov model (HMM), which can use a single motion sensor to automatically detect falls for actual home monitoring scenarios.He proposed a new representation for the acceleration signal in HMM to avoid feature engineering and developed a sensor orientation calibration algorithm to solve the problem of sensor misalignment in actual scenes.The HMM classifier is trained to detect falls based on the acceleration signal data collected from the motion sensor.Although he collects data sets from experiments that simulate falls and normal activities, the research process lacks theoretical foundation [2].Shen C studied the reliability and applicability of active and continuous smart phone authentication using motion sensor behavior in various operating scenarios, and systematically evaluated the uniqueness and durability of the behavior.Although he provides accurate and fine-grained representations of user touch actions, his research process lacks data [3].Yurtman A proposed a novel non-iterative direction estimation method based on the physical and geometric characteristics of acceleration, angular velocity, and magnetic field vector to estimate the direction of the motion sensor unit.He obtains the orientation of the sensor unit according to the rotation quaternion transformation between the sensor unit frames.He evaluates the proposed method by incorporating it into the activity identification scheme for daily and sports activities.Although his scheme needs to accurately estimate the direction of the sensor unit to achieve the invariance of the direction the unit is worn on the body, the research process lacks experimental data [3].Signature recognition is to identify the owner of the signature, and verification is the process of finding the authenticity of the signature.Although both are important in the field of forensic science, verification is even more important for banks and credit card companies [4].
Today, with the rapid development of the information age, the exchange of science and technology has brought closeness between countries, and our country has also begun to conduct in-depth research on WSN.This research mainly discusses the computer simulation algorithm of gymnastics formation change path based on wireless sensor.In this research, an improved Leader-Follower method is designed.In the research of gymnastics formation transformation of mobile nodes in the wireless sensor network environment, the traditional three types of nodes are divided into four categories according to the different formation responsibilities, namely, coordinator, beacon node, master mobile node (Leader), and slave mobile node (Follower).After it accurately locates itself with the help of the information of the beacon node, the information should be sent out in the form of broadcast, and the coordinator sends the information to the host computer through the serial port for tracking display.In order to enable the mobile nodes in the network to keep the current gymnastic formation moving toward the target point after completing the gymnastic formation transformation, this paper uses the l-φ closed-loop control method to modify the gymnastic formation in real time.The method based on the received signal strength is selected to realize the positioning of the beacon node to the mobile node, and combined with the positioning engine in the core processor CC2431 of the mobile node, efficient and low-energy wireless positioning can be realized.Multiple mobile nodes coordinate with each other to control communication between each node in a wireless manner, and sense their own heading angle information through geomagnetic sensors, so as to make judgments and adjustments on the maintenance and transformation of the current gymnastics formation.

Wireless sensor
Generally, when researchers choose sensor positions, they often only consider the importance of different sensor positions to the action category.When a position is selected, the subsequent position selection will be selected according to the importance of the remaining position to the action category [5,6].If each position is not related to each other, then there is no problem with this method.However, in practice, the positions are related to each other, and they may contain the same information.If only the correlation between the sensor position and the action category is considered, the result will be positions that cause serious overlap are selected at the same time, the importance is relatively small but the position and the selected position do not have any overlap are often ignored, so that some action categories that can only be distinguished by the ignored position cannot be well recognized [7].When a single-turn optical fiber coil with a diameter of D rotates, two light waves are emitted clockwise (CW) and counterclockwise (CCW) from point P of the circular optical path, then: Among them, c is the speed in vacuum [8].Assuming that the node has unlimited energy storage capacity, the energy collected by the node in the time period [t 0 , t 0 + ΔT] is: Among them, t 0 is the starting point of energy harvesting time [9].Suppose the maximum stored energy of the node is N max , then the remaining energy after the energy is collected is: In most cases, the motion state of the target in a short period of time will not change much, so the following approximate constant velocity model can be used to describe the target motion [10]: Among them, The prediction of the target by the extended Kalman filter is [11]: The predicted value of the target state at time step k + j is [12]: The predicted value of the corresponding error covariance is [13]: The Kalman gain is: Among them, R(k) is the Jacobian function of the measurement function at time T [14].

Mobile node positioning
Ranging methods mainly include TOA method, TDOA method, AOA method, and RSSI algorithm [15,16].The AOA method is based on the principle of the angle of arrival of the signal, and the antenna array on the node realizes the angle acquisition.This method has high accuracy, but the node energy consumption is high, the cost is high, and the practical value is low [17].The RSSI method is based on receiving positioning based on the principle of signal strength indicator converts the loss caused by the signal in the transmission process into the corresponding distance, which requires low hardware, but in the wireless transmission process, the acquisition of the RSSI value is relatively simple and low in cost.A more commonly used method in wireless sensor network positioning [18,19].The mobile node identification is shown in Fig. 1.Feature extraction is often based on a certain decision rule used in classification as a criterion to extract features to minimize the classification error under a certain criterion [20].
Take x i as a sample of training data set E(r x ) [21,22].
Here, p(f i ) and p(f j ) are the probability distributions of features f i or f j [23].
Here, L(U, V) is the Euclidean distance of the cluster center [24,25].μ is called a weighted index, which may affect the clustering effect of FCM.Generally speaking, time series multi-step (long-term) forecasting refers to the forecast of multiple data points in the future [26].
3 Computer simulation algorithm experiment of gymnastics formation change path (1) RSSI positioning

Positioning realization of the mobile node
The method based on the received signal strength is selected to realize the positioning of the beacon node to the mobile node.Combined with the positioning engine in the mobile node core processor CC2431, it can achieve efficient and low-energy wireless positioning [27].The formation algorithm between each mobile node can be processed.Keep a certain formation moving toward the target point, and at the same time, if a command to change the formation is received, the current formation will be adjusted according to its own position until it is adjusted to the desired formation.
In the positioning experiment, it is necessary to select an appropriate value of N to achieve accurate positioning.However, since the value of N is very susceptible to interference from environmental factors, it is relatively difficult to obtain its value.The most common method is to test all networks at the test site.The nodes inside are tested in turn.Although this method is cumbersome, it can select an accurate N value for positioning.Since the value of the propagation coefficient N is greatly affected by the environment, in actual positioning, the parameter N_index is often used instead of the N value to perform positioning calculations to reduce errors caused by environmental interference.For the CC2431 positioning engine, the expected value of parameter A is between 30 and 50, and the value of N_index is between 15 and 25.Finally, the current position is displayed on the host computer, and each packet of data transmitted wirelessly contains the short address of the node itself, so that the node information will not be confused.
(2) Realization of mobile node positioning based on RSSI In wireless sensor networks, beacon nodes provide blind nodes with position coordinates and RSSI values, and the received signal strength is easily affected by environmental factors.Therefore, a reasonable layout of beacon nodes is required to ensure that blind nodes can use the beacon.The information provided by the target node calculates its accurate position.In this subject, 16 beacon nodes are selected in a 20 × 20 m experimental site to locate the mobile nodes, and the distance between adjacent beacon nodes is 5 m.The beacon nodes are all distributed at the outer contour of the area, and no beacon nodes are placed in the movement area of the mobile node.This layout makes it unnecessary for the mobile node to consider obstacle avoidance during the travel process, which simplifies the overall complexity of the system.
After the core processor CC2431 of the mobile node receives the data packet sent by each beacon node, it arranges the RSSI value in it in descending order and selects the top 8 data.If it is not due to external interference or other reasons, if the data information of more than 8 beacon nodes can be obtained, all current beacon nodes will be sorted and processed.At the same time, the program is designed such that the mobile node receives 6 data packets within 300 ms, and then uses the average filtering method to smooth the RSSI value to ensure positioning accuracy.

Z-Location positioning monitoring
When the preliminary work of positioning is ready, the system can be started for wireless positioning, and the monitoring of the upper computer and analysis of positioning errors can be performed with the help of Z-Location Engine software.You can change the position coordinates of the beacon node in the coordinate system in Reference Node Setup on this interface.After the setting is completed, the beacon node will remember its position, which can be used directly in future experiments.After the software is turned on, you can observe the coordinates (X, Y) of the current mobile node at BlindNodeSetup, compare this coordinate with the actual position coordinate, calculate the error between the true value, and change these two parameters through the A and N input fields the value of will get the new coordinates of the mobile node.Repeat this operation until the values of A and N are changed to values suitable for the current experimental site.This not only finds the appropriate A and N values, but also improves the accuracy of positioning.

Coordinated control of multiple mobile nodes
The mobile node obtains its own pose information from the beacon node through the communication mechanism, and at the same time, each mobile node exchanges information to realize information sharing.When a node in the system receives the status information of other members in the system, it calculates and processes it, and combines its own perception of the environment to make corresponding behavior plans, so that each member in the system can achieve expectations through collaboration of the goal Multiple mobile nodes coordinate with each other to control communication between each node in a wireless manner, and sense their own heading angle information through the geomagnetic sensor, so as to make judgments and adjustments on the current formation and transformation conditions.
The cooperative control of multiple mobile nodes is mainly embodied in that when the mobile node perceives the external environment information and receives the pose information of other nodes, it influences the behavior of other mobile nodes through its own decision-making and planning.The coordinated control of multiple mobile nodes mainly studies the two-party recognition results

1)
In the process of collaborating to complete a certain task, how to make each node maintain a consistent goal; 2) How to avoid conflicts and deadlocks in behavior planning between nodes when running to a consistent target point and what measures should be taken to effectively eliminate conflicts or deadlocks.
The multi-mobile node coordinated control system established with the above two aspects as the core will be able to complete the overall task of the system efficiently with good dynamics, adaptability, and flexibility.

Formation reference points
In order for the mobile node to have a corresponding adjustment mechanism for the maintenance and transformation of the formation in the process of moving to the target point, it is necessary to select suitable reference points for these mobile nodes.In this way, each mobile node can determine its own position and the position of the reference point.After calculation and processing, reasonable adjustments can be made to maintain the formation and make corresponding changes.In general, there are three methods for selecting reference nodes: taking the navigator as the reference point, taking the adjacent node as the reference point, and taking the geometric center as the reference point.
The selection method based on the navigator as a reference point can provide reference for other nodes without resorting to a large amount of communication.The communication is simple and the control is convenient.This method is used to realize the formation maintenance and formation transformation of the mobile nodes in the wireless sensor network.Taking the navigator as a reference, each mobile node adjusts its position autonomously to achieve the purpose of maintaining and changing the formation.

Improved Leader-Follower method design
This paper chooses the Leader-Follower method to study the formation transformation and formation maintenance of mobile nodes.This paper designs an improved Leader-Follower method.In this research, the traditional three types of nodes are divided into four types according to the different formation responsibilities in the research work of the formation transformation of mobile nodes in the wireless sensor network environment, namely, the coordinator, beacon node, master mobile node (Leader), and slave mobile node (Follower).These four types of nodes have a clear division of labor in the network.
Since the functions of the beacon node and the coordinator have not changed, this article focuses on the analysis of the functions of the master mobile node and the slave mobile node.First of all, for the master mobile node, as the leader of other nodes in the network, its fundamental task is to provide references for its followers.
After it accurately locates itself with the help of the information of the beacon node, the information should be sent out in the form of broadcast, and the coordinator sends the information to the host computer through the serial port for tracking display.The pose information sent by the master mobile node to the slave mobile node in real time includes three types of information, namely, the current position coordinates of the master mobile node, the current speed, and the current formation to be maintained or formed.
When the mobile node is traveling to the target point, it receives the formation change command from the coordinator.This command is a point-to-point communication between the coordinator and the master mobile node, and the slave mobile nodes in the network will not receive the command.The slave mobile node can obtain the related transformation of the formation from the pose information sent to it in real time by the master mobile node, because the slave mobile node needs to make realtime adjustments to the path during the formation transformation.After a series of positioning calculations, the mobile node transmits its position information to the coordinator in a point-to-point manner.At the same time, it needs to receive the leader's pose information in real time, calculate its distance and angle, and extract the information transmitted by the main mobile node.Determine whether the current formation information is consistent with the formation at the previous moment.If it is inconsistent, the formation needs to be changed.According to the formation information, the corresponding expectation matrix is selected as the target to adjust its position.

Formation maintenance of mobile nodes
In order to enable the mobile nodes in the network to maintain the current formation and move toward the target point after completing the formation change, but in the process of travel, due to the interference of various factors in the road conditions and the environment, one or the other will inevitably appear.Thousands of mobile nodes are left behind.Therefore, this paper adopts the l-φ closed-loop control method to correct the formation in real time, and maintain the formation of the mobile node group during the walking process, so that the current follower will be between the current leader and the leader.Adjust the distance and included angle to the desired value l and φ.As long as the follower successfully receives the pose information sent by the leader, the l-φ controller can maintain a certain distance and angle with the leader, so that the formation can be maintained.The slave mobile node compares its own pose with the expected value and realizes the correction of the formation through the feedback of the current position and angle error, which ensures the stability of the formation.Closed loop control is shown in Fig. 2.

Positioning analysis based on RSSI
N is the signal propagation index.As the distance increases, the signal strength will decrease; A is the RSSI value when the beacon node is 1 meter away from the mobile  node.The value is often fixed, and the unit is dBm.In the host computer monitoring software used in the positioning experiment, the N value and A value can be filled in by the user [28].Therefore, appropriate parameters should be selected according to the environmental characteristics of the test area to achieve the purpose of minimizing the positioning error.Table 1 shows the data of the correspondence relationship between N and N_index.
In the multi-mobile formation software and hardware positioning platform designed in this paper, the mobile formation with the CC2341 chip as the blind node needs to use the beacon node closest to itself for positioning.Generally, when 3-8 beacon nodes are received, positioning signal can minimize the error of the positioning result, which not only avoids channel redundancy caused by too many signals, but also prevents too few beacon nodes from receiving positioning information as reference information for mobile nodes.The sensor node control is shown in Fig. 3.

Simulation and analysis of formation transformation under ideal conditions
Assuming that the gymnastics formation is 5 gymnastics forming a regular triangle, the coordinates of each gymnastics are R, (0, 0), R2 (− 2.6, 1.5), R (− 2.6, − 1.5), R (− 5.2, 3), R (− 5.2, − 3), the specific transformation rules for the upper half of the formation are shown in Table 2, and the transformation rules for the lower half are the same as the upper half.The simulation of transforming the column into a triangular queue is shown in Fig. 4. In the simulation, a fixed pattern is set for each formation, and angles and distances are used to describe the formation, that is, the angle formed by the first column of the follower and the leader relative to the forward direction in the matrix expression and the second column of the follower and distance between the pilots, these parameters can be changed in the program to adjust the formation.Before the simulation, the parameters should be set, and the number of mobile nodes should be set to 3. At the beginning of the operation, the mobile nodes will keep the column forward to the target point.
The error of each mobile node's trajectory relative to the ideal path is shown in Fig. 5.After the mobile node receives the command to transform into a triangular queue, it immediately adjusts its position.Leader makes a corresponding deceleration operation, reducing the 0.3 step length to 0.1 step length to advance, Follower1 and Follower2 start to accelerate, and finally adjust to a triangular team.In the simulation, the triangular queue is set as follows: Follower1 and Follower2 are both 6 m away from Leader, the angle between Follower1 and Leader relative to the forward direction is 45°, and the angle between Follower1 and Leader relative to the forward direction is − 45°.During the formation change process, the analysis shows that the maximum offset of  Follower2 relative to the ideal path in the process of traveling to the desired position in the triangular queue is + 0.28 m, the maximum offset of Follower1 is + 0.15 m, and the leader's offset is within + 0.26 m.It can be seen that the offset error of Follower2 is the largest relative to other nodes.By analyzing the factors that affect the positioning effect, optimizing the corresponding parameters can reduce the positioning error and improve the positioning accuracy.The positioning test is carried out in different environments, and the positioning effect will be different.Therefore, in the experimental test, you can flexibly modify the A value and N value in the RSSI positioning principle formula in the host computer monitoring interface according to the changes in the environment, so as to achieve more good positioning effect.The results of the ranging error are shown in Table 3.
The simulation of transforming a triangle to a horizontal team is shown in Fig. 6.The triangle queue in this simulation is set as follows: Follower1 and Follower2 are both 6 m away from the Leader, and the angle between Follower1 and Leader with respect to the forward direction is 30°, and the angle between Follower1 and Leader is 30°.The angle of the advancing direction is − 30°.After receiving the formation transformation command, each mobile node adjusts the position of the distance and angle in the horizontal expectation matrix.This article sets the parameters in the horizontal expectation matrix as follows: Follower1 and Follower2 are both 5 m away from the Leader, and the distance between Follower1 and Leader relative to the forward direction The included angle is 90°, and the included angle between Follower1 and Leader relative to the forward direction is − 90°.

Leader-Follower analysis
The error comparison between the improved Leader-Follower and the traditional Leader-Follower is shown in Table 4.The data in Table 4 shows that the average error rate of the improved Leader-Follower method (1%) is 0.094, the average error rate of the improved Leader-Follower method (0.1%) is 0.007%, and the average error rate of the traditional Leader-Follower method is 3.520 %.It can be seen that the traditional Leader-Follower method can greatly reduce the average error after improving the accuracy, and because the Leader-Follower error is uncontrollable, there is still a large error after increasing the number of iterations, which is not suitable for low-error situations, so in terms of capacity limiting efficiency It is significantly higher than the traditional Leader-Follower method.
In this comparative study, in terms of formation transformation, the convergence time of formation transformation using the algorithm of this paper is 5 s, the convergence time ratio of formation transformation is 5.4%, and the formation expansion transformation is performed, so the formation structure difference before and after the transformation is 0.67.All gymnastics have advanced a total of 32.6 m during the formation change process; the used algorithm formation change convergence time is 7.55 s, and the formation change convergence time ratio is 8.1%.The formation change changes the original formation structure.The team before and after the change The degree of difference in form structure is 2.51, and all gymnastics formations have advanced 46.2 m in total during the transformation process.The formation change time is shown in Table 5.
The result of accumulating the total utility cost of the whole simulation process is shown in Table 6.It can be verified that the task modeling method proposed in this research is less effective than traditional methods.
When the number of mobile nodes is set to 4, the simulation of transforming from a wedge queue to a square queue is shown in Fig. 7.The initial formation is a wedge, and its parameter setting is: the distance between Follower1 and Leader is 4 m.After receiving the formation change command, adjust the position.The parameters of the square queue are set as follows: the distance between Follower1 and Leader is 5 m, the angle relative to the forward direction is 90°, the distance between Follower2 and  Leader is 7.07 m, and the angle is 45°.The distance between Follower3 and Leader is 5 m, and the included angle is 0°.The distance to the Leader is 5 m, and the error in the transformation process is shown in Fig. 8.The maximum deviation between the formation change trajectory of Follower1 and the ideal path is + 0.14 m, the maximum deviation of Follower2 is + 0.19 m, the maximum deviation of Follower3 is + 0.25 m, and the maximum deviation of Leader is + 0.21 m.Compared with the transformation from the column to the triangular queue, the average deviation is also reduced.This is because the adjustment rate of each node is significantly smaller than that of the column to the triangular queue from the wedge to the square, so the adjustment of the position of each mobile node is very small, which reduces the deviation.

Conclusion
Today, with the rapid development of the information age, the exchange of science and technology has brought closeness between countries, and our country has also begun to conduct in-depth research on WSN.This research mainly discusses the computer simulation algorithm of gymnastics formation change path based on wireless sensor.In this research, an improved Leader-Follower method is designed.In the research of gymnastics formation transformation of mobile nodes in the wireless sensor network environment, the traditional three types of nodes are divided into four categories according to the different formation responsibilities, namely, coordinator, beacon node, master mobile node (Leader), and slave mobile node (Follower).After it accurately locates itself with the help of the information of the beacon node, the information should be sent out in the form of broadcast, and the coordinator sends the information to the host computer through the serial port for tracking display.In order to enable the  mobile nodes in the network to keep the current gymnastic formation moving toward the target point after completing the gymnastic formation transformation, this paper uses the l-φ closed-loop control method to modify the gymnastic formation in real time.The method based on the received signal strength is selected to realize the positioning of the beacon node to the mobile node, and combined with the positioning engine in the core processor CC2431 of the mobile node, efficient and low-energy wireless positioning can be realized.Multiple mobile nodes coordinate with each other to control communication between each node in a wireless manner, and sense their own heading angle information through geomagnetic sensors, so as to make judgments and adjustments on the maintenance and transformation of the current gymnastics formation.This research effectively realized the computer simulation of autonomous formation.

Fig. 5
Fig. 5 error of each mobile node's trajectory relative to the ideal path

Fig. 4
Fig. 4 Simulation of transforming a column into a triangular queue

Fig. 6
Fig. 6 Simulation of transforming from triangle to horizontal team

Fig. 7
Fig.7When the number of mobile nodes is 4, the wedge queue is transformed into a square queue

Table 1
Correspondence between N and N_index Chen et al.EURASIP Journal on Advances in Signal Processing (2021) 2021:53

Table 3
Comparison of ranging error results

Table 5
Formation time

Table 4
Error comparison between the improved Leader-Follower and the traditional Leader-Follower

Table 6
The result of adding up the total utility cost