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

feat(hardware): refactor tool_sensors to simplify and remove csvs #16462

Merged
merged 11 commits into from
Oct 21, 2024

Conversation

ryanthecoder
Copy link
Contributor

@ryanthecoder ryanthecoder commented Oct 10, 2024

Overview

This PR removes much of the complexity in tool_sensors around the liquid probe routine.
Instead of having many different options of setting the bindings and building messages, this consolidates all of the previous options by only commanding the firmware one way, forwarding the sensor information to a new log file, and providing a way for the system to optionally grab the raw sensor data if they wish which is required for the hardware-testing scripts and possibly for future features.

We no longer write CSV files to the robot through this system and have removed all of the coded in paths for them. It also removes the "OutputOptions" data type that previously controlled the behavior variants.

Before each variant had it's own quirks to behavior so now machine actions will always be the same regardless of how the tool_sensors method is called.

This also adds a new can message that sends sensor data in batches instead of 1 by 1 so we don't choke up the can bus as much.

Test Plan and Hands on Testing

Changelog

Review requests

Risk assessment

@ryanthecoder ryanthecoder requested a review from a team as a code owner October 10, 2024 20:45
@ryanthecoder ryanthecoder marked this pull request as draft October 10, 2024 20:45
@ryanthecoder ryanthecoder force-pushed the EXEC-730-batch-read-p2 branch from 59abe33 to 616c303 Compare October 10, 2024 20:46
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Let's make these more special loggers I think

api/src/opentrons/config/__init__.py Outdated Show resolved Hide resolved
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[
asyncio.Queue[dict[SensorId, list[SensorDataType]]]
Copy link
Member

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 use the lower case versions here we should change the rest of the file imo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what that means

Copy link
Member

Choose a reason for hiding this comment

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

for the types - dict instead of typing.Dict

api/src/opentrons/util/logging_config.py Outdated Show resolved Hide resolved
@ryanthecoder ryanthecoder marked this pull request as ready for review October 15, 2024 19:56
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Looks good but let's consider whether the data should go in journald or not and add some tests for at least "how many messages am I trying to receive" mechanics and ideally more.

api/src/opentrons/util/logging_config.py Outdated Show resolved Hide resolved
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[
asyncio.Queue[dict[SensorId, list[SensorDataType]]]
Copy link
Member

Choose a reason for hiding this comment

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

for the types - dict instead of typing.Dict

@ryanthecoder ryanthecoder merged commit ae8e9e9 into edge Oct 21, 2024
22 of 23 checks passed
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.

2 participants