-
Notifications
You must be signed in to change notification settings - Fork 23
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
Handle cases when mobility command feedback does not contain a specific command status #130
Handle cases when mobility command feedback does not contain a specific command status #130
Conversation
…pecific command status. * unified sit command logic to be the same as stand * explicitly checking if mobility command status is PROCESSING * if status is not PROCESSING we won't attempt to parse the feedback further, instead we log a warning message and reset the last_*_command variable to prevent further parsing attempts * if robot is in a moving state, we adjust the standing and sitting states accordingly
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.
Fix looks appropriate though a regression test would be nice.
I see that the linter tests are failing. I'll get it fixed as soon as I get back to it. Sorry for that, I should have ran the linter checks beforehand. |
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.
Looks good to me once the linting is fixed. I just tested on robot and verified that it does resolve bdaiinstitute/spot_ros2#260. Thanks!
Looks like the uploading to Coveralls stage is failing with a missing repo token:
I'm not sure if there is anything I can try to fix that without actually triggering multiple CI runs. |
@amessing-bdai any clue what may be going on here? Was the token removed? Did it expire? |
No, it wasn't removed and shouldn't have expired (there isn't a timeout on it that I can see). That step is only supposed to run on |
I think that the token issue is because this PR is from outside of the |
* feat: Implement tests for mobility command feedback handling. * checking correct handling of any non-PROCESSING mobility command status * checking handling of valid command transitions - from in-progress to finished * checking robot states after velocity movement commands * fix: Remove redundant call to a single response repetition. Co-authored-by: mhidalgo-bdai <[email protected]> --------- Co-authored-by: mhidalgo-bdai <[email protected]> Co-authored-by: Tiffany Cappellari <[email protected]>
Hi,
I have stumbled upon a bit obscure error message from the ROS2 driver when attempting to send
sit
commands to the robot while it was also actively receiving velocitymovement
commands. This might also be related to:AsyncIdle
#47It makes sense that the
sit
commands will always be overridden by themovement
commands and therefore the robot will refuse to sit down. However, the ROS2 driver responds to this by a outputting an error message, ex.:[spot_ros2-5] [wrapper.py:236] Error when getting robot command feedback: bosdyn.api.RobotCommandFeedbackResponse (InternalServerError): Command not found, id: 62532
, which was quite confusing.I have found the root cause of the error in this parsing logic:
spot_wrapper/spot_wrapper/wrapper.py
Lines 223 to 237 in 99ec4a6
, specifically this status parsing:
spot_wrapper/spot_wrapper/wrapper.py
Lines 227 to 230 in 99ec4a6
The normal feedback response looks like this:
However, when the command is overridden, the feedback response looks like this:
and this is where the the logic throws an exception because the
sit_feedback
section does not exist in the message at all. The same also applies to thestand
command. I think the same might also apply to thetrajectory
command, but I have not tested that one.I have added a top-level check for the value of
mobility_command_feedback.status
before any further parsing is performed. If this status is not currentlySTATUS_PROCESSING
then the command is no longer valid and itslast_*_command
variable is reset together with a warning message.This does not modify the actual robot behavior in any way, but avoids the obscure error message and instead handles the cases explicitly. I'm not sure if there are any larger refactors for the
AsyncIdle
class being currently in the works relating to #47 and so if this small proposal has any value currently, but I am putting it out here.I've also added a final check at the end, which might relate to the issue here bdaiinstitute/spot_ros2#260. If the robot is in a
moving
state, thesitting
andstanding
states will be set accordingly. This would make sense since themovement
commands currently always force the robot to stand up a will override anysit
andstand
results. But, this may not be an optimal solution if the behavior changes in the future.