Skip to content

Commit

Permalink
feat(can): add getMoveStatus request & response (#8688)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau authored Nov 9, 2021
1 parent 31fcc98 commit 4f50044
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hardware/opentrons_hardware/drivers/can_bus/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ class MessageId(int, Enum):
clear_move_group_request = 0x19
move_group_completed = 0x1A
move_completed = 0x13
get_move_status_request = 0x30
get_move_status_response = 0x31
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,21 @@ class MoveCompleted: # noqa: D101
payload: payloads.MoveCompletedPayload
payload_type: Type[BinarySerializable] = payloads.MoveCompletedPayload
message_id: Literal[MessageId.move_completed] = MessageId.move_completed


@dataclass
class GetMoveStatusRequest: # noqa: D101
payload: payloads.EmptyPayload
payload_type: Type[BinarySerializable] = payloads.EmptyPayload
message_id: Literal[
MessageId.get_move_status_request
] = MessageId.get_move_status_request


@dataclass
class GetMoveStatusResponse: # noqa: D101
payload: payloads.GetMoveStatusResponsePayload
payload_type: Type[BinarySerializable] = payloads.GetMoveStatusResponsePayload
message_id: Literal[
MessageId.get_move_status_response
] = MessageId.get_move_status_response
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
defs.ClearMoveGroupRequest,
defs.MoveGroupCompleted,
defs.MoveCompleted,
defs.GetMoveStatusRequest,
defs.GetMoveStatusResponse,
]


Expand Down
11 changes: 11 additions & 0 deletions hardware/opentrons_hardware/drivers/can_bus/messages/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,14 @@ class MoveCompletedPayload(MoveGroupRequestPayload):
seq_id: utils.UInt8Field
ack_id: utils.UInt8Field
node_id: utils.UInt8Field


@dataclass
class GetMoveStatusResponsePayload(MoveGroupRequestPayload):
"""Read status of current move being executed."""

seq_id: utils.UInt8Field
remaining_duration: utils.UInt64Field
current_position: utils.UInt64Field
node_id: utils.UInt8Field
padding: utils.UInt8Field

0 comments on commit 4f50044

Please sign in to comment.