-
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
refactor(hardware): give options for sensor data output during probe #14673
Conversation
f4ca186
to
5c1c040
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## edge #14673 +/- ##
==========================================
- Coverage 67.19% 67.17% -0.03%
==========================================
Files 2495 2495
Lines 71563 71612 +49
Branches 9076 9076
==========================================
+ Hits 48088 48105 +17
- Misses 21330 21362 +32
Partials 2145 2145
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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 small things to change like removing prints and making a function invocation kwargs. I think I would have done the split of the CSV stuff slightly differently but I think this way will work and I'm interested to see how it turns out.
|
||
|
||
@dataclass | ||
class SendAccumulatedPressureDataRequest(BaseMessage): |
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 response message does this use?
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 prompts all of the ReadFromSensorResponse
messages to be dumped from the array the firmware accumulates during liquid probe
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.
It sends the same ReadFromSensorResponse as we did before
return move_group | ||
|
||
|
||
async def run_pass_output_to_csv( |
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 still need a way to gate the behavior here to see if we want to use the stream can messages to csv behavior we had before, or the new buffer-on-pipette then write we need.
the way we run the move group runner is different with the custom firmware.
the new custom firmware needs this logic
messenger.add_listener(sensor_capturer, None)
async with sensor_capturer:
print("starting move group runner")
positions = await sensor_runner.run(can_messenger=messenger)
await messenger.send(
node_id=tool,
message=SendAccumulatedPressureDataRequest(
payload=SendAccumulatedPressureDataPayload(
sensor_id=SensorIdField(sensor_id)
)
),
)
await asyncio.sleep(10)
messenger.remove_listener(sensor_capturer)
await messenger.send(
node_id=tool,
message=BindSensorOutputRequest(
payload=BindSensorOutputRequestPayload(
sensor=SensorTypeField(SensorType.pressure),
sensor_id=SensorIdField(sensor_id),
binding=SensorOutputBindingField(SensorOutputBinding.none),
)
),
)
and the normal firmware needs what you have here
plunger_speed=plunger_speed, | ||
mount_speed=mount_speed, | ||
threshold_pascals=threshold_pascals, | ||
output_format=OutputOptions.none, |
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 need to hook this up one more layer to ot3_api,
and if the Output Options chosen is the one that needs the custom firm we should assert here that
self._subsystem_manager.device_info[SubSystem.of_mount(mount)].revision.tertiary == "1"
# will be the same | ||
duration=float64(abs(distance[movers[0]] / speed[movers[0]])), | ||
present_nodes=pipette_nodes, | ||
stop_condition=MoveStopCondition.sensor_report, |
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 also needs to be gated on using the custom firmware or not, the normal firmware cannot process this stop condition
And we'll need to grab the changes from move_group_runner to handle this stop condition too
fa01e9f
to
fd0aec9
Compare
…ferentiate buffered on pipette moves and regular firmware moves
fd0aec9
to
2864274
Compare
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, looks good to me!
Overview
These are some small changes that help accommodate liquid-level detection testing in the hardware layer.
EXEC-337
Changelog
AddSensorLinearMoveRequest
,SendAccumulatedPressureDataRequest
CAN messagessensor_report
Move Condition to allow us to request that the firmware accumulate data in the necessary manner for hardware testing.tool_sensors.py
to allow its users to choose between reporting sensor data to the CAN bus only, writing sensor data to a csv file, or not reporting data at all during a pass.Review requests
The CAN messages mentioned above will probably be temporary additions to
edge
, but I think merging them and potentially later on removing them may be the best way to go about this. Let me know if not.