Simulator Support

Does PyLabRobot support a simulator similar to what you find when using the OpenTrons SDK directly? I see there is a visualizer discussed in the docs

there are two parts to this:

  1. PLR does a lot of simulation in the front end layer (like LiquidHandler) by default, regardless of whether you are connected to a machine or not. This helps us catch potentials errors (like trying to pick up a tip with no tip present) before we send a command to the machine. The level of simulation is controlled by enabling/disabling trackers (Using Trackers — PyLabRobot documentation). Some checks are always executed (like seeing if a destination location is legal). PLR’s internal model of the state is visualized by the Visualizer (Using the Visualizer — PyLabRobot documentation). [for background see ~big PLR update: visualizer + LH is a Resource - PyLabRobot Development - Lab Automation Forums]

  2. PLR works on a high level through 3 layers: front ends, backends and io. Front end is the nicer user API and is universal. Backends translate universal commands to machine specific commands. The io layer has objects like USB and Serial and actually sends commands to machines, and is also independent of the specific machine used. Most backends are for sending commands to actual machines, but nothing prevents you from creating dummy test backends. We have at least one per device class called the <Module>ChatterboxBackend, which just prints out all operations instead of sending them to a machine. See the Visualizer notebook for an example.

    2.1) When ‘simulation’ is used to validate existing protocols, we can actually keep the normal machine backends but spoof the io layer so that the backend thinks it’s talking to the actual machine but in reality its outputs/inputs are actually validated against a log file: aP Validation Against Log File Example — PyLabRobot documentation

2 Likes