Skip to content

Commit

Permalink
refactor(api,hardware): ot3: remove setuprequest (#11022)
Browse files Browse the repository at this point in the history
This was a request that commanded all the nodes to do some built-in
setup. Instead, all the nodes can just do it themselves when they boot
up, and it's not possible to forget to send the message anymore.
  • Loading branch information
sfoster1 authored Jul 6, 2022
1 parent a269e96 commit 53d3212
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 26 deletions.
5 changes: 0 additions & 5 deletions api/src/opentrons/hardware_control/backends/ot3controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
PipetteName as FirmwarePipetteName,
)
from opentrons_hardware.firmware_bindings.messages.message_definitions import (
SetupRequest,
EnableMotorRequest,
)
from opentrons_hardware import firmware_update
Expand Down Expand Up @@ -166,10 +165,6 @@ def motor_hold_currents(self) -> OT3AxisMap[float]:

async def setup_motors(self) -> None:
"""Set up the motors."""
await self._messenger.send(
node_id=NodeId.broadcast,
message=SetupRequest(),
)
await self._messenger.send(
node_id=NodeId.broadcast,
message=EnableMotorRequest(),
Expand Down
2 changes: 0 additions & 2 deletions hardware/opentrons_hardware/firmware_bindings/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ class MessageId(int, Enum):

move_request = 0x10

setup_request = 0x02

write_eeprom = 0x201
read_eeprom_request = 0x202
read_eeprom_response = 0x203
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ class MoveRequest: # noqa: D101
message_id: Literal[MessageId.move_request] = MessageId.move_request


@dataclass
class SetupRequest(EmptyPayloadMessage): # noqa: D101
message_id: Literal[MessageId.setup_request] = MessageId.setup_request


@dataclass
class WriteToEEPromRequest: # noqa: D101
payload: payloads.EEPromDataPayload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
defs.EnableMotorRequest,
defs.DisableMotorRequest,
defs.MoveRequest,
defs.SetupRequest,
defs.WriteToEEPromRequest,
defs.ReadFromEEPromRequest,
defs.ReadFromEEPromResponse,
Expand Down
2 changes: 0 additions & 2 deletions hardware/opentrons_hardware/scripts/gripper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from opentrons_hardware.drivers.can_bus import build
from opentrons_hardware.firmware_bindings.messages import payloads
from opentrons_hardware.firmware_bindings.messages.message_definitions import (
SetupRequest,
DisableMotorRequest,
ExecuteMoveGroupRequest,
)
Expand Down Expand Up @@ -91,7 +90,6 @@ async def run_test(messenger: CanMessenger) -> None:

"""Setup gripper"""
try:
await messenger.send(node_id=NodeId.gripper, message=SetupRequest())
await set_pwm_param(messenger, pwm_freq, pwm_duty)

for i, v in enumerate(vref_list):
Expand Down
2 changes: 0 additions & 2 deletions hardware/opentrons_hardware/scripts/gripper_currents.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from opentrons_hardware.drivers.can_bus import build
from opentrons_hardware.firmware_bindings.messages.message_definitions import (
SetupRequest,
DisableMotorRequest,
ExecuteMoveGroupRequest,
)
Expand Down Expand Up @@ -84,7 +83,6 @@ async def run_test(messenger: CanMessenger) -> None:
pwm_freq = prompt_int_input("Set PWM frequency in Hz (int, \033[96m32000Hz\033[0m)")

try:
await messenger.send(node_id=NodeId.gripper, message=SetupRequest())
await set_reference_voltage(messenger, v_ref)

while True:
Expand Down
2 changes: 0 additions & 2 deletions hardware/opentrons_hardware/scripts/gripper_lifetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from logging.config import dictConfig

from opentrons_hardware.firmware_bindings.messages.message_definitions import (
SetupRequest,
EnableMotorRequest,
)
from opentrons_hardware.drivers.can_bus.can_messenger import CanMessenger
Expand Down Expand Up @@ -92,7 +91,6 @@ async def run(args: argparse.Namespace) -> None:
messenger = CanMessenger(driver=driver)
messenger.start()
await set_reference_voltage(messenger, vref)
await messenger.send(node_id=NodeId.gripper_g, message=SetupRequest())
await messenger.send(node_id=NodeId.gripper_g, message=EnableMotorRequest())

move_groups: MoveGroups = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from logging.config import dictConfig

from opentrons_hardware.firmware_bindings.messages.message_definitions import (
SetupRequest,
EnableMotorRequest,
)
from opentrons_hardware.drivers.can_bus.can_messenger import CanMessenger
Expand Down Expand Up @@ -69,7 +68,6 @@ async def run(args: argparse.Namespace) -> None:

messenger = CanMessenger(driver=driver)
messenger.start()
await messenger.send(node_id=NodeId.broadcast, message=SetupRequest())
await messenger.send(node_id=NodeId.broadcast, message=EnableMotorRequest())

pick_up_tip_runner = MoveGroupRunner(
Expand Down
2 changes: 0 additions & 2 deletions hardware/opentrons_hardware/scripts/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from opentrons_hardware.firmware_bindings.constants import NodeId

from opentrons_hardware.firmware_bindings.messages.message_definitions import (
SetupRequest,
EnableMotorRequest,
)
from opentrons_hardware.hardware_control.motion import (
Expand Down Expand Up @@ -47,7 +46,6 @@

async def run_move(messenger: CanMessenger) -> None:
"""Run the move."""
await messenger.send(node_id=NodeId.broadcast, message=SetupRequest())
await messenger.send(node_id=NodeId.broadcast, message=EnableMotorRequest())

# TODO (al, 2021-11-11): Allow creating groups from command line or config file.
Expand Down
3 changes: 0 additions & 3 deletions hardware/opentrons_hardware/scripts/sensor_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ async def run_test(messenger: CanMessenger, args: argparse.Namespace) -> None:
if NodeId.head not in found or target_pipette not in found:
raise RuntimeError(f"could not find targets for {args.mount} in {found}")

await messenger.send(
node_id=NodeId.broadcast, message=message_definitions.SetupRequest()
)
await messenger.send(
node_id=NodeId.broadcast, message=message_definitions.EnableMotorRequest()
)
Expand Down

0 comments on commit 53d3212

Please sign in to comment.