-
Notifications
You must be signed in to change notification settings - Fork 113
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
RSDK-1979 use new motion service wrapper #2235
RSDK-1979 use new motion service wrapper #2235
Conversation
web/frontend/src/components/slam.vue
Outdated
code: status.code, | ||
metadata: status.metadata, | ||
}; | ||
getPointCloudMap.on('status', (status?) => { |
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.
- what does it mean if
status
is undefined? - why is this changing?
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 is no longer changing - I think I simply made a mistake here, I can't reproduce the linting error I got before that led me to make this change.
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.
repeated my smoke test from before and saw the same behavior after reverting this change.
reject(error); | ||
} | ||
}); | ||
getPointCloudMap.on('end', (end: { code: number }) => { | ||
getPointCloudMap.on('end', (end?: { code: number }) => { |
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.
- what does it mean if
end
is undefined? - why is this changing?
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.
- what does it mean if end is undefined?
This means the response was closed without a valid grpc-status. This can happen if the server shuts down or receives a malformed request.
- why is this changing?
My best guess is that types were mis-configured on the typescript side - we recently made a change to address this. In this case, we were properly handing status being undefined, but just did not have the correct type signature to reflect this.
EDIT: this signature is from generated pb service code - I can't find any record of the signature being different.
@@ -84,7 +81,7 @@ const fetchSLAMPose = (name: string): Promise<commonApi.Pose> => { | |||
props.client.slamService.getPosition( | |||
req, | |||
new grpc.Metadata(), | |||
(error: ServiceError, res: slamApi.GetPositionResponse): void => { | |||
(error: ServiceError | null, res: slamApi.GetPositionResponse | null): void => { |
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 it fair to say that one & only one of error
and res
will be defined?
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 is unclear
in the logic below it looks like we are handling this case a "successful" response is null. (i.e. we are calling resp!
instead of just resp
).
91b5452
to
cd00be2
Compare
@@ -56,7 +56,7 @@ const fetchSLAMMap = (name: string): Promise<Uint8Array> => { | |||
const chunk = res.getPointCloudPcdChunk_asU8(); | |||
chunks.push(chunk); | |||
}); | |||
getPointCloudMap.on('status', (status: { code: number, details: string, metadata: string }) => { | |||
getPointCloudMap.on('status', (status: { code: number, details: string, metadata: grpc.Metadata }) => { |
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.
okay, now this is just a typing change - no logic changes. see #2235 (comment) for more context
@nicksanford |
In that case I have no objections & can be removed as a reviewer. Thanks for checking in! |
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.
LGTM
Cool, though now need to approve since you requested changes earlier - I can't take you off once you do 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.
Approving given my review is no longer required
#2235 (comment)
Depends on viamrobotics/viam-typescript-sdk#55
Supersedes: #2189 - go there to see discussions