Neural Net capabilities aren't inherently in the Reachy framework but it can be added using a Coral Edge TPU. reachy-tictactoe is an example of how this is done.

TictactoePlayground

The Reachy instance gets initialized here:

def __init__(self):
        logger.info('Creating the playground')

        self.reachy = Reachy(
            right_arm=RightArm(
                io='/dev/ttyUSB*',
                hand='force_gripper',
            ),
            head=Head(
                io='/dev/ttyUSB*',
            ),
        )

        self.pawn_played = 0

vision

Two models are used for tic tac toe, one to detect the state of the board and one to detect if the board is valid.

boxes_classifier = ClassificationEngine(os.path.join(model_path, 'ttt-boxes.tflite'))
boxes_labels = dataset_utils.read_label_file(os.path.join(model_path, 'ttt-boxes.txt'))

valid_classifier = ClassificationEngine(os.path.join(model_path, 'ttt-valid-board.tflite'))
valid_labels = dataset_utils.read_label_file(os.path.join(model_path, 'ttt-valid-board.txt')

Train classifier

The two models are based on mobilenet image model and they are fine tunes through transfer learning. The models are encapsulated with Coral's Imprinting Engine. The models are trained using the following Jupyter Notebook:

pollen-robotics/reachy-tictactoe

ttt-boxes

Detects whether or not a box has an X or an O or is empty. This classifier is used with identify_box() and get_board_configuration().

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/db2a550b-5294-41c6-9324-b6f950064304/Screen_Shot_2020-10-29_at_4.38.12_AM.png

Lables

ttt-valid-board