{'fraction_non_alphanumeric': 0.027367674553542647, 'fraction_numerical': 0.005125394881052157, 'mean_word_length': 4.88448406676783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Dynamic Compressed Sensing of Unsteady Flows with a Mobile Robot

Large-scale environmental sensing with a finite number of mobile sensors is a challenging task that requires a lot of resources and time. This is especially true when features in the environment are spatiotemporally changing with unknown or partially known dynamics. Fortunately, these dynamic features often evolve in a low-dimensional space, making it possible to capture their dynamics sufficiently well with only one or several properly planned mobile sensors. This paper investigates the problem of dynamic compressed sensing of an unsteady flow field, which takes advantage of the inherently low dimensionality of the underlying flow dynamics to reduce number of waypoints for a mobile sensing robot. The optimal sensing waypoints are identified by an iterative compressed sensing algorithm that optimizes the flow reconstruction based on the proper orthogonal decomposition modes. An optimal sampling trajectory is then found to traverse these waypoints while minimizing the energy consumption, time, and flow reconstruction error. Simulation results in an unsteady double gyre flow field is presented to demonstrate the efficacy of the proposed algorithms. Experimental results with an indoor quadcopter are presented to show the feasibility of the resulting trajectory.


I. INTRODUCTION
Environmental sensing is an important problem with a wide range of applications ranging from long-term observations like climate change monitoring and agricultural automation to short-term use cases such as disaster management and civil surveillance. The ability to generate and interpret data of a large environment promptly using very few sensors would save time and resources in many reallife applications. For applications such as marine observatories [1]- [3] and disaster information gathering, time and operational cost are critical considerations. It is necessary to be able to understand the environment properties efficiently with limited resources.
Large-scale environmental sensing often lead to high demands for data collection due to the large dimensionalities of the target signals. Fortunately, most meaningful signals, such as images and audio, are inherently very sparse (containing mostly zeros or value small values) when transformed in another domain (For example, Fourier, wavelet, discrete cosine transform). Most of those "zeros" can be ruled out, which means that a very small portion of the original data is retained containing the information of the entire signal. Compressed sensing avoids the unnecessary measurements by taking a very small sample of randomized measurements and reconstructing the overall information efficiently. The primary performance metric is the reconstruction efficiency, which measures how well the reconstructed signal matches the original.
Most related research in this relatively young field with vast applications builds on the pioneer works of Donoho [4], Candes et al. [5], [6], Baraniuk [7], or Berkooz et al. [8]. Clark et al. [9] presented a pivoted QR-based greedy algorithm to place sensors for reconstruction with a cost constraint on sensor locations. Manohar et al. [10] presented an extension of the multi-resolution dynamic mode decomposition (mrDMD) as a principled framework for understanding the optimal placement of sensors in complex spatial environments and/or networked configurations. Sparse representation in a library of examples with historical flowfield data with tools like proper orthogonal decomposition (POD) was used to develop methods for flow-field reconstruction in [11]- [13]. Collaborative and compressed mobile sensing algorithms for distributed robotic networks to perform spatial sampling of a environmental field and build a map were presented in [14]- [17]. Brunton et al. [18] presented an approach to classify between data classes using optimal sensors designed from substantially subsampled data, which informs the feature-based classification. Salam and Hsieh [19] presented an approach leveraging the dynamics to determine the adaptive sampling and estimation process using mobile robots. Zhang and Vorobeychik [20] proposed a generalized cost-benefit (GCB) greedy mobile robotic sensing algorithm for making select sensor measurements to make predictions about an infeasible location in the environment. Weiss [21] discussed the mathematical framework, discussion and examples of POD and its use in fluid dynamics and aerodynamics. In this work, we use POD modes to compute the reconstruction error for the subset sensing locations and the mobile sensor trajectories. This paper presents the concept of dynamic compressed sensing (DCS), which is motivated by the question: "Why do we need to place static sensors if we do not need persistent coverage of the sensing locations?". DCS is based on the hypothesis that dynamic measurements made at the right location and time are sufficient for flow reconstruction. Thus, instead of deploying static sensors at those locations, even fewer numbers of robots can be deployed to visit the optimal sensing waypoints along an optimal trajectory to collect the sensing data. Furthermore, these systems can be used to explore and identify environmental dynamics with little or no prior knowledge about the environment. An example Fig. 1. Illustration of dynamic compressed sensing for flow mapping with an autonomous underwater vehicle. The dots represent the optimal sensing locations determined by the compressed sensing algorithm. To collect the flow information, an optimal trajectory with the shown starting location (square) and the destination (triangle) will be chosen for the vehicle to traverse through the optimal locations as waypoints. application scenario is shown in Fig. 1, where an autonomous underwater vehicle is deployed to traverse through a set of optimal sensing waypoints (marked by dots) for efficient data collection. The trajectory can be optimized for specific objectives such as the minimization of time, actuation energy, or reconstruction error.
Trajectory generation and optimization in strong background flows is another well-researched topic. For instance, Inanc et al. [22] presented an approach for optimal path planning of autonomous underwater vehicles by studying the global flow geometry via dynamical systems methods. Senatore et al. [23] presented an algorithm for a vehicle to track a Lagrangian coherence structure (LCS), considering this a time-dependent boundary following problem. Lolla et al. [24] proposed a partial differential equation based methodology that predicts the time-optimal paths of autonomous vehicles in a dynamic flow. Hsieh et al. [25] presented a navigation strategy for a team of mobile sensing agents in a stochastic geophysical fluid environment using nonlinear dynamical systems tools and the LCS. Ataei and Yousefi-Koma [26] presented an algorithm that generates three-dimensional optimal paths offline for waypoint guidance of a miniature AUV.
The proposed approach extends and combines compressed sensing and trajectory optimization to formulate a solution to large-scale flow sensing problems. We focus on demonstrating the feasibility of DCS and assume prior knowledge about the flow field is available to allow the extraction of its POD modes. An iterative compressed sensing algorithm identifies a small set of optimal sensing locations by minimizing the flow reconstruction error using only flow observation at these sensing locations. A trajectory optimization algorithm then uses these sensing locations as waypoints to generate an optimal trajectory for a mobile sensor. The objective is to further minimize the reconstruction error by taking measurements along the entire trajectory, the overall energy cost of the trajectory, and the total time along the trajectory. The major contributions of this work are: (i) Dynamic compressed sens-ing of a flow field using mobile robot, (ii) Optimal trajectory planning based on POD based reconstruction, (iii) Use of a mobile sensor to perform compressed sensing instead of multiple static sensors to reconstruct a time-varying unsteady flow field, (iv) emulated experimental demonstration using a indoor robotic system.

II. PRELIMINARIES
The proposed DCS method for flow field sensing consists of two stages: (i) waypoints generation using compressed sensing, and (ii) trajectory optimization for POD-based flow reconstruction. In this section, we provide a brief overview of the fundamentals about compressed sensing and POD.

A. Compressed Sensing
Compressed sensing is a method to reduce the number of sensors compared to a full-scale sensor deployment, while still efficiently reconstructing a signal. Compressed sensing theory asserts that, under certain conditions, one can recover the signals with far fewer samples than required by the Nyquist-Shannon sampling theorem [4]. Mathematically, compressed sensing finds the coefficients of a large sparse vector which is consistent with the highly-reduced, randomly-sampled measurements and then use the equivalency of that sparse vector to invert it to recover the original signal using an appropriate transform basis. This approach is primarily based on the assumption that the signals under consideration are inherently sparse and compressible, which is almost always the case for most natural signals.
Let us consider the case where data from a large set of n possible measuring locations is represented by the data vector x ∈ R n . This data vector can be represented in an alternate transform domain using a universal transform basis Ψ ∈ R n×n and a vector s as Vector s ∈ R n is k-sparse since it contains k (k n) nonzero elements for the data in x in the transformed domain. The data representations x and s are equivalent and can be transformed back and forth using Ψ. The objective of compressed sensing is to find x (full-sized signal) using a highly reduced measurement subset y ∈ R m , where k < m n, such that Here C ∈ R m×n is the measurement matrix, which essentially acts as a data mask for Ψs to excite its columns and generate the sparse vector s that is most consistent with the measurement vector y. The matrix C is usually chosen to be a random matrix (for example random delta impulses, random Gaussian, Bernoulli) to excite most columns of Ψ for better reconstruction. For efficient reconstruction, the number of measurements has to be higher than k, which is given by m ∝ O(klog(n/k)). Also, since k < m n, the problem is under-determined, and there are infinitely many possible solutions for s that would be consistent with y. The objective is to obtain the sparsest s through the following optimization problemŝ = argmin where γ is a weighting constant for the added penalty term. This can be recast intô In the case where measurement noise ( ) is present, the optimization constraint becomes ||CΨs − y|| 2 < . It is to be noted that the optimization problem intends to minimize the L 1 -norm of s, instead of the L 2 -norm. Although the L 2 -norm can generate the lowest reconstruction error, it keeps all the coefficient in s active by spreading the error, which is not desirable for sparsity. On the other hand, L 0 -norm simply counts the non-zero coefficients by definition, but it makes the resulting optimization problem non-convex. Consequently, the L 1 -norm is used, as it tends to intersect the solution space of the under-determined problems like this at sparse solutions, and hence promotes sparsity of s, which is crucial for the optimality of the subsampled sensing location set.

B. Proper Orthogonal Decomposition (POD)
We reconstruct the flow field and quantify the reconstruction error using the proper orthogonal decomposition (POD) modes, which can be obtained from existing flow models or historical data of the target area assumed to be known in this work. One of the major objectives of POD is to decompose the vector field representing turbulent fluid motion into a set of deterministic functions (POD modes) with different time and length scales that each captures portion of the total kinetic energy of the flow, with a goal to provide some inside about the organization and composition of the flow [21].
Let us denote the 2D position by x = (x, y), velocity by u = (u, v), and time by t. For a flow velocity vector field u (x, t), where u ∈ R n is the centered flow velocity given by u minus its temporal meanū, the proper orthogonal decomposition (with r ≤ n modes) is performed as where φ k (x) are the POD modes and a k (t) are their modulating time coefficients. These modes can be obtained by performing singular value decomposition (SVD) of the data matrix X ∈ R m×n . Alternately, it can be obtained by eigenvalue decomposition of the covariance of the data matrix. The covariance X c is obtained as and the eigen-decomposition of the covariance matrix can be found as where Λ ∈ R m×m is a diagonal matrix with the eigenvalues λ i as the diagonal terms and V ∈ R m×m are the vector of eigenvalues and column matrix of eigenvectors, respectively. The POD modes can be calculated as λ i v i , where λ i and v i are the i-th eigenvalue and eigenvector, respectively. As the data is sparse, very few of these modes constitute most of the flow field's total energy, hence most of the information of the data matrix. The temporal behavior of the modes can be obtained by which can be used to check the energy level of each mode at a given time instant while considering a sensing location's contribution to reconstruction. Each location contributes to the energy of each mode in some capacity at every instant, and that is what provides for the reconstruction efficiency. For a time series data matrix X, where each row contains the full time series data for at a given location, the coefficients of POD modes are time-dependent, reflecting the timedependency of unsteady flow fields. These POD modes are natural coordinates inherent to the flow field that allow for sparse representations and reconstruction. These modes will also be used to calculate the reconstruction errors in Section III-A and Section III-B.

III. METHODOLOGY
The proposed DCS-based flow sensing algorithm can be divided into two stages. In the first stage, the user defines a compressed sensing algorithm selects an optimal set of sensing locations over the area while minimizing the reconstruction error using only measurements at these locations. The total number of sensing location can be prescribed or automatically decided by the optimization through thresholding. In the second stage, a trajectory generation and optimization algorithm then generates an optimal trajectory passing through those sensing locations as waypoints while minimizing the total actuation energy, the total travel time, and flow reconstruction error, as discussed below, and summarized in Algorithm 1.

A. Dynamic Compressed Sensing
The selection of optimal sensing locations using compressed sensing is governed by (2) and (4), as discussed in Section II-A. To compute the transform matrix Ψ, the SVD of the reference data matrix X ∈ R m×n is computed and the left singular matrix is used as Ψ, that is, and Ψ = U . Each column of X represents a time snapshot of the entire flow field. The Ψ matrix is used with a randomized measurement matrix C ∈ R m×n , where n and m are the original and down-sampled data dimensions, respectively, and m n. The optimal set of subsampled sensing locations,ŝ, can be found from (4). The sparse vectorŝ is then sorted, and the locations corresponding to the m largest entries inŝ. Since a randomized measurement matrix is used,ŝ is only optimized for the an instance of the measurement matrix. An iterative step is added to further optimize among multipleŝ solutions obtained from different random instances of measurement matrix based on based on the reconstruction performance. The algorithm tests a prescribed number of location subsets and calculates the reconstruction error for each one, and finally chooses the one with best reconstruction performance. For reconstruction using N 1 sensor locations, the approximated measurement at a sensing location x i , i ∈ [1, 2, . . . , N 1 ] using N 2 POD modes φ k , k ∈ [1, 2, . . . , N 2 ] is given bŷ The net flow reconstruction error for the sensor subset, can then be minimized, where u * is the true flow velocity, which is used in (10) to calculate the POD mode coefficients (a k (t)). The approximated flow velocity values for the grid (û) are then calculated using a k (t) and the corresponding POD modes (10).
Once the reconstruction errors for all the trials are obtained, the waypoint set corresponding to the smallest reconstruction error is chosen as the optimal solution (y * ) for most effective reconstruction. The core idea of dynamic compressed sensing is to define an optimal trajectory for the mobile robot through these locations as waypoints, instead of placing static sensors. The robot takes measurements along the trajectory, which is then used for reconstruction of the entire environment.

B. Trajectory Optimization
Trajectory planning takes into account the minimization of the flow reconstruction error, energy cost, and time, while enforcing the robot to traverse through all the designated waypoints along a smooth trajectory. The trajectory is constrained to be a piece-wise continuous spline. The state vector of the optimization problem is defined as p = [x T , t] T , such that, p(t i ) = [x(t i ), y(t i )] T . The set of m optimal sensing locations (waypoints) is defined as y * = [p T 1 , p T 2 , . . . , p T m ] T . Equality constraints are used to enforce the trajectory passing through all sensing locations, and its setup has been shown in Fig. 2. The prescribed starting and goal locations are denoted by g 1 and g 2 , respectively, such that, g = (x, y) T . After the segments between the consecutive waypoints are defined, the last time step of each segment of the trajectory z has to coincide with the corresponding waypoint, that is, z(t  Fig. 2. Illustration of a sample trajectory set up for optimization. The square, triangle, star and the dot markers denote the starting location (g 1 ), the goal location (g 2 ), the optimal waypoints to be visited in a prescribed sequence (y * k , k ∈ 1, 2, . . . , m) and the trajectory time instants (z(t i )), respectively. The trajectory (including g 1 and g 2 ) with total T time steps is divided into (m + 1) segments of equal time instants. The i-th time step of the k-th segment is denoted as t error is calculated as This is done in following steps: (i) Using the POD modes represented on a mesh grid to interpolate the modes values at x(t i ), (ii) solving (10) for coefficients a k (t i ), and (iii) calculating the approximate measurements at x(t i ) using the approximated POD modes. The error is then accumulated over the entire trajectory as Another important metric to minimize is the energy (fuel) cost for the robot to navigate through the flow field along the trajectory. The relative velocity between the robot and the background flow in the deployed environment provides the kinetic energy required for the robot to move, which is accumulated over the trajectory to arrive at a net energy cost term, where ν(t i ) is the velocity of the vehicle at time t i . The overall cost function for trajectory optimization is given by where α 1 , α 2 , and α 3 are tunable weighting constants for each of the cost terms and D is the total time taken (duration) for the trajectory, i.e., D = t f . The optimization problem can then be formulated as

IV. SIMULATION RESULTS
This section presents the simulation results for application of the proposed approach on a periodic double gyre flow environment, which is inherently unsteady, making the optimization highly non-linear and challenging. The results

14:
Define optimization cost function (J j ) (12) - (15) 15: Solve optimization problem for z * j (16) present the details and the performance of the compressed sensing algorithm for selection of optimal waypoints, generation and implementation of an optimal trajectory through those waypoints and a comparison between the performance of the system with the number of prescribed waypoints as the variable and the components of the optimization function costs (reconstruction error, energy and total time taken) as the metric.

A. Implementation on Unsteady double gyre Flow
The proposed algorithms for generation of optimal waypoints and an optimal trajectory through those to observe the flow field for effective reconstruction of the entire environment were implemented on a periodic double gyre flow field. The double gyre is an unsteady flow field well studied in the fluid community for chaotic mixing and material transport. It resembles real-world flow phenomena often found in atmospheric and oceanic flow environments and bears an analytical expression, making it an ideal benchmark environment to test our algorithms.
The double gyre flow field is defined by the stream function, The velocity field is given by where A determines the magnitude of the velocity vectors, ω 2π is the frequency of oscillation, and is approximately the magnitude of the periodic oscillations, as discussed in Shadden et. al. [27]. The value of determines the time dependency of the flow: for = 0 the flow is timeindependent, and for = 0 the gyres expand and contract periodically in the x-direction conversely with the rectangle enclosing the gyres remaining invariant.

B. Compressed Sensing and Trajectory Optimization
The first component of the proposed approach is to choose a highly reduced subset of sensing locations for effective reconstruction of a large area of interest, using compressed sensing. The reconstruction error is defined in terms of the POD modes of the flow environment, which can be generated using the definition framework of the double gyre flow field with n x = 50 and n y = 25 (1250 grid locations total, and x lim = 2, y lim = 1, t lim = 20 with δt = 0.01). This has been done in two steps for effective selection of the waypoints at the grid locations: (i) generate a sparse representation for a randomized measurement vector for the given number of waypoints and picking the grid location subset with best reconstruction performance, and (ii) repeat this to generate twenty of such waypoint sets and choose the one with least error. This exploits the fact that the selection of locations is randomized and not a unique global solution. An example for five waypoints has been shown in Fig. 3, where the best of twenty waypoint set is selected as the optimal subset for the following step, the optimal trajectory generation. It is to be noted that each of these waypoint sets are nearoptimal themselves and have high reconstruction efficiency (very small reconstruction error). Four sample waypoint sets (A, B, C and D) have been shown in the sub-images to show the non-uniqueness of the reconstruction performance, and the one with the best reconstruction performance of the lot is chosen as the optimal solution.
In the next step, an optimal trajectory is generated through the chosen optimal waypoints (sub-image D in Fig. 3) with a pre-specified starting and goal location as shown in Fig. 4, with an objective to minimize the reconstruction error, the energy cost and the total time taken. The trajectory optimization is based on generating a continuous fourth order splinebased trajectory, and solved using the fmincon function in MATLAB, with v min = 0, v max = 0.7, and ∆t = 0.1. We also compute and compare the trajectories between the various shuffled sequences of the chosen optimal waypoint set. The order of the waypoint sequence from the starting to the goal location has been marked in Fig. 4. The mathematical formulation of the selection of optimal sequence to visit a chosen set of waypoints is beyond the scope of this work. It can be seen from the figure that the figure that the generated trajectory is successfully optimizing the energy cost by adapting to the background flow field, and yields low values of accumulated costs (reconstruction error = 11.56 , energy cost = 110.3 and time cost = 6.07). The reconstruction error and the energy cost values have not been normalized for the overall grid. The reconstruction example for an instant with the first measurement (t = 1) of the above mentioned trajectory through five waypoints has been shown in Fig 5, where (a), (b) and (c) show the original reference double gyre flow map, measurement based reconstruction and the difference between (a) and (b), respectively. The proposed dynamic compressed sensing approach successfully chooses a set of optimal sensing locations over the desired area and then generates an energy optimal trajectory to visit them in quick time for efficient reconstruction.

C. Performance Evaluation
The proposed algorithm was implemented on a range of waypoint set sizes (1 ∼ 10) to check its robustness and compare performance as the waypoint size changes. For every waypoint size, ten unique sets of waypoints were generated and each of those was shuffled seven times to generate various trajectories through same set of waypoints. This resulted in a total of 70 unique trajectories, and the performance metric (Reconstruction error, Energy cost and Total time) was averaged, which has been shown in Fig. 6 along with the 1 − σ values for each metric.
The average accumulated reconstruction error performance for each of the waypoint size has been shown in Fig. 6(a). As expected, the reconstruction is performed very effectively, and is comparatively worse with only one waypoint as the measurements for those cases would not be enough for effective reconstruction. The performance improves with increasing number of waypoints but quickly saturates as the number of measurements over the trajectories become enough for the effective reconstruction, and adding more waypoints does not contribute any additional information value. But overall, these are satisfactory results and in sync with the energy cost performance shown in Fig. 6(b). The algorithm does not need to force the equality constraints to meet the control requirements for lesser number of waypoints, and the trajectory is mostly driven by the background flow. As the number of waypoints increases, the control effort from the algorithm increases for the trajectories to visit the waypoints. Combined with the relatively larger length of the trajectories (which adds to the possible travelling against the flow), the overall energy cost is increased. Finally, the time taken for a trajectory though a given number of waypoints under the influence of a background flow should intuitively increase with the increase in number of waypoints, as the trajectory would become longer to optimize energy. The results for total travel time in Fig. 6(c) are mostly consistent with this intuition, with some inconsistencies through the average and the standard deviation values. The inconsistencies and unexpected results can be attributed to the randomness of the data and parameter sensitivity of the optimization algorithm to some extent, but this leaves the scope for further improvement of the proposed approach. Despite the data set being highly random, the results are consistent and as intuitively expected. This shows that the proposed approach is effective for a large range of application scenarios.

V. EXPERIMENTAL RESULTS
This section presents experimental results for validation of the proposed approach using the Bitcraze quadcopter experimental platform (Crazyflie 2.0) and a Vicon motion capture system, where a Crazyflie emulates the simulated optimal trajectory for an unsteady flow field. The basics of the experimental setup with Crazyflies and Vicon has been discussed in [28]. Luis and Ny [29] also presented a method for using Crazyflie for trajectory following. In this experiment, the simulated trajectory positions were uploaded onto the Crazyflie and the platforms replicate the simulated trajectory. Using the Vicon camera system and the tracking interface, we were able to record the location and orientation of the quadcopter, and overlap that recording over the simulated trajectories.
The experimental flight path of the quadcopter with respect to the simulated trajectory can be seen in Fig. 7(a), along with the prescribed origin (square) and destination (triangle). It can be seen that the quadcopter can effectively track the trajectory with some positional drift and offset. These offsets are caused by faulty measurements by the inertial measurement unit (IMU) of the quadcopter, or the hardware limitations due to the close proximity of the adjacent reference trajectory positions. Figure 7(b) shows a reconstruction time instant (t = 51 for trajectory of length 305 units) and its corresponding error (difference from the ideal flow field at that instant) for the simulated reference trajectory in Fig. 7(a), stacked on top and bottom, respectively. Figure 7(c) is the equivalent for the experimental trajectory from the quadcopter flight. It can be seen that the simulated trajectory near-accurately reconstructs the underlying flow field, and the experimental trajectory closely follows with small error values, despite the offset between the trajectories. The overall results show that it is viable to implement this algorithm for inherently unsteady flow environments, and can be further improved by tuning the optimization parameters while generating the trajectory, taking into account the sensitivity of the experimental setup being used.

VI. CONCLUSIONS
This paper presents the dynamic compressed sensing approach, which aims to reduce the cost compared to the compressed sensing by deploying a mobile robot to take measurement instead of stationary sensors, based on the assumption that not all locations need to measure data at each time instant. The algorithm first chooses a reduced subset of optimal sensing locations with efficient reconstruction performance using compressed sensing and then uses those locations as waypoints to plan an optimal trajectory to effectively reconstruct the overall information, while minimizing the energy cost and total travel time for the trajectory. Simulation results show that the proposed approach effectively optimizes the sensing locations and trajectory, and works well for a range of scenarios. Furthermore, the experimental results validate the implementation of the approach.
The proposed method is currently limited to periodic flow fields and assumes accurate knowledge of the POD basis. We are currently expanding the method to handle turbulent flow effects that are not capture by the data used to construct the POD basis. For general flow fields that do not possess periodicity, we plan to adopt a distributed dynamic compressed sensing scheme with multiple mobile sensors to better capture the spatiotemporal correlations among flow field sampling results.