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(sensors): enable capacitive sensor logging #768

Merged
merged 27 commits into from
Jun 5, 2024

Conversation

pmoegenburg
Copy link
Member

@pmoegenburg pmoegenburg commented Apr 10, 2024

This PR, along with ../opentrons/ #14785, adds csv file logging capability to the capacitive_probe process for the pipettes and the gripper. This work utilizes the work that adds the same capability to the liquid_probe process for the pipettes. The AddSensorLinearMoveRequest and SendAccumulatedSensorDataRequest messages were modified to include a sensor_type data field. The USE_PRESSURE_MOVE flag was modified to USE_SENSOR_MOVE.

  • Ran script without csv logging and detected saltwater liquid height
  • Ran script with csv loffing and detected saltwater liquid height

@pmoegenburg pmoegenburg added the enhancement New feature or request label Apr 10, 2024
@pmoegenburg pmoegenburg self-assigned this Apr 10, 2024
void send_to_pressure_sensor_queue_rear(
can::messages::BindSensorOutputRequest& m) {
std::ignore = sensor_tasks::get_queues()
.pressure_sensor_queue_rear->try_write_isr(m);
SensorClientHelper<SensorClient>::send_to_pressure_sensor_queue_rear(
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of doing all of this templated stuff we should just use the same get queues() method, it makes the code much simpler

Copy link
Member Author

Choose a reason for hiding this comment

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

Necessary because not every subsystem that requires MotorInterruptHandler has a SensorClient

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to since they're all behind compiler defines. I made a quick commit that rips it out

Copy link
Contributor

@ryanthecoder ryanthecoder left a comment

Choose a reason for hiding this comment

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

I think this looks good now.

@ryanthecoder ryanthecoder force-pushed the EXEC-343-lld-cap-probe-logging branch from 806685e to 51ce97c Compare June 4, 2024 19:51
pmoegenburg added a commit to Opentrons/opentrons that referenced this pull request Jun 5, 2024
…ethod (#14785)

<!--
Thanks for taking the time to open a pull request! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview

This PR, along with Opentrons/ot3-firmware#768,
adds csv file logging capability to the capacitive_probe ot3api method.
This work utilizes the work that adds the same capability to the
liquid_probe process. The MoveGroupSingleAxisStep,
AddSensorLinearMoveRequest, and SendAccumulatedSensorDataRequest classes
were modified to include a sensor_type data field. The
capacitive_probe_ot3_tunable script was added for testing.

<!--
Use this section to describe your pull-request at a high level. If the
PR addresses any open issues, please tag the issues here.
-->

# Test Plan

<!--
Use this section to describe the steps that you took to test your Pull
Request.
If you did not perform any testing provide justification why.

OT-3 Developers: You should default to testing on actual physical
hardware.
Once again, if you did not perform testing against hardware, justify
why.

Note: It can be helpful to write a test plan before doing development

Example Test Plan (HTTP API Change)

- Verified that new optional argument `dance-party` causes the robot to
flash its lights, move the pipettes,
then home.
- Verified that when you omit the `dance-party` option the robot homes
normally
- Added protocol that uses `dance-party` argument to G-Code Testing
Suite
- Ran protocol that did not use `dance-party` argument and everything
was successful
- Added unit tests to validate that changes to pydantic model are
correct

-->

- [x] Ran script without csv logging and detected saltwater liquid
height
 - [x] Ran script with csv loffing and detected saltwater liquid height

# Changelog

<!--
List out the changes to the code in this PR. Please try your best to
categorize your changes and describe what has changed and why.

Example changelog:
- Fixed app crash when trying to calibrate an illegal pipette
- Added state to API to track pipette usage
- Updated API docs to mention only two pipettes are supported

IMPORTANT: MAKE SURE ANY BREAKING CHANGES ARE PROPERLY COMMUNICATED
-->

# Review requests

<!--
Describe any requests for your reviewers here.
-->

# Risk assessment

<!--
Carefully go over your pull request and look at the other parts of the
codebase it may affect. Look for the possibility, even if you think it's
small, that your change may affect some other part of the system - for
instance, changing return tip behavior in protocol may also change the
behavior of labware calibration.

Identify the other parts of the system your codebase may affect, so that
in addition to your own review and testing, other people who may not
have the system internalized as much as you can focus their attention
and testing there.
-->
@pmoegenburg pmoegenburg merged commit 0f4faff into main Jun 5, 2024
38 of 39 checks passed
ryanthecoder added a commit that referenced this pull request Jul 18, 2024
* USE_SENSOR_MOVE

* intermediate updates

* finished implementing capacitive_probe firmware

* format lint test

* build fixes

* formatted

* updates to match pressure work

* fixes RAM space build issue

* empty last line

* removed comment

* build update

* pr review fix and format

* faux commit

* faux commit

* fixed build issues stemming from removal of motor driver error surfacing branch

* simulator fix

* formatted

* removed comments

* formatted

* get rid of pesky error messages like with pressure driver

* rip out the unneeded templating of sensor hardware since that stuff is behind ifdefs

* fix simulators

* build issue fix

* merge issue fix

---------

Co-authored-by: Ryan howard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants