track_ownship_distance: Track to ownship range

View source: R/track_ownship_distance.R

track_ownship_distanceR Documentation

Track to ownship range

Description

NOTE: This function is called automatically by create_scenario(). If you're using this, you likely want create_scenario() as it runs not only this function but also creates a scenario that can be used in most other functions in this package. If you're thinking of using this, check out create_scenario() first and make sure that you really want this function.

This function is a simplified version of target_track_distance() (and the closely-related target_ownship_distance()) that calculates only the ranges and bearings of each sensor track during the test. This function may be important when inspecting where the sensor system believed that the targets were and when initially inspecting data. For example, some data that you receive may show the sensor system's reference frame during operation, and this function will return the results of where the sensor system believed that there were targets.

This functions works similarly to target_track_distance() and target_ownship_distance(). The lon, lat, and alt of ownShip is interpolated to the time of the sensor system measurements using a spheroidal Earth (WGS84 projection). Nautilus uses the function interp_ellipse() to interpolate these positions. To avoid discontinuities (i.e., the jump from 359 degrees to 0), target headings are interpolated by first converting to sin and cos.

The target slant ranges are calculated using the straight-line distance by converting lon/lat/alt of the target and ownship to cartesian coordinates and then taking the square root of the sum of the squares. The ground ranges are claculated using the WGS84 projection.

This function can be used as a stand alone function or in conjunction with analysis functions to get the truth ranges and bearings of each target during the test.

Usage

track_ownship_distance(sensorData, ownShipData)

Arguments

sensorData

data frame containing each sensor point for all of the tracks. MUST have the following columns:

  • time: (double) time of measurement. We currently recommend POSIX

  • lon: (double) longitude of target at time of measurement

  • lat: (double) latitude of target at time of measurement

  • alt: (double) altitude of target at time of measurement

  • trackNum: (factor) identifier for the track. We recommend numbers for each unique track returned by the sensor system

ownShipData

data frame containing all of the truth position of the sensor system (likely from GPS or land-based radar systems). This may be ownship if testing something on a ship or the lat/lon position of a stationary ststem. MUST have the following columns:

  • time: (double) time of measurement. We currently recommend POSIX

  • lon: (double) longitude of target at time of measurement

  • lat: (double) latitude of target at time of measurement

  • alt: (double) altitude of target at time of measurement

  • truthID: (factor) name or identifier for target. We recommend letters or names

  • heading: (double) sensor system heading in degrees azimuth

Value

A dataframe containing the ranges and bearings from the sensor system to every target at each time the position of the sensor system was measured. The output columns are a limited version of target_track_distance() and includes:

  • time: time of the measurement of ownship position

  • ownShipTruthID: unique identifier for the reference platform

  • ownShipLon: longitude of ownship at this time

  • ownShipLat: latitude of ownship at this time

  • ownShipAlt: altitude of ownship at this time

  • slantRange: range from ownship to the track (straight-line distance)

  • groundRange: range from ownship to the track (along surface of spheroidal Earth)

  • trueBearingToTarget: true bearing (azimuth) to the target at this time

  • relBearingToTarget: relative bearing (azimuth) to the target at this time

  • trackNum: unique identifier for the track

  • trackLon: target longitude at this time

  • trackLat: target latitude at this time

  • trackAlt: target altitude at this time


battleVerse/scenarioMaker documentation built on July 16, 2024, 4:21 a.m.