-
Notifications
You must be signed in to change notification settings - Fork 56
DOCS-2902: Edit machine management api from QA #748
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
DOCS-2902: Edit machine management api from QA #748
Conversation
src/viam/robot/client.py
Outdated
pose=pose | ||
) | ||
|
||
pose = await machine.transform_pose(pose_in_frame, "world") |
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.
should this overwrite the pose? Or should the variable be called something else?
# Define a new discovery query. | ||
q = machine.DiscoveryQuery(subtype=acme.API, model="some model") | ||
q = DiscoveryQuery(subtype="camera", model="webcam") |
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.
good work
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.
For subtype
, you could do Camera.SUBTYPE.resource_subtype
which is a bit more verbose but fully typechecked.
This way also works, but just in case people don't know how to get the subtype? Up to y'all, just showing an additional way of doing it
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.
This way seems more straightforward but thank you
src/viam/robot/client.py
Outdated
@@ -738,25 +757,29 @@ async def discover_components( | |||
queries: List[DiscoveryQuery], | |||
) -> List[Discovery]: | |||
""" | |||
Get the list of discovered component configurations. | |||
Get a list of discovered potential component configurations. |
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 can't say I understand what potential means in this context. Do you know? Can you explain?
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.
rand explained it to me, its basically a long list of all the discovered possible configurations for the camera. like height this many pixels width this many pixels this webcam path or this webcam path etc. can confirm thats what the printout looks like and she approved of this terminology
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.
Ok, I understand, I think we can maybe add a bit more info to this
Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
src/viam/robot/client.py
Outdated
@@ -738,25 +757,29 @@ async def discover_components( | |||
queries: List[DiscoveryQuery], | |||
) -> List[Discovery]: | |||
""" | |||
Get the list of discovered component configurations. | |||
Get a list of discovered potential component configurations. |
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.
Ok, I understand, I think we can maybe add a bit more info to this
Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
src/viam/robot/client.py
Outdated
return await RobotClient.at_address('<ADDRESS-FROM-THE-VIAM-APP>', opts) | ||
async def connect() -> RobotClient: | ||
opts = RobotClient.Options( | ||
disable_sessions=True, |
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.
Why are we suggesting disabling sessions?
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 don't know, I assume it was a copy paste error but just to double check @npentrel do you know if there was a reason for this? If not I will make a pr to edit on main docs page too.
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.
Where did you get this code from? Was that from here?
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.
From the code sample you sent
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.
But changed it to reflect use case without a timeout-- sorry I was confused and thought timeout use case was the preferred one but realize it was just offered as an option
src/viam/robot/client.py
Outdated
@@ -738,12 +759,15 @@ async def discover_components( | |||
queries: List[DiscoveryQuery], | |||
) -> List[Discovery]: | |||
""" | |||
Get the list of discovered component configurations. | |||
Get a list of discovered potential component configurations for webcam cameras, for example listing different supported resolutions. |
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.
Does discovery only work for webcam cameras? If no, this seems to suggest that
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.
Yeah it only works for webcam camera re. rand
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.
Is there a chance it will work for other components in the future? I don't want to have to be overly specific in the event that we just haven't gotten to implementing it elsewhere just yet but plan to
# Define a new discovery query. | ||
q = machine.DiscoveryQuery(subtype=acme.API, model="some model") | ||
q = DiscoveryQuery(subtype="camera", model="webcam") |
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.
For subtype
, you could do Camera.SUBTYPE.resource_subtype
which is a bit more verbose but fully typechecked.
This way also works, but just in case people don't know how to get the subtype? Up to y'all, just showing an additional way of doing it
src/viam/robot/client.py
Outdated
return await RobotClient.at_address('<ADDRESS-FROM-THE-VIAM-APP>', opts) | ||
async def connect() -> RobotClient: | ||
opts = RobotClient.Options( | ||
disable_sessions=True, |
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.
Where did you get this code from? Was that from here?
No description provided.