Skip to content
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

Fix non linear constant turn transition model #844

Merged
merged 8 commits into from
Sep 1, 2023

Conversation

orosoman-dstl
Copy link
Contributor

@orosoman-dstl orosoman-dstl commented Aug 21, 2023

I found a few bugs in the ConstantTurn transition model, which this PR aims to fix.

  1. As detailed in Documentation of Q_t does not match implementation #841, the documentation for Q_t did not match the implementation.
  2. The bottom right term in the Q_t array was erroneously divided by the change in time, which would result in the noise of the turn rate being smaller for a larger change in time. I'm not really sure personally why this value is not instead multiplied by dt, but this seems to be a misunderstanding on my part and not a mistake.
  3. There was an issue where if you put in an integer turn rate of zero, you would get an error for division by zero. This is a little bit academic as it's not really the intended use for this transition model, but I thought it was worth fixing for consistency.

I have also raised up a misbehaving comma in the first tutorial as it looked slightly messy.

@orosoman-dstl orosoman-dstl requested a review from a team as a code owner August 21, 2023 11:04
@orosoman-dstl orosoman-dstl requested review from nperree-dstl and hpritchett-dstl and removed request for a team August 21, 2023 11:04
@orosoman-dstl orosoman-dstl linked an issue Aug 21, 2023 that may be closed by this pull request
@sdhiscocks sdhiscocks requested review from DaveKirkland and removed request for nperree-dstl and hpritchett-dstl August 21, 2023 15:01
@orosoman-dstl orosoman-dstl requested review from a team, mharris-dstl and spike-dstl and removed request for a team August 25, 2023 14:43
Comment on lines 98 to 99
if turn_rate[0] == 0:
turn_rate = Matrix([np.finfo(float).eps])
Copy link
Member

Choose a reason for hiding this comment

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

I think, like before, this should check the entire array and set any zero elements to eps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I've reverted to the original code, but now with a check to ensure the Matrix is float before trying to fix zero elements.

@sdhiscocks sdhiscocks merged commit ce21704 into main Sep 1, 2023
6 checks passed
@sdhiscocks sdhiscocks deleted the fix_non_linear_constant_turn branch September 1, 2023 08:42
@sdhiscocks sdhiscocks added the bug label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation of Q_t does not match implementation
4 participants