fix channel spacing in single resource aspirations/dispenses #337
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
before when aspirating or dispensing with multiple channels in a single container, we always divided the available space in a container by num_channels+1 to space channels evenly. This works when the container is sufficiently large, but does not work when channel is barely big enough to fit the number of channels.
For example, aspirating with 8 channels from a 80 wide mm resource would have meant a space of 80/(8+1)<9 mm between channels. In reality, there is enough space if you take 9 mm between channels, 80-7*9 leaves 17 mm of space, which is 8.5mm per side.
This PR fixes such cases, by spacing channels >9mm apart and seeing if there is enough space left on the sides. I set the minimum space on the side to 2mm per side, the edge of the container to the center of the tip, which may need to be adjusted based on feedback. If there is enough space left, the aspiration or dispense will happen. If there is more space than 9mm left on either side, we will split up the channels equally across the resource, similar to the behavior that we had before. For example, aspirating with 4 channels from the 80mm resource will space all channels 20mm apart, and 20mm from the side.