Skip to content

RSDK-6169 - gRPC debugging client api #747

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

Merged
merged 6 commits into from
Oct 1, 2024

Conversation

stuqdog
Copy link
Member

@stuqdog stuqdog commented Sep 26, 2024

Adds the gRPC debugging client api.

Note to reviewers: a lot of this is pretty boilerplate. I certainly won't complain if you look at all of it but I think the main places to focus are rpc_client_base.py and utils.py

Flyby: refactors dict_to_struct to make the obj argument type optional, such that we don't need to have if extra is None: extra = {} in every method.

Example code:

robot = await connect()
motor = Motor.from_robot(robot, "<my-motor-name>")
# only a single metadata need be created, which can then be passed to any number of methods
# from any number of resources, provided the user is happy with the logs sharing the same key
md = motor.Metadata()
md.enable_debug_logging('my-cool-key') # the key is optional; if not provided, a random key will be generated
await motor.go_for(rpm=100, revolutions=5, metadata=md)
await robot.close()

example logs:

Screenshot 2024-09-26 at 11 43 18

@stuqdog stuqdog marked this pull request as ready for review September 26, 2024 17:08
@stuqdog stuqdog requested a review from a team as a code owner September 26, 2024 17:08
@stuqdog
Copy link
Member Author

stuqdog commented Sep 26, 2024

@dgottlieb fyi

@dgottlieb
Copy link
Member

This makes sense to me, thanks for linking the PR!

Copy link
Member

@purplenicole730 purplenicole730 left a comment

Choose a reason for hiding this comment

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

Kind of skimmed over the components/services since the changes seemed straightforward. Thank you for the flyby change!

@stuqdog
Copy link
Member Author

stuqdog commented Sep 27, 2024

@njooma not sure if you wanted to look at it particularly, but just fyi since we had that discussion about possible implementations

Copy link
Member

@njooma njooma left a comment

Choose a reason for hiding this comment

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

nice.

@stuqdog stuqdog merged commit e0fc696 into viamrobotics:main Oct 1, 2024
12 checks passed
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.

4 participants