Writing a new backend / Agnosticity

Hello Stefan and Rick!

After a while I’m back to work on the backend.

I setup the chatterbox backend in the basic.ipynb notebook to try it and to learn how to get the info I need to write the methods.

However I’ve been hitting walls when running the example notebooks and “test” backends.

Notebook problems

Cell 12 fails with a KeyError.

KeyError screenshot.

Running the cell again produces a “TipSpotHasNoTipError: Tip spot has no tip.” exception instead of the KeyError:

TipSpotHasNoTipError screenshot.

I’m guessing that it’s about num_channels, so I modified the chatterbox code a bit, without success.

    def __init__(self, num_channels: int, *args, **kwargs):
        """Copied over from saver_backend."""
        super().__init__(*args, **kwargs)
        self._num_channels = num_channels

    @property
    def num_channels(self) -> int:
        """ The number of channels that the robot has. """
        return self._num_channels

The SaverBackend produces the same error.

It looks for a “1” key, because this is the value of num_channels, but it is not found because the head dict is setup with range(num_channels). That generator produces zero-indexed keys, starting at num_channels-1.

I’m not sure what to do.

Help request

Overall I have 3-4 requests:

  1. I’d like to know if you could provide a basic working notebook, meant for development of new backends (e.g. a full to-do list, with examples for each item).
  2. It would be great to have an updated backend template, ready for developers to write methods.
    • It would be very helpful to have a development notebook with sample code showing how to handle inputs and get the important data from them (e.g. tip locations).
    • In general, a notebook showing how to use each of the PLR python classes/objects would be useful. Otherwise I see myself spending time reverse-engineering PLR, instead of writing the backend.
  3. A template showing how to define a new “deck” would be cool too. For example, the robot I’m working on does not really have a static deck. Each instance of a lab object has a particular XYX location.
  4. Updating all notebooks to work with the latest version, and all backends (particularly the dev/test ones).

I hope the list above helps show what kind of development docs I believe to be missing. Thanks in advance. :slight_smile:

Nico