-
Notifications
You must be signed in to change notification settings - Fork 177
CartesianToElevationRateBearingRateRangeRate Measurement Model #1233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| pos = xyz_pos | |
| pos = xyz_rot |
| out_vector[self.velocity_mapping, :] = \ | ||
| inv_rotation_matrix @ out_vector[self.velocity_mapping, :] |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
|
@jswright-dstl wrote this in a local branch |
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}]$ .