-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat(robot-server,app): add download deck calibration button #6453
Conversation
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.
Looks good in general but there's some little stuff to change.
Field(..., | ||
description="The type of deck calibration matrix:" | ||
"affine or attitude") | ||
matrix: typing.List[typing.List[float]] = \ |
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 could I think be done with tuples to properly set the length of each row and the number of columns (at least, I think - I assume that pydantic properly translates that into a json array with a fixed number of elements)
[number, number, number, number], | ||
[number, number, number, number] | ||
], | ||
data: DeckCalibrationData, |
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.
If we're going to keep the app compatible with the last version of the robot as well as the current one, we should probably handle it here. I think the general use of null coalescence makes it work, but maybe add a test based on the robot returning the old style of the affine matrix directly in data
?
@@ -83,8 +85,21 @@ async def post_calibration_deck(operation: DeckCalibrationDispatch) \ | |||
async def get_calibration_status( | |||
hardware: ThreadManager = Depends(get_hardware)) -> CalibrationStatus: | |||
robot_conf = robot_configs.load() | |||
if ff.enable_calibration_overhaul(): | |||
deck_cal = robot_cal.load().deck_calibration |
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.
We should get the loaded version from the hardware controller if possible. I'd like to start avoiding reloading stuff from disk every time.
type: affine | ||
matrix: | ||
- &matrix_row | ||
- !anyfloat |
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.
probably needs one fewer !anyfloat
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 thought it should be 4 in this case because an affine matrix would still have 4 columns
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 I think you're right
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.
Code LGTM once you fix the type checks
closes #6055
Overview
This PR adds a download deck calibration button per this design.
Changelog
Robot server:
DeckCalibrationData
model with fields:type, matrix, lastModified, pipetteCalibratedWith, tiprack
/data/
will only contain the typeMatrixType.affine
and the matrix data/data/robot/
will have the typeMatrixType.attitude
, matrix data, information on the pipette and tiprack used in calibrationApp:
DeckCalibrationDownload
component that renders whenever the deck calibration status is not nullattitude
(affine deck cal doesn't contain info on when it was last modified)Component:
Review requests
Put this on your robot, you should be able to download your deck calibration file in robot settings on the app:
{your-robot-name}-deck-calibration.json
data/robot/deck_calibration.json
data/deck_calibration.json
Risk assessment
Medium since this PR modifies an existing endpoint and alters the look of the robot settings tab on the app.