added code to handle when in_view is true and use ground data in loiter control