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

Platform orientation calculated from previous velocity #1090

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nperree-dstl
Copy link
Contributor

Slight change to how orientation is calculated for moving platforms. Where the velocity of the platform is small, the orientation is calculated based on the direction it travelled from its previous position. Where the platform has only moved a small distance, and for a non-moving platform the orientation from the previous time step is used.

@nperree-dstl nperree-dstl requested a review from a team as a code owner October 11, 2024 14:30
@nperree-dstl nperree-dstl requested review from akenyon and removed request for a team October 11, 2024 14:30
@nperree-dstl nperree-dstl marked this pull request as draft October 11, 2024 14:33
@nperree-dstl
Copy link
Contributor Author

Struggling to run tests/docs on my machine so I think this should fix the bug/feature we discussed but I'm not 100% confident...

@faultfactory
Copy link

Something that's not clear to me is what happens on first timestep and there is no motion?
Do we default to StateVector([0.0,0.0,0.0]) or do we instantiate the movable with an orientation to set any attached sensors in the right direction?

@nperree-dstl nperree-dstl marked this pull request as ready for review November 7, 2024 15:29
Copy link
Contributor

@akenyon akenyon left a comment

Choose a reason for hiding this comment

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

I had the same thought as @faultfactory. For a platform with 0 velocity and only one state, self._property_orientation would not be assigned a value, which I think would result in an attribute error. We could add a default value or maybe just an error message to explain why orientation couldn't be calculated?

@faultfactory
Copy link

I had the same thought as @faultfactory. For a platform with 0 velocity and only one state, self._property_orientation would not be assigned a value, which I think would result in an attribute error. We could add a default value or maybe just an error message to explain why orientation couldn't be calculated?

I think you do both but ideally there wouldn't be an error. Have a default of zero and then spit something out to the terminal on first use of that value. Then let the processing chain chew on that repeatedly until there's motion.

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