-
Notifications
You must be signed in to change notification settings - Fork 11
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 timeout calculation for Create 3 navigate_to() #51
base: pre_0.6.0
Are you sure you want to change the base?
Conversation
See modification & description between lines 165 to 185; to address premature timeout when navigating to origin using the navigate_to() function from longer distances
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.
Thank you for this bugfix, but there are some changes necessary before the PR can be accepted.
#-------------See changes in lines 164 through 185 to address premature timeout when navigating to origin using navigate_to()----------------- | ||
|
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.
Please remove these lines. These, and the commentary below are helpful, but they belong in the pull request, not in the final source.
delta_x=(x-self.pose.x) | ||
delta_y=(y-self.pose.y) |
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.
There should not be parenthesis around the expressions -- the lines should read something like
delta_x = x - self.pose.x
delta_y = y - self.pose.y
|
||
#original line# timeout = self.DEFAULT_TIMEOUT + int(math.sqrt(x * x + y * y) / 10) + 4 # 4 is the timeout for a potential rotation. | ||
|
||
#-------End Modification------------ |
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.
Remove these lines. No reason to keep the dead code.
self.get_position() | ||
delta_x=(x-self.pose.x) | ||
delta_y=(y-self.pose.y) | ||
timeout = self.DEFAULT_TIMEOUT + int(math.sqrt(delta_x*delta_x + delta_y * delta_y) / 10) + 4 # 4 is the timeout for a potential rotation. |
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.
Please add spaces between the first *
as you did with the second *
-- that is, the line should read:
timeout = self.DEFAULT_TIMEOUT + int(math.sqrt(delta_x * delta_x + delta_y * delta_y) / 10) + 4 # 4 is the timeout for a potential rotation.
I see now that you have allowed maintainers to edit your PR; I'm happy to try to make the changes and merge after testing. |
Yes, feel free to modify as you see fit. To be honest, I'm an EE major (not CE), so coding isn't exactly my wheelhouse. I just wanted to bring it to someone's attention this timeout issue within the SDK.
|
I really appreciate it! For me to edit this PR, you'd have to add me as a collaborator. Here are the directions to do that. If you'd rather not bother, let me know, and I can reproduce this PR in the repository, but I'd love for you to have the credit on this PR if you'd like it. |
See modification & description between lines 165 to 185; to address premature timeout when navigating to origin using the navigate_to() function from longer distances