This paper exploits the use of Ultra Wide Band (UWB) technology to improve the localization of robots in both indoor and outdoor environments. In order to efficiently integrate the UWB technology in existing multi-sensor architectures, such as Kalman-based, we propose two approaches to estimate the UWB position covariance values. The first approach uses statistical methods to estimate static covariance values based on data acquired a priori. The second approach adopts a neural network (NN) to capture the relationship between the positional error of the UWB data and the signal quality information, such as the Estimate Of Precision (EOP) and Received Signal Strength Indicator (RSSI). The GPS-RTK is used as ground truth and RGB-D odometry is adopted for both benchmarking and integration purposes. Position sources are fused by means of an Extended Kalman Filter (EKF). Real world experiments are conducted with a tracked mobile robot driving outdoors in a closed-loop trajectory. Results show that the NN is able to efficiently model the sensor covariances and adapt the trustworthiness of the EKF estimation, overcoming data loss by relying on the other available estimation source.