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

Manage leasing resources properly #92

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

mhidalgo-bdai
Copy link
Collaborator

This patch changes ensures SpotWrapper properly releases all resources associated to leasing (including keepalives). It also extends leasing APIs so that downstream code needs not tinker with SpotWrapper internals.

Copy link
Collaborator

@jbarry-bdai jbarry-bdai left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this!

We should do some on-robot testing:

  • Start driver and confirm lease is not taken on driver start
  • Move the robot using the driver and ensure lease is taken and robot moves
  • Hijack the robot with the tablet and ensure the robot can be driven around without the driver trying to take the lease back
  • Move the robot using the driver and ensure the lease is taken again (even though a keepalive exists)

spot_wrapper/wrapper.py Outdated Show resolved Hide resolved
Copy link
Collaborator

Will work on testing those cases today @jbarry-bdai

Copy link
Collaborator

@tcappellari-bdai tcappellari-bdai left a comment

Choose a reason for hiding this comment

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

whoops misread the above - ignore me

Copy link
Collaborator

khughes-bdai commented Mar 12, 2024

On-robot testing with this seemed successful. I tried running example_walk_forward, example_walk_with_velocity, and example_ik_solutions in spot_utilities/examples. One thing to note was that there were occasionally some spew error messages from the spot driver about the lease when I ran example_walk_with_velocity as well as ros2 run spot_utilities spot_teleop.py Kepler:

[spot_ros2-1] [wrapper.py:1062] Unable to execute robot command: bosdyn.api.RobotCommandResponse (LeaseUseError): 

Is there a way we can reduce the spew of these messages?

I also tried taking control with the tablet while a longer example was actively running (example_ik_requests). In this case the example kept re-taking control from the tablet -- this is the desired behavior, right?

Copy link
Collaborator

@amessing-bdai amessing-bdai left a comment

Choose a reason for hiding this comment

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

@khughes-bdai
Unable to execute robot command: bosdyn.api.RobotCommandResponse (LeaseUseError): implies there is an error unless that was still the case before this PR? If that existed before then a ticket needs to be created.

Copy link
Collaborator

@amessing-bdai those errors existed before this, will make a ticket. Sorry for the confusion.

Copy link
Collaborator

@khughes-bdai khughes-bdai left a comment

Choose a reason for hiding this comment

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

LGTM

@amessing-bdai amessing-bdai merged commit befe095 into main Mar 19, 2024
4 checks passed
@amessing-bdai amessing-bdai deleted the mhidalgo-bdai/cleanup-leasing-resources branch March 19, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants