Skip to content

Conversation

@sgboakes
Copy link
Contributor

Added a full-rank polar measurement model that converts $[x, y, z, v_x, v_y, v_z]$ into $[\theta, \phi, r, \dot{\theta}, \dot{\phi}, \dot{r}]$.

@sgboakes sgboakes requested a review from a team as a code owner November 10, 2025 10:43
@sgboakes sgboakes requested review from csherman-dstl and sdhiscocks and removed request for a team November 10, 2025 10:43
Comment on lines +1165 to +1170
r2 = np.linalg.norm(pos) ** 2 # Squared norm of pos
r = np.sqrt(r2) # Radius (magnitude)
azi = np.arctan2(pos[1], pos[0]) # Azimuth (atan2)
rxy2 = np.linalg.norm(pos[:2]) ** 2 # Squared norm
rxy = np.sqrt(rxy2) # rxy
el = np.arctan2(pos[2], rxy) # Elevation (atan2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r2 = np.linalg.norm(pos) ** 2 # Squared norm of pos
r = np.sqrt(r2) # Radius (magnitude)
azi = np.arctan2(pos[1], pos[0]) # Azimuth (atan2)
rxy2 = np.linalg.norm(pos[:2]) ** 2 # Squared norm
rxy = np.sqrt(rxy2) # rxy
el = np.arctan2(pos[2], rxy) # Elevation (atan2)
r, azi, el = cart2sphere(pos[0, :], pos[1, :], pos[2, :])
r2 = r ** 2 # Squared norm of pos
rxy = np.linalg.norm(pos[:2], axis=0) # norm
rxy2 = rxy ** 2 # squared norm

Current implementation does not support measuring a StateVectors type

# Determine the net velocity component in the engagement
xyz_vel = state.state_vector[self.velocity_mapping, :] - self.velocity

pos = xyz_pos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pos = xyz_pos
pos = xyz_rot

Comment on lines +1209 to +1210
out_vector[self.velocity_mapping, :] = \
inv_rotation_matrix @ out_vector[self.velocity_mapping, :]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rotation matrix was not applied to velocity in the measurement function, should it be or not?

position_measurement_sets)
@pytest.mark.parametrize('model_class, measure_mapping, use_velocity',
[(CartesianToElevationRateBearingRateRangeRate, [0, 1, 2, 3, 4, 5], True)])
def test_rates(sensor_state, target_state, expected_measurement, model_class,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test cases do not cover any rotation matrices other than the identity matrix and do not involve calculating an elevation or bearing (or rates thereof) other than 0

@sgboakes sgboakes marked this pull request as draft November 17, 2025 10:11
@gawebb-dstl
Copy link
Contributor

@jswright-dstl wrote this in a local branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants