-
Notifications
You must be signed in to change notification settings - Fork 1
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(ot3_state_manager): Rework messages #430
refactor(ot3_state_manager): Rework messages #430
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.
We have to change the way we handle the byte strings here, but this is definitely on the right track
@sfoster1 is the format string int_val = 0xFF00
print(struct.pack(">H", int_val))
print(struct.pack("<H", int_val))
With the way we have been talking about the messages, we want the message to be formatted like the first print statement (Little Endian) |
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 think we're almost there but there's a couple subtle changes we should make.
@sfoster1 I feel like I should pull the What do you think? |
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 looks much much better structurally but there's some things to fix up.
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.
Sorry - last review was supposed to be this status
Each message is now mapped to an int value instead using arbitrary string parsing
5e9d5bd
to
0839532
Compare
P_L_AXIS = 0x0005, OT3Axis.P_L | ||
P_R_AXIS = 0x0006, OT3Axis.P_R | ||
G_AXIS = 0x0007, OT3Axis.G | ||
Q_AXIS = 0x0008, OT3Axis.Q |
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 does Q axis represent here?
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.
To my understanding, the Q axis is the high-throughput pipette axis.
https://github.com/Opentrons/opentrons/blob/edge/api/src/opentrons/hardware_control/types.py#L128
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 great! Definitely the right way to do it, very solid
Overview
Each message is now mapped to an int value instead using arbitrary string parsing
Related Docs
Changelog
to_message
method from allMessage
classes<message-id><message-content>
where the length ofmessage-id
is a single byte and the length ofmessage-content
is 3 bytes.to_message
method andparse_message
function withMessage
ABC.build
andto_bytes
message_parse_message
method looks at themessage-id
byte and based off of the value passesmessage-content
to thebuild
method of the appropriate concrete implementation ofMessage
Review Requests
None
Risk
None