-
Notifications
You must be signed in to change notification settings - Fork 65
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
[PN-68] Refactor _robot_command_goal_complete #167
[PN-68] Refactor _robot_command_goal_complete #167
Conversation
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.
I've just made comments on the test because I suggest doing this PR in three pieces:
- Only commit the test to reflect the current behavior of the function (but not the changes to the function included in this PR).
- Commit a refactor to the function that behaves exactly as the old function did - confirmed by the test committed in 1
- Commit changes to the refactor that fix the bugs discovered by the test.
This PR combines 1 and 2 - I suggest splitting it into two PRs.
Of the comments I made here, only the ones relevant to the actual test file (one typo, one place where I think a test is missing) should be updated in this PR. The others should wait for the third step where we fix the implementation.
Thanks for this!
So the idea is that if you return |
420164d
to
1ab3556
Compare
I think we should commit the test first and separately from changes to spot ros2. |
Co-authored-by: jbarry-bdai <[email protected]>
@jbarry-bdai Now that #179 has been merged into this branch, this is ready for review/stamp. |
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.
Not all the way through but sending what I have so far.
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.
I think my only substantive comment is the confusion over _process
functions not returning success.
…ttps://github.com/bdaiinstitute/spot_ros2 into abaker/PN-68-refactor-_robot_command_goal_complete
@amessing-bdai so it would be easier to review, I added the new feedback statuses and updated the tests here: #204 |
def _robot_command_goal_complete(self, feedback: RobotCommandFeedback) -> GoalResponse: | ||
if feedback is None: | ||
# NOTE: it takes an iteration for the feedback to get set. | ||
def _process_feedback_status(self, status: int) -> Optional[GoalResponse]: |
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.
I think a little doc string on these functions to just say they return IN_PROGRESS, FAILURE, or NONE would be helpful
Co-authored-by: jbarry-bdai <[email protected]>
Merge #179 before merging this PR.
Adds unit test for _
robot_command_goal_complete
and refactors the function so that it is easier to read.While writing the test, I spotted a few statuses that potentially return the incorrect value. I'll implement some of these test cases in a follow up PR.