How to use the marabunta.BaseRobot.BaseBody function in marabunta

To help you get started, we’ve selected a few marabunta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github david-mateo / marabunta / marabunta / BaseRobot.py View on Github external
def __init__(self, body, network):
        """As a way to make sure the body and network
        instances have the required method, this class
        only accept bodies that inherit from BaseBody
        and networks that inherit from BaseNetwork.
        """
        if isinstance(body, BaseBody):
            self.body = body
        else:
            raise Exception(
                "body is not an instance of BaseRobot.BaseBody()")
        if isinstance(network, BaseNetwork):
            self.network = network
        else:
            raise Exception(
                "network is not an instance of BaseRobot.BaseNetwork")
        self.working = False
        self.printing = False
        self.last_target = [0., 0.]
        return