Skip to content
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

TypeAlias Camera.Properties #502

Merged
merged 4 commits into from
Dec 11, 2023
Merged

Conversation

njooma
Copy link
Member

@njooma njooma commented Dec 8, 2023

Prompted by viamrobotics/api#408, we were redefining Camera.Properties when we could've simply TypeAliased it

@njooma njooma requested a review from a team as a code owner December 8, 2023 22:05
Copy link
Contributor

github-actions bot commented Dec 8, 2023

Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!

component function
base is_moving
board gpio_pin_by_name
camera get_image
encoder get_position
motor is_moving
sensor get_readings
servo get_position
arm get_end_position
gantry get_lengths
gripper is_moving
movement_sensor get_linear_acceleration
input_controller get_controls
audio get_properties
pose_tracker get_poses
power_sensor get_power
motion get_pose
vision get_classifications_from_camera

@njooma
Copy link
Member Author

njooma commented Dec 8, 2023

cc @bazile-clyde

Copy link

@bazile-clyde bazile-clyde left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -64,8 +64,7 @@ async def get_point_cloud(self, *, extra: Optional[Dict[str, Any]] = None, timeo
return (response.point_cloud, response.mime_type)

async def get_properties(self, *, timeout: Optional[float] = None) -> Camera.Properties:
response: GetPropertiesResponse = await self.client.GetProperties(GetPropertiesRequest(name=self.name), timeout=timeout)
return Camera.Properties(response.supports_pcd, response.intrinsic_parameters, response.distortion_parameters)
return await self.client.GetProperties(GetPropertiesRequest(name=self.name), timeout=timeout)

Choose a reason for hiding this comment

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

Niiice.

Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

nice, lgtm!

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.

LGTM!

@njooma njooma merged commit 1c3bfc9 into viamrobotics:main Dec 11, 2023
12 checks passed
@njooma njooma deleted the shadow-camera-props branch December 11, 2023 16:04
njooma added a commit that referenced this pull request Dec 22, 2023
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