[RSDK-8045] connect to machine from viam client - #685
Merged
Naveed Jooma (njooma) merged 5 commits intoJul 17, 2024
Conversation
Naveed Jooma (njooma)
requested review from
Nicole Jung (purplenicole730) and
Ethan (stuqdog)
July 16, 2024 21:04
Nicole Jung (purplenicole730)
approved these changes
Jul 17, 2024
|
|
||
| if id is not None and address is None: | ||
| parts = await self.app_client.get_robot_parts(id) | ||
| main_part = [p for p in parts if p.main_part][0] |
Contributor
There was a problem hiding this comment.
I don't know how main parts work; are there multiple main parts with the same address?
Member
Author
There was a problem hiding this comment.
There should be one main part per machine, and this will find it.
Naveed Jooma (njooma)
force-pushed
the
RSDK-8045/simul-auth
branch
from
July 17, 2024 17:33
c6d9389 to
b98d515
Compare
Ethan (stuqdog)
approved these changes
Jul 17, 2024
|
|
||
| if id is not None and address is None: | ||
| parts = await self.app_client.get_robot_parts(id) | ||
| main_part = [p for p in parts if p.main_part][0] |
Member
There was a problem hiding this comment.
(minor) not sure if we expect to have enough parts for this to matter, but I think this could be slightly cleaner/more efficient as main_part = next(p for p in parts if p.main_part).
Member
Author
There was a problem hiding this comment.
Tested it, and it's about 25% faster to do the iterator method so I updated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the ability to connect to a machine with an already-connected Viam client