## 3 GROW Solution Overview
### Localization Solution  
During operations, AUVs require an estimate of their locations. Other variables might also be relevant (e.g., linear velocity). All these variables are usually combined on a so-called state vector that includes important data for guidance and control purposes. Given an initial guess of the state vector, the AUV may resort to mathematical models to estimate the state over the mission. However, models are generally inaccurate and may result in significant errors (some meters for location) in a matter of a few seconds or minutes. Even if very accurate models could be run in real-time, external disturbances are usually unpredictable, which result in the same problem of divergence from the real state. Therefore, sensors are employed to measure variables (e.g., pressure and magnetic direction) that relate to state variables. These measurements are then used to _correct_ the errors of the state variables. However, the measurements of these sensors are imperfect as they suffer from biases, noise, and quantization effects in addition to being sampled at discrete asynchronous intervals. Thus, analytical determination of state variables is impractical.  
To deal with the problem, filters are commonly employed to fuse measurements from sensors and mathematical models. The Kalman Filter (KF) and its variants--Extended Kalman Filter (EKF) and Unscented Kalman Filter (UKF)--are standard solutions in many applications (e.g., GPS localization). Other options include particle filters, Bayes filters, and the Expectation Maximization (EM) algorithm. These provide a framework that complies with most of the characteristics mentioned above. For the present work, an EKF was implemented, taking into account the nonlinear nature of the differential equations that  
Figure 4: The UDMP protocol stack.  
govern the motion of the AUV, as well as the nonlinear relation between measurements and state variables. The EKF framework includes two stages, as illustrated in Figure 5: prediction based on mathematical models of the dynamics and update when measurements from sensors are used to correct the state vector. For the purpose of this work, the following state variables were considered:  
* Absolute three-dimensional position--represented in Cartesian coordinates in a global frame;
* Attitude--represented in the form of a unit quaternion;
* Linear velocities--expressed on the axes of the reference frame attached to the AUV body;
* Angular velocities--expressed on the axes of the reference frame attached to the AUV body;
* Absolute three-dimensional position of the target.  
Kinematics and dynamics models are used for predicting the state based on previous state and actuation, i.e., forces applied by the thrusters. The following sensor suite is assumed in the context of this work:  
* Acoustic receivers--considering an Ultra-Short BaseLine (USBL) configuration to measure bearing and range;
* Artificial vision-based system--at shorter ranges, for more precise localization, an artificial vision-based system measures the relative position with respect to visual markers;
* Inertial Measurement Unit (IMU)--composed of a three-axes gyroscope, a three-axes magnetometer, and a three-axes accelerometer, mainly used for attitude calculation;
* Pressure sensor--a pressure sensor is used for depth measurement;
* Doppler Velocity Log--a Doppler Velocity Log (DVL) is used for measurements of three-dimensional linear velocities.