-
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-910 use sdk camera client #1655
RSDK-910 use sdk camera client #1655
Conversation
9e28820
to
7280e7f
Compare
web/frontend/package.json
Outdated
@@ -8,7 +8,7 @@ | |||
"@mdi/js": "^6.9.96", | |||
"@viamrobotics/prime": "^0.0.79", | |||
"@viamrobotics/rpc": "^0.1.32", | |||
"@viamrobotics/sdk": "^0.0.6", | |||
"@viamrobotics/sdk": "file:../../../../viamrobotics/viam-typescript-sdk/viamrobotics-sdk-0.0.8.tgz", |
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.
bump version once viamrobotics/viam-typescript-sdk#6 is merged and the corresponding package is released
ac3a2bb
to
7102cd3
Compare
web/frontend/src/app.vue
Outdated
@@ -611,26 +612,21 @@ const filteredInputControllerList = () => { | |||
}; | |||
|
|||
const viewFrame = (cameraName: string) => { |
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.
Nit: We could rewrite this to use the async/await
syntax, but not really required:
const viewFrame = async (cameraName: string) => {
try {
const blob = await new CameraClient(client, cameraName).renderFrame(Camera.MimeType.JPEG);
const streamContainers = document.querySelectorAll(
`[data-stream="${cameraName}"]`
);
for (const streamContainer of streamContainers) {
streamContainer.querySelector('video')?.remove();
streamContainer.querySelector('img')?.remove();
const image = new Image();
image.src = URL.createObjectURL(blob);
streamContainer.append(image);
}
} catch (error) {
displayError(error);
}
};
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.
yep, I will also add a linting rule to enforce the house style
@@ -66,16 +65,14 @@ const toggleExpand = () => { | |||
}; | |||
|
|||
const renderPCD = () => { |
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.
Nit: This could also use the async/await
syntax:
const renderPCD = async () => {
try {
const bytes = await new CameraClient(props.client, props.cameraName).getPointCloud();
pointcloud = bytes;
} catch (error) {
toast.error(`Error getting point cloud: ${error}`);
}
};
@@ -102,18 +99,12 @@ const refreshCamera = () => { | |||
}; | |||
|
|||
const exportScreenshot = (cameraName: string) => { |
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.
Nit: Last one:
const exportScreenshot = async (cameraName: string) => {
try {
const blob = await new CameraClient(props.client, cameraName).renderFrame(Camera.MimeType.JPEG);
window.open(URL.createObjectURL(blob), '_blank');
} catch (error) {
displayError(error)
}
};
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.
✅ couple of nits but nothing that needs to happen.
7e565f7
to
4321180
Compare
5588213
to
e469d19
Compare
e469d19
to
8386f39
Compare
8386f39
to
ed40bb1
Compare
|
JIRA: https://viam.atlassian.net/browse/RSDK-910
TODO