# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.


import sys
import os
if os.name == 'nt' and sys.version_info >= (3, 8):  # we need to explicitly list the folders containing the DLLs
    webots_home = os.environ['WEBOTS_HOME']
    os.add_dll_directory(os.path.join(webots_home, 'lib', 'wbcontroller'))
# MSYS2_HOME should be set by Webots or ~/.bash_profile
# if not set, we are in the case of an extern wbcontroller and a regularly installed version of Webots
    msys64_root = os.environ['MSYS2_HOME'] if 'MSYS2_HOME' in os.environ else os.path.join(webots_home, 'msys64')
    cpp_folder = os.path.join(msys64_root, 'mingw64', 'bin', 'cpp')
    if not os.path.isdir(cpp_folder):  # development environment
        cpp_folder = os.path.join(msys64_root, 'mingw64', 'bin')
    os.add_dll_directory(cpp_folder)



from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_controller')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_controller')
    _controller = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_controller', [dirname(__file__)])
        except ImportError:
            import _controller
            return _controller
        try:
            _mod = imp.load_module('_controller', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _controller = swig_import_helper()
    del swig_import_helper
else:
    import _controller
del _swig_python_version_info

try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

try:
    import builtins as __builtin__
except ImportError:
    import builtins

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except __builtin__.Exception:
    class _object:
        pass
    _newclass = 0


class AnsiCodes(object):
    RESET = u'\u001b[0m'

    BOLD = u'\u001b[1m'
    UNDERLINE = u'\u001b[4m'

    BLACK_BACKGROUND = u'\u001b[40m'
    RED_BACKGROUND = u'\u001b[41m'
    GREEN_BACKGROUND = u'\u001b[42m'
    YELLOW_BACKGROUND = u'\u001b[43m'
    BLUE_BACKGROUND = u'\u001b[44m'
    MAGENTA_BACKGROUND = u'\u001b[45m'
    CYAN_BACKGROUND = u'\u001b[46m'
    WHITE_BACKGROUND = u'\u001b[47m'

    BLACK_FOREGROUND = u'\u001b[30m'
    RED_FOREGROUND = u'\u001b[31m'
    GREEN_FOREGROUND = u'\u001b[32m'
    YELLOW_FOREGROUND = u'\u001b[33m'
    BLUE_FOREGROUND = u'\u001b[34m'
    MAGENTA_FOREGROUND = u'\u001b[35m'
    CYAN_FOREGROUND = u'\u001b[36m'
    WHITE_FOREGROUND = u'\u001b[37m'

    CLEAR_SCREEN = u'\u001b[2J'

class Device(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Device, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Device, name)

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    __swig_destroy__ = _controller.delete_Device
    __del__ = lambda self: None

    def getName(self):
        return _controller.Device_getName(self)

    def getModel(self):
        return _controller.Device_getModel(self)

    def getNodeType(self):
        return _controller.Device_getNodeType(self)

    def getTag(self):
        return _controller.Device_getTag(self)
    if _newclass:
        hasType = staticmethod(_controller.Device_hasType)
    else:
        hasType = _controller.Device_hasType
Device_swigregister = _controller.Device_swigregister
Device_swigregister(Device)

def Device_hasType(tag, type):
    return _controller.Device_hasType(tag, type)
Device_hasType = _controller.Device_hasType

class Accelerometer(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Accelerometer, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Accelerometer, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Accelerometer(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Accelerometer
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.Accelerometer_enable(self, samplingPeriod)

    def disable(self):
        return _controller.Accelerometer_disable(self)

    def getSamplingPeriod(self):
        return _controller.Accelerometer_getSamplingPeriod(self)

    def getValues(self):
        return _controller.Accelerometer_getValues(self)

    def __internalGetLookupTableSize(self):
        return _controller.Accelerometer___internalGetLookupTableSize(self)

    def getLookupTable(self):
        return _controller.Accelerometer_getLookupTable(self)
Accelerometer_swigregister = _controller.Accelerometer_swigregister
Accelerometer_swigregister(Accelerometer)

class Brake(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Brake, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Brake, name)
    __repr__ = _swig_repr
    ROTATIONAL = _controller.Brake_ROTATIONAL
    LINEAR = _controller.Brake_LINEAR

    def __init__(self, name):
        this = _controller.new_Brake(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Brake
    __del__ = lambda self: None

    def getType(self):
        return _controller.Brake_getType(self)

    def setDampingConstant(self, dampingConstant):
        return _controller.Brake_setDampingConstant(self, dampingConstant)

    def getMotor(self):
        return _controller.Brake_getMotor(self)

    def getPositionSensor(self):
        return _controller.Brake_getPositionSensor(self)

    def getMotorTag(self):
        return _controller.Brake_getMotorTag(self)

    def getPositionSensorTag(self):
        return _controller.Brake_getPositionSensorTag(self)
    ANGULAR = _controller.Brake_ANGULAR

    def getMotor(self):
        try:
            return self.__motor
        except AttributeError:
            self.__motor = Robot.internalGetDeviceFromTag(self.getMotorTag())
            return self.__motor
    def getPositionSensor(self):
        try:
            return self.instance
        except AttributeError:
            self.__positionSensor = Robot.internalGetDeviceFromTag(self.getPositionSensorTag())
            return self.__positionSensor

Brake_swigregister = _controller.Brake_swigregister
Brake_swigregister(Brake)

class CameraRecognitionObject(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, CameraRecognitionObject, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, CameraRecognitionObject, name)
    __repr__ = _swig_repr
    __swig_setmethods__["id"] = _controller.CameraRecognitionObject_id_set
    __swig_getmethods__["id"] = _controller.CameraRecognitionObject_id_get
    if _newclass:
        id = _swig_property(_controller.CameraRecognitionObject_id_get, _controller.CameraRecognitionObject_id_set)
    __swig_setmethods__["position"] = _controller.CameraRecognitionObject_position_set
    __swig_getmethods__["position"] = _controller.CameraRecognitionObject_position_get
    if _newclass:
        position = _swig_property(_controller.CameraRecognitionObject_position_get, _controller.CameraRecognitionObject_position_set)
    __swig_setmethods__["orientation"] = _controller.CameraRecognitionObject_orientation_set
    __swig_getmethods__["orientation"] = _controller.CameraRecognitionObject_orientation_get
    if _newclass:
        orientation = _swig_property(_controller.CameraRecognitionObject_orientation_get, _controller.CameraRecognitionObject_orientation_set)
    __swig_setmethods__["size"] = _controller.CameraRecognitionObject_size_set
    __swig_getmethods__["size"] = _controller.CameraRecognitionObject_size_get
    if _newclass:
        size = _swig_property(_controller.CameraRecognitionObject_size_get, _controller.CameraRecognitionObject_size_set)
    __swig_setmethods__["position_on_image"] = _controller.CameraRecognitionObject_position_on_image_set
    __swig_getmethods__["position_on_image"] = _controller.CameraRecognitionObject_position_on_image_get
    if _newclass:
        position_on_image = _swig_property(_controller.CameraRecognitionObject_position_on_image_get, _controller.CameraRecognitionObject_position_on_image_set)
    __swig_setmethods__["size_on_image"] = _controller.CameraRecognitionObject_size_on_image_set
    __swig_getmethods__["size_on_image"] = _controller.CameraRecognitionObject_size_on_image_get
    if _newclass:
        size_on_image = _swig_property(_controller.CameraRecognitionObject_size_on_image_get, _controller.CameraRecognitionObject_size_on_image_set)
    __swig_setmethods__["number_of_colors"] = _controller.CameraRecognitionObject_number_of_colors_set
    __swig_getmethods__["number_of_colors"] = _controller.CameraRecognitionObject_number_of_colors_get
    if _newclass:
        number_of_colors = _swig_property(_controller.CameraRecognitionObject_number_of_colors_get, _controller.CameraRecognitionObject_number_of_colors_set)
    __swig_setmethods__["colors"] = _controller.CameraRecognitionObject_colors_set
    __swig_getmethods__["colors"] = _controller.CameraRecognitionObject_colors_get
    if _newclass:
        colors = _swig_property(_controller.CameraRecognitionObject_colors_get, _controller.CameraRecognitionObject_colors_set)
    __swig_setmethods__["model"] = _controller.CameraRecognitionObject_model_set
    __swig_getmethods__["model"] = _controller.CameraRecognitionObject_model_get
    if _newclass:
        model = _swig_property(_controller.CameraRecognitionObject_model_get, _controller.CameraRecognitionObject_model_set)

    def get_position(self):
        return _controller.CameraRecognitionObject_get_position(self)

    def get_orientation(self):
        return _controller.CameraRecognitionObject_get_orientation(self)

    def get_size(self):
        return _controller.CameraRecognitionObject_get_size(self)

    def get_position_on_image(self):
        return _controller.CameraRecognitionObject_get_position_on_image(self)

    def get_size_on_image(self):
        return _controller.CameraRecognitionObject_get_size_on_image(self)

    def get_colors(self):
        return _controller.CameraRecognitionObject_get_colors(self)

    def get_id(self):
        return _controller.CameraRecognitionObject_get_id(self)

    def get_number_of_colors(self):
        return _controller.CameraRecognitionObject_get_number_of_colors(self)

    def get_model(self):
        return _controller.CameraRecognitionObject_get_model(self)

    def __init__(self):
        this = _controller.new_CameraRecognitionObject()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_CameraRecognitionObject
    __del__ = lambda self: None
CameraRecognitionObject_swigregister = _controller.CameraRecognitionObject_swigregister
CameraRecognitionObject_swigregister(CameraRecognitionObject)

class Camera(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Camera, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Camera, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Camera(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Camera
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.Camera_enable(self, samplingPeriod)

    def disable(self):
        return _controller.Camera_disable(self)

    def getSamplingPeriod(self):
        return _controller.Camera_getSamplingPeriod(self)

    def getImage(self):
        return _controller.Camera_getImage(self)

    def getWidth(self):
        return _controller.Camera_getWidth(self)

    def getHeight(self):
        return _controller.Camera_getHeight(self)

    def getFov(self):
        return _controller.Camera_getFov(self)

    def getMaxFov(self):
        return _controller.Camera_getMaxFov(self)

    def getMinFov(self):
        return _controller.Camera_getMinFov(self)

    def setFov(self, fov):
        return _controller.Camera_setFov(self, fov)

    def getExposure(self):
        return _controller.Camera_getExposure(self)

    def setExposure(self, exposure):
        return _controller.Camera_setExposure(self, exposure)

    def getFocalLength(self):
        return _controller.Camera_getFocalLength(self)

    def getFocalDistance(self):
        return _controller.Camera_getFocalDistance(self)

    def getMaxFocalDistance(self):
        return _controller.Camera_getMaxFocalDistance(self)

    def getMinFocalDistance(self):
        return _controller.Camera_getMinFocalDistance(self)

    def setFocalDistance(self, focalDistance):
        return _controller.Camera_setFocalDistance(self, focalDistance)

    def getNear(self):
        return _controller.Camera_getNear(self)

    def saveImage(self, filename, quality):
        return _controller.Camera_saveImage(self, filename, quality)

    def hasRecognition(self):
        return _controller.Camera_hasRecognition(self)

    def recognitionEnable(self, samplingPeriod):
        return _controller.Camera_recognitionEnable(self, samplingPeriod)

    def recognitionDisable(self):
        return _controller.Camera_recognitionDisable(self)

    def getRecognitionSamplingPeriod(self):
        return _controller.Camera_getRecognitionSamplingPeriod(self)

    def getRecognitionNumberOfObjects(self):
        return _controller.Camera_getRecognitionNumberOfObjects(self)

    def getRecognitionObjects(self):
        return _controller.Camera_getRecognitionObjects(self)

    def hasRecognitionSegmentation(self):
        return _controller.Camera_hasRecognitionSegmentation(self)

    def enableRecognitionSegmentation(self):
        return _controller.Camera_enableRecognitionSegmentation(self)

    def disableRecognitionSegmentation(self):
        return _controller.Camera_disableRecognitionSegmentation(self)

    def isRecognitionSegmentationEnabled(self):
        return _controller.Camera_isRecognitionSegmentationEnabled(self)

    def getRecognitionSegmentationImage(self):
        return _controller.Camera_getRecognitionSegmentationImage(self)

    def saveRecognitionSegmentationImage(self, filename, quality):
        return _controller.Camera_saveRecognitionSegmentationImage(self, filename, quality)

    def getImageArray(self):
        return _controller.Camera_getImageArray(self)
    if _newclass:
        imageGetRed = staticmethod(_controller.Camera_imageGetRed)
    else:
        imageGetRed = _controller.Camera_imageGetRed
    if _newclass:
        imageGetGreen = staticmethod(_controller.Camera_imageGetGreen)
    else:
        imageGetGreen = _controller.Camera_imageGetGreen
    if _newclass:
        imageGetBlue = staticmethod(_controller.Camera_imageGetBlue)
    else:
        imageGetBlue = _controller.Camera_imageGetBlue
    if _newclass:
        imageGetGray = staticmethod(_controller.Camera_imageGetGray)
    else:
        imageGetGray = _controller.Camera_imageGetGray
    if _newclass:
        imageGetGrey = staticmethod(_controller.Camera_imageGetGrey)
    else:
        imageGetGrey = _controller.Camera_imageGetGrey

    def getRecognitionObject(self, index):
        return _controller.Camera_getRecognitionObject(self, index)

    def getRecognitionObjects(self):
       ret = []
       for i in range(self.getRecognitionNumberOfObjects()):
         ret.append(self.getRecognitionObject(i))
       return ret


    def getRecognitionSegmentationImageArray(self):
        return _controller.Camera_getRecognitionSegmentationImageArray(self)
Camera_swigregister = _controller.Camera_swigregister
Camera_swigregister(Camera)

def Camera_imageGetRed(*args):
    return _controller.Camera_imageGetRed(*args)
Camera_imageGetRed = _controller.Camera_imageGetRed

def Camera_imageGetGreen(*args):
    return _controller.Camera_imageGetGreen(*args)
Camera_imageGetGreen = _controller.Camera_imageGetGreen

def Camera_imageGetBlue(*args):
    return _controller.Camera_imageGetBlue(*args)
Camera_imageGetBlue = _controller.Camera_imageGetBlue

def Camera_imageGetGray(*args):
    return _controller.Camera_imageGetGray(*args)
Camera_imageGetGray = _controller.Camera_imageGetGray

def Camera_imageGetGrey(*args):
    return _controller.Camera_imageGetGrey(*args)
Camera_imageGetGrey = _controller.Camera_imageGetGrey

class Compass(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Compass, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Compass, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Compass(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Compass
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.Compass_enable(self, samplingPeriod)

    def disable(self):
        return _controller.Compass_disable(self)

    def getSamplingPeriod(self):
        return _controller.Compass_getSamplingPeriod(self)

    def getValues(self):
        return _controller.Compass_getValues(self)

    def __internalGetLookupTableSize(self):
        return _controller.Compass___internalGetLookupTableSize(self)

    def getLookupTable(self):
        return _controller.Compass_getLookupTable(self)
Compass_swigregister = _controller.Compass_swigregister
Compass_swigregister(Compass)

class Connector(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Connector, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Connector, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Connector(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Connector
    __del__ = lambda self: None

    def enablePresence(self, samplingPeriod):
        return _controller.Connector_enablePresence(self, samplingPeriod)

    def disablePresence(self):
        return _controller.Connector_disablePresence(self)

    def getPresenceSamplingPeriod(self):
        return _controller.Connector_getPresenceSamplingPeriod(self)

    def getPresence(self):
        return _controller.Connector_getPresence(self)

    def isLocked(self):
        return _controller.Connector_isLocked(self)

    def lock(self):
        return _controller.Connector_lock(self)

    def unlock(self):
        return _controller.Connector_unlock(self)
Connector_swigregister = _controller.Connector_swigregister
Connector_swigregister(Connector)

class ImageRef(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, ImageRef, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, ImageRef, name)
    __repr__ = _swig_repr

    def __init__(self, imageRef):
        this = _controller.new_ImageRef(imageRef)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_ImageRef
    __del__ = lambda self: None

    def getImageRef(self):
        return _controller.ImageRef_getImageRef(self)
ImageRef_swigregister = _controller.ImageRef_swigregister
ImageRef_swigregister(ImageRef)

class Display(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Display, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Display, name)
    __repr__ = _swig_repr
    RGB = _controller.Display_RGB
    RGBA = _controller.Display_RGBA
    ARGB = _controller.Display_ARGB
    BGRA = _controller.Display_BGRA
    ABGR = _controller.Display_ABGR

    def __init__(self, name):
        this = _controller.new_Display(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Display
    __del__ = lambda self: None

    def getWidth(self):
        return _controller.Display_getWidth(self)

    def getHeight(self):
        return _controller.Display_getHeight(self)

    def setColor(self, color):
        return _controller.Display_setColor(self, color)

    def setAlpha(self, alpha):
        return _controller.Display_setAlpha(self, alpha)

    def setOpacity(self, opacity):
        return _controller.Display_setOpacity(self, opacity)

    def setFont(self, font, size, antiAliasing):
        return _controller.Display_setFont(self, font, size, antiAliasing)

    def attachCamera(self, camera):
        return _controller.Display_attachCamera(self, camera)

    def detachCamera(self):
        return _controller.Display_detachCamera(self)

    def drawPixel(self, x1, y1):
        return _controller.Display_drawPixel(self, x1, y1)

    def drawLine(self, x1, y1, x2, y2):
        return _controller.Display_drawLine(self, x1, y1, x2, y2)

    def drawRectangle(self, x, y, width, height):
        return _controller.Display_drawRectangle(self, x, y, width, height)

    def drawOval(self, cx, cy, a, b):
        return _controller.Display_drawOval(self, cx, cy, a, b)

    def __internalDrawPolygon(self, x, y, size):
        return _controller.Display___internalDrawPolygon(self, x, y, size)

    def drawText(self, txt, x, y):
        return _controller.Display_drawText(self, txt, x, y)

    def fillRectangle(self, x, y, width, height):
        return _controller.Display_fillRectangle(self, x, y, width, height)

    def fillOval(self, cx, cy, a, b):
        return _controller.Display_fillOval(self, cx, cy, a, b)

    def __internalFillPolygon(self, x, y, size):
        return _controller.Display___internalFillPolygon(self, x, y, size)

    def __internalImageNew(self, width, height, data, format):
        return _controller.Display___internalImageNew(self, width, height, data, format)

    def imageCopy(self, x, y, width, height):
        return _controller.Display_imageCopy(self, x, y, width, height)

    def imagePaste(self, ir, x, y, blend=False):
        return _controller.Display_imagePaste(self, ir, x, y, blend)

    def imageLoad(self, filename):
        return _controller.Display_imageLoad(self, filename)

    def imageSave(self, ir, filename):
        return _controller.Display_imageSave(self, ir, filename)

    def imageDelete(self, ir):
        return _controller.Display_imageDelete(self, ir)

    def imageNew(self, data, format, width=None, height=None):
      if isinstance(data, list):
        return self.__internalImageNew(len(data), len(data[0]), data, format)
      elif width is None or height is None:
        raise TypeError('imageNew : width and height must be given if data is not a list')
      else:
        return self.__internalImageNew(width, height, data, format)
    def drawPolygon(self, x, y):
      self.__internalDrawPolygon(x, y, min(len(x), len(y)))
    def fillPolygon(self, x, y):
      self.__internalFillPolygon(x, y, min(len(x), len(y)))

Display_swigregister = _controller.Display_swigregister
Display_swigregister(Display)

class DistanceSensor(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, DistanceSensor, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, DistanceSensor, name)
    __repr__ = _swig_repr
    GENERIC = _controller.DistanceSensor_GENERIC
    INFRA_RED = _controller.DistanceSensor_INFRA_RED
    SONAR = _controller.DistanceSensor_SONAR
    LASER = _controller.DistanceSensor_LASER

    def __init__(self, name):
        this = _controller.new_DistanceSensor(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_DistanceSensor
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.DistanceSensor_enable(self, samplingPeriod)

    def disable(self):
        return _controller.DistanceSensor_disable(self)

    def getSamplingPeriod(self):
        return _controller.DistanceSensor_getSamplingPeriod(self)

    def getValue(self):
        return _controller.DistanceSensor_getValue(self)

    def getMaxValue(self):
        return _controller.DistanceSensor_getMaxValue(self)

    def getMinValue(self):
        return _controller.DistanceSensor_getMinValue(self)

    def getAperture(self):
        return _controller.DistanceSensor_getAperture(self)

    def __internalGetLookupTableSize(self):
        return _controller.DistanceSensor___internalGetLookupTableSize(self)

    def getLookupTable(self):
        return _controller.DistanceSensor_getLookupTable(self)

    def getType(self):
        return _controller.DistanceSensor_getType(self)
DistanceSensor_swigregister = _controller.DistanceSensor_swigregister
DistanceSensor_swigregister(DistanceSensor)

class Emitter(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Emitter, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Emitter, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Emitter(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Emitter
    __del__ = lambda self: None
    CHANNEL_BROADCAST = _controller.Emitter_CHANNEL_BROADCAST

    def send(self, data):
        return _controller.Emitter_send(self, data)

    def getBufferSize(self):
        return _controller.Emitter_getBufferSize(self)

    def setChannel(self, channel):
        return _controller.Emitter_setChannel(self, channel)

    def getChannel(self):
        return _controller.Emitter_getChannel(self)

    def getRange(self):
        return _controller.Emitter_getRange(self)

    def setRange(self, range):
        return _controller.Emitter_setRange(self, range)
Emitter_swigregister = _controller.Emitter_swigregister
Emitter_swigregister(Emitter)

class Field(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Field, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Field, name)

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    NO_FIELD = _controller.Field_NO_FIELD
    SF_BOOL = _controller.Field_SF_BOOL
    SF_INT32 = _controller.Field_SF_INT32
    SF_FLOAT = _controller.Field_SF_FLOAT
    SF_VEC2F = _controller.Field_SF_VEC2F
    SF_VEC3F = _controller.Field_SF_VEC3F
    SF_ROTATION = _controller.Field_SF_ROTATION
    SF_COLOR = _controller.Field_SF_COLOR
    SF_STRING = _controller.Field_SF_STRING
    SF_NODE = _controller.Field_SF_NODE
    MF = _controller.Field_MF
    MF_BOOL = _controller.Field_MF_BOOL
    MF_INT32 = _controller.Field_MF_INT32
    MF_FLOAT = _controller.Field_MF_FLOAT
    MF_VEC2F = _controller.Field_MF_VEC2F
    MF_VEC3F = _controller.Field_MF_VEC3F
    MF_ROTATION = _controller.Field_MF_ROTATION
    MF_COLOR = _controller.Field_MF_COLOR
    MF_STRING = _controller.Field_MF_STRING
    MF_NODE = _controller.Field_MF_NODE

    def getType(self):
        return _controller.Field_getType(self)

    def getTypeName(self):
        return _controller.Field_getTypeName(self)

    def getCount(self):
        return _controller.Field_getCount(self)

    def getSFBool(self):
        return _controller.Field_getSFBool(self)

    def getSFInt32(self):
        return _controller.Field_getSFInt32(self)

    def getSFFloat(self):
        return _controller.Field_getSFFloat(self)

    def getSFVec2f(self):
        return _controller.Field_getSFVec2f(self)

    def getSFVec3f(self):
        return _controller.Field_getSFVec3f(self)

    def getSFRotation(self):
        return _controller.Field_getSFRotation(self)

    def getSFColor(self):
        return _controller.Field_getSFColor(self)

    def getSFString(self):
        return _controller.Field_getSFString(self)

    def getSFNode(self):
        return _controller.Field_getSFNode(self)

    def getMFBool(self, index):
        return _controller.Field_getMFBool(self, index)

    def getMFInt32(self, index):
        return _controller.Field_getMFInt32(self, index)

    def getMFFloat(self, index):
        return _controller.Field_getMFFloat(self, index)

    def getMFVec2f(self, index):
        return _controller.Field_getMFVec2f(self, index)

    def getMFVec3f(self, index):
        return _controller.Field_getMFVec3f(self, index)

    def getMFRotation(self, index):
        return _controller.Field_getMFRotation(self, index)

    def getMFColor(self, index):
        return _controller.Field_getMFColor(self, index)

    def getMFString(self, index):
        return _controller.Field_getMFString(self, index)

    def getMFNode(self, index):
        return _controller.Field_getMFNode(self, index)

    def setSFBool(self, value):
        return _controller.Field_setSFBool(self, value)

    def setSFInt32(self, value):
        return _controller.Field_setSFInt32(self, value)

    def setSFFloat(self, value):
        return _controller.Field_setSFFloat(self, value)

    def setSFVec2f(self, values):
        return _controller.Field_setSFVec2f(self, values)

    def setSFVec3f(self, values):
        return _controller.Field_setSFVec3f(self, values)

    def setSFRotation(self, values):
        return _controller.Field_setSFRotation(self, values)

    def setSFColor(self, values):
        return _controller.Field_setSFColor(self, values)

    def setSFString(self, value):
        return _controller.Field_setSFString(self, value)

    def setMFBool(self, index, value):
        return _controller.Field_setMFBool(self, index, value)

    def setMFInt32(self, index, value):
        return _controller.Field_setMFInt32(self, index, value)

    def setMFFloat(self, index, value):
        return _controller.Field_setMFFloat(self, index, value)

    def setMFVec2f(self, index, values):
        return _controller.Field_setMFVec2f(self, index, values)

    def setMFVec3f(self, index, values):
        return _controller.Field_setMFVec3f(self, index, values)

    def setMFRotation(self, index, values):
        return _controller.Field_setMFRotation(self, index, values)

    def setMFColor(self, index, values):
        return _controller.Field_setMFColor(self, index, values)

    def setMFString(self, index, value):
        return _controller.Field_setMFString(self, index, value)

    def insertMFBool(self, index, value):
        return _controller.Field_insertMFBool(self, index, value)

    def insertMFInt32(self, index, value):
        return _controller.Field_insertMFInt32(self, index, value)

    def insertMFFloat(self, index, value):
        return _controller.Field_insertMFFloat(self, index, value)

    def insertMFVec2f(self, index, values):
        return _controller.Field_insertMFVec2f(self, index, values)

    def insertMFVec3f(self, index, values):
        return _controller.Field_insertMFVec3f(self, index, values)

    def insertMFRotation(self, index, values):
        return _controller.Field_insertMFRotation(self, index, values)

    def insertMFColor(self, index, values):
        return _controller.Field_insertMFColor(self, index, values)

    def insertMFString(self, index, value):
        return _controller.Field_insertMFString(self, index, value)

    def removeMF(self, index):
        return _controller.Field_removeMF(self, index)

    def removeSF(self):
        return _controller.Field_removeSF(self)

    def importMFNode(self, position, filename):
        return _controller.Field_importMFNode(self, position, filename)

    def importMFNodeFromString(self, position, nodeString):
        return _controller.Field_importMFNodeFromString(self, position, nodeString)

    def importSFNode(self, filename):
        return _controller.Field_importSFNode(self, filename)

    def importSFNodeFromString(self, nodeString):
        return _controller.Field_importSFNodeFromString(self, nodeString)

    def removeMFNode(self, position):
        return _controller.Field_removeMFNode(self, position)
Field_swigregister = _controller.Field_swigregister
Field_swigregister(Field)

class GPS(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, GPS, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, GPS, name)
    __repr__ = _swig_repr
    LOCAL = _controller.GPS_LOCAL
    WGS84 = _controller.GPS_WGS84

    def __init__(self, name):
        this = _controller.new_GPS(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_GPS
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.GPS_enable(self, samplingPeriod)

    def disable(self):
        return _controller.GPS_disable(self)

    def getSamplingPeriod(self):
        return _controller.GPS_getSamplingPeriod(self)

    def getValues(self):
        return _controller.GPS_getValues(self)

    def getSpeed(self):
        return _controller.GPS_getSpeed(self)

    def getCoordinateSystem(self):
        return _controller.GPS_getCoordinateSystem(self)
    if _newclass:
        convertToDegreesMinutesSeconds = staticmethod(_controller.GPS_convertToDegreesMinutesSeconds)
    else:
        convertToDegreesMinutesSeconds = _controller.GPS_convertToDegreesMinutesSeconds
GPS_swigregister = _controller.GPS_swigregister
GPS_swigregister(GPS)

def GPS_convertToDegreesMinutesSeconds(decimalDegree):
    return _controller.GPS_convertToDegreesMinutesSeconds(decimalDegree)
GPS_convertToDegreesMinutesSeconds = _controller.GPS_convertToDegreesMinutesSeconds

class Gyro(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Gyro, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Gyro, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Gyro(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Gyro
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.Gyro_enable(self, samplingPeriod)

    def disable(self):
        return _controller.Gyro_disable(self)

    def getSamplingPeriod(self):
        return _controller.Gyro_getSamplingPeriod(self)

    def getValues(self):
        return _controller.Gyro_getValues(self)

    def __internalGetLookupTableSize(self):
        return _controller.Gyro___internalGetLookupTableSize(self)

    def getLookupTable(self):
        return _controller.Gyro_getLookupTable(self)
Gyro_swigregister = _controller.Gyro_swigregister
Gyro_swigregister(Gyro)

class InertialUnit(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, InertialUnit, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, InertialUnit, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_InertialUnit(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_InertialUnit
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.InertialUnit_enable(self, samplingPeriod)

    def disable(self):
        return _controller.InertialUnit_disable(self)

    def getSamplingPeriod(self):
        return _controller.InertialUnit_getSamplingPeriod(self)

    def getRollPitchYaw(self):
        return _controller.InertialUnit_getRollPitchYaw(self)

    def getQuaternion(self):
        return _controller.InertialUnit_getQuaternion(self)

    def getNoise(self):
        return _controller.InertialUnit_getNoise(self)
InertialUnit_swigregister = _controller.InertialUnit_swigregister
InertialUnit_swigregister(InertialUnit)

class Joystick(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Joystick, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Joystick, name)
    __repr__ = _swig_repr

    def __init__(self):
        this = _controller.new_Joystick()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Joystick
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.Joystick_enable(self, samplingPeriod)

    def disable(self):
        return _controller.Joystick_disable(self)

    def getSamplingPeriod(self):
        return _controller.Joystick_getSamplingPeriod(self)

    def isConnected(self):
        return _controller.Joystick_isConnected(self)

    def getModel(self):
        return _controller.Joystick_getModel(self)

    def getNumberOfAxes(self):
        return _controller.Joystick_getNumberOfAxes(self)

    def getAxisValue(self, axis):
        return _controller.Joystick_getAxisValue(self, axis)

    def getNumberOfPovs(self):
        return _controller.Joystick_getNumberOfPovs(self)

    def getPovValue(self, pov):
        return _controller.Joystick_getPovValue(self, pov)

    def getPressedButton(self):
        return _controller.Joystick_getPressedButton(self)

    def setConstantForce(self, level):
        return _controller.Joystick_setConstantForce(self, level)

    def setConstantForceDuration(self, duration):
        return _controller.Joystick_setConstantForceDuration(self, duration)

    def setAutoCenteringGain(self, gain):
        return _controller.Joystick_setAutoCenteringGain(self, gain)

    def setResistanceGain(self, gain):
        return _controller.Joystick_setResistanceGain(self, gain)

    def setForceAxis(self, axis):
        return _controller.Joystick_setForceAxis(self, axis)
Joystick_swigregister = _controller.Joystick_swigregister
Joystick_swigregister(Joystick)

class Keyboard(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Keyboard, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Keyboard, name)
    __repr__ = _swig_repr
    END = _controller.Keyboard_END
    HOME = _controller.Keyboard_HOME
    LEFT = _controller.Keyboard_LEFT
    UP = _controller.Keyboard_UP
    RIGHT = _controller.Keyboard_RIGHT
    DOWN = _controller.Keyboard_DOWN
    PAGEUP = _controller.Keyboard_PAGEUP
    PAGEDOWN = _controller.Keyboard_PAGEDOWN
    NUMPAD_HOME = _controller.Keyboard_NUMPAD_HOME
    NUMPAD_LEFT = _controller.Keyboard_NUMPAD_LEFT
    NUMPAD_UP = _controller.Keyboard_NUMPAD_UP
    NUMPAD_RIGHT = _controller.Keyboard_NUMPAD_RIGHT
    NUMPAD_DOWN = _controller.Keyboard_NUMPAD_DOWN
    NUMPAD_END = _controller.Keyboard_NUMPAD_END
    KEY = _controller.Keyboard_KEY
    SHIFT = _controller.Keyboard_SHIFT
    CONTROL = _controller.Keyboard_CONTROL
    ALT = _controller.Keyboard_ALT

    def __init__(self):
        this = _controller.new_Keyboard()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Keyboard
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.Keyboard_enable(self, samplingPeriod)

    def disable(self):
        return _controller.Keyboard_disable(self)

    def getSamplingPeriod(self):
        return _controller.Keyboard_getSamplingPeriod(self)

    def getKey(self):
        return _controller.Keyboard_getKey(self)
Keyboard_swigregister = _controller.Keyboard_swigregister
Keyboard_swigregister(Keyboard)

class LED(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, LED, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, LED, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_LED(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_LED
    __del__ = lambda self: None

    def set(self, value):
        return _controller.LED_set(self, value)

    def get(self):
        return _controller.LED_get(self)
LED_swigregister = _controller.LED_swigregister
LED_swigregister(LED)

class LidarPoint(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, LidarPoint, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, LidarPoint, name)
    __repr__ = _swig_repr
    __swig_setmethods__["x"] = _controller.LidarPoint_x_set
    __swig_getmethods__["x"] = _controller.LidarPoint_x_get
    if _newclass:
        x = _swig_property(_controller.LidarPoint_x_get, _controller.LidarPoint_x_set)
    __swig_setmethods__["y"] = _controller.LidarPoint_y_set
    __swig_getmethods__["y"] = _controller.LidarPoint_y_get
    if _newclass:
        y = _swig_property(_controller.LidarPoint_y_get, _controller.LidarPoint_y_set)
    __swig_setmethods__["z"] = _controller.LidarPoint_z_set
    __swig_getmethods__["z"] = _controller.LidarPoint_z_get
    if _newclass:
        z = _swig_property(_controller.LidarPoint_z_get, _controller.LidarPoint_z_set)
    __swig_setmethods__["layer_id"] = _controller.LidarPoint_layer_id_set
    __swig_getmethods__["layer_id"] = _controller.LidarPoint_layer_id_get
    if _newclass:
        layer_id = _swig_property(_controller.LidarPoint_layer_id_get, _controller.LidarPoint_layer_id_set)
    __swig_setmethods__["time"] = _controller.LidarPoint_time_set
    __swig_getmethods__["time"] = _controller.LidarPoint_time_get
    if _newclass:
        time = _swig_property(_controller.LidarPoint_time_get, _controller.LidarPoint_time_set)

    def __init__(self):
        this = _controller.new_LidarPoint()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_LidarPoint
    __del__ = lambda self: None
LidarPoint_swigregister = _controller.LidarPoint_swigregister
LidarPoint_swigregister(LidarPoint)

class Lidar(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Lidar, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Lidar, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Lidar(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Lidar
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.Lidar_enable(self, samplingPeriod)

    def enablePointCloud(self):
        return _controller.Lidar_enablePointCloud(self)

    def disable(self):
        return _controller.Lidar_disable(self)

    def disablePointCloud(self):
        return _controller.Lidar_disablePointCloud(self)

    def getSamplingPeriod(self):
        return _controller.Lidar_getSamplingPeriod(self)

    def isPointCloudEnabled(self):
        return _controller.Lidar_isPointCloudEnabled(self)

    def getRangeImage(self):
        return _controller.Lidar_getRangeImage(self)

    def getLayerRangeImage(self, layer):
        return _controller.Lidar_getLayerRangeImage(self, layer)

    def getPointCloud(self):
        return _controller.Lidar_getPointCloud(self)

    def getLayerPointCloud(self, layer):
        return _controller.Lidar_getLayerPointCloud(self, layer)

    def getNumberOfPoints(self):
        return _controller.Lidar_getNumberOfPoints(self)

    def getHorizontalResolution(self):
        return _controller.Lidar_getHorizontalResolution(self)

    def getNumberOfLayers(self):
        return _controller.Lidar_getNumberOfLayers(self)

    def getMinFrequency(self):
        return _controller.Lidar_getMinFrequency(self)

    def getMaxFrequency(self):
        return _controller.Lidar_getMaxFrequency(self)

    def getFrequency(self):
        return _controller.Lidar_getFrequency(self)

    def setFrequency(self, frequency):
        return _controller.Lidar_setFrequency(self, frequency)

    def getFov(self):
        return _controller.Lidar_getFov(self)

    def getVerticalFov(self):
        return _controller.Lidar_getVerticalFov(self)

    def getMinRange(self):
        return _controller.Lidar_getMinRange(self)

    def getMaxRange(self):
        return _controller.Lidar_getMaxRange(self)

    def getPoint(self, index):
        return _controller.Lidar_getPoint(self, index)

    def __getPointCloudBuffer(self):
        return _controller.Lidar___getPointCloudBuffer(self)

    def __getPointCloudList(self):
        return _controller.Lidar___getPointCloudList(self)

    def getLayerPoint(self, layer, index):
        return _controller.Lidar_getLayerPoint(self, layer, index)

    import sys

    def getPointCloud(self, data_type='list'):
      if data_type == 'list':
        return self.__getPointCloudList()
      elif data_type == 'buffer':
        return self.__getPointCloudBuffer()
      else:
        sys.stderr.write("Error: `data_type` cannot be `{}`! Supported values are 'list' and 'buffer'.\n".format(data_type))
        return None

    def getLayerPointCloud(self, layer):
       ret = []
       for i in range(self.getHorizontalResolution()):
         ret.append(self.getLayerPoint(layer, i))
       return ret


    def getRangeImageArray(self):
        return _controller.Lidar_getRangeImageArray(self)
Lidar_swigregister = _controller.Lidar_swigregister
Lidar_swigregister(Lidar)

class LightSensor(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, LightSensor, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, LightSensor, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_LightSensor(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_LightSensor
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.LightSensor_enable(self, samplingPeriod)

    def disable(self):
        return _controller.LightSensor_disable(self)

    def getSamplingPeriod(self):
        return _controller.LightSensor_getSamplingPeriod(self)

    def getValue(self):
        return _controller.LightSensor_getValue(self)

    def __internalGetLookupTableSize(self):
        return _controller.LightSensor___internalGetLookupTableSize(self)

    def getLookupTable(self):
        return _controller.LightSensor_getLookupTable(self)
LightSensor_swigregister = _controller.LightSensor_swigregister
LightSensor_swigregister(LightSensor)

class Motion(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Motion, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Motion, name)
    __repr__ = _swig_repr

    def __init__(self, fileName):
        this = _controller.new_Motion(fileName)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    def isValid(self):
        return _controller.Motion_isValid(self)
    __swig_destroy__ = _controller.delete_Motion
    __del__ = lambda self: None

    def play(self):
        return _controller.Motion_play(self)

    def stop(self):
        return _controller.Motion_stop(self)

    def getDuration(self):
        return _controller.Motion_getDuration(self)

    def getTime(self):
        return _controller.Motion_getTime(self)

    def setTime(self, time):
        return _controller.Motion_setTime(self, time)

    def setReverse(self, reverse):
        return _controller.Motion_setReverse(self, reverse)

    def setLoop(self, loop):
        return _controller.Motion_setLoop(self, loop)

    def isOver(self):
        return _controller.Motion_isOver(self)
Motion_swigregister = _controller.Motion_swigregister
Motion_swigregister(Motion)

class Motor(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Motor, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Motor, name)
    __repr__ = _swig_repr
    ROTATIONAL = _controller.Motor_ROTATIONAL
    LINEAR = _controller.Motor_LINEAR

    def __init__(self, name):
        this = _controller.new_Motor(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Motor
    __del__ = lambda self: None

    def setPosition(self, position):
        return _controller.Motor_setPosition(self, position)

    def setVelocity(self, vel):
        return _controller.Motor_setVelocity(self, vel)

    def setAcceleration(self, acceleration):
        return _controller.Motor_setAcceleration(self, acceleration)

    def setAvailableForce(self, availableForce):
        return _controller.Motor_setAvailableForce(self, availableForce)

    def setAvailableTorque(self, availableTorque):
        return _controller.Motor_setAvailableTorque(self, availableTorque)

    def setControlPID(self, p, i, d):
        return _controller.Motor_setControlPID(self, p, i, d)

    def getTargetPosition(self):
        return _controller.Motor_getTargetPosition(self)

    def getMinPosition(self):
        return _controller.Motor_getMinPosition(self)

    def getMaxPosition(self):
        return _controller.Motor_getMaxPosition(self)

    def getVelocity(self):
        return _controller.Motor_getVelocity(self)

    def getMaxVelocity(self):
        return _controller.Motor_getMaxVelocity(self)

    def getAcceleration(self):
        return _controller.Motor_getAcceleration(self)

    def getAvailableForce(self):
        return _controller.Motor_getAvailableForce(self)

    def getMaxForce(self):
        return _controller.Motor_getMaxForce(self)

    def getAvailableTorque(self):
        return _controller.Motor_getAvailableTorque(self)

    def getMaxTorque(self):
        return _controller.Motor_getMaxTorque(self)

    def enableForceFeedback(self, samplingPeriod):
        return _controller.Motor_enableForceFeedback(self, samplingPeriod)

    def disableForceFeedback(self):
        return _controller.Motor_disableForceFeedback(self)

    def getForceFeedbackSamplingPeriod(self):
        return _controller.Motor_getForceFeedbackSamplingPeriod(self)

    def getForceFeedback(self):
        return _controller.Motor_getForceFeedback(self)

    def enableTorqueFeedback(self, samplingPeriod):
        return _controller.Motor_enableTorqueFeedback(self, samplingPeriod)

    def disableTorqueFeedback(self):
        return _controller.Motor_disableTorqueFeedback(self)

    def getTorqueFeedbackSamplingPeriod(self):
        return _controller.Motor_getTorqueFeedbackSamplingPeriod(self)

    def getTorqueFeedback(self):
        return _controller.Motor_getTorqueFeedback(self)

    def setForce(self, force):
        return _controller.Motor_setForce(self, force)

    def setTorque(self, torque):
        return _controller.Motor_setTorque(self, torque)

    def getType(self):
        return _controller.Motor_getType(self)

    def getBrake(self):
        return _controller.Motor_getBrake(self)

    def getPositionSensor(self):
        return _controller.Motor_getPositionSensor(self)

    def getBrakeTag(self):
        return _controller.Motor_getBrakeTag(self)

    def getPositionSensorTag(self):
        return _controller.Motor_getPositionSensorTag(self)

    def getBrake(self):
        try:
            return self.__brake
        except AttributeError:
            self.__brake = Robot.internalGetDeviceFromTag(self.getBrakeTag())
            return self.__brake
    def getPositionSensor(self):
        try:
            return self.__positionSensor
        except AttributeError:
            self.__positionSensor = Robot.internalGetDeviceFromTag(self.getPositionSensorTag())
            return self.__positionSensor

Motor_swigregister = _controller.Motor_swigregister
Motor_swigregister(Motor)

class MouseState(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, MouseState, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, MouseState, name)
    __repr__ = _swig_repr
    __swig_setmethods__["left"] = _controller.MouseState_left_set
    __swig_getmethods__["left"] = _controller.MouseState_left_get
    if _newclass:
        left = _swig_property(_controller.MouseState_left_get, _controller.MouseState_left_set)
    __swig_setmethods__["middle"] = _controller.MouseState_middle_set
    __swig_getmethods__["middle"] = _controller.MouseState_middle_get
    if _newclass:
        middle = _swig_property(_controller.MouseState_middle_get, _controller.MouseState_middle_set)
    __swig_setmethods__["right"] = _controller.MouseState_right_set
    __swig_getmethods__["right"] = _controller.MouseState_right_get
    if _newclass:
        right = _swig_property(_controller.MouseState_right_get, _controller.MouseState_right_set)
    __swig_setmethods__["u"] = _controller.MouseState_u_set
    __swig_getmethods__["u"] = _controller.MouseState_u_get
    if _newclass:
        u = _swig_property(_controller.MouseState_u_get, _controller.MouseState_u_set)
    __swig_setmethods__["v"] = _controller.MouseState_v_set
    __swig_getmethods__["v"] = _controller.MouseState_v_get
    if _newclass:
        v = _swig_property(_controller.MouseState_v_get, _controller.MouseState_v_set)
    __swig_setmethods__["x"] = _controller.MouseState_x_set
    __swig_getmethods__["x"] = _controller.MouseState_x_get
    if _newclass:
        x = _swig_property(_controller.MouseState_x_get, _controller.MouseState_x_set)
    __swig_setmethods__["y"] = _controller.MouseState_y_set
    __swig_getmethods__["y"] = _controller.MouseState_y_get
    if _newclass:
        y = _swig_property(_controller.MouseState_y_get, _controller.MouseState_y_set)
    __swig_setmethods__["z"] = _controller.MouseState_z_set
    __swig_getmethods__["z"] = _controller.MouseState_z_get
    if _newclass:
        z = _swig_property(_controller.MouseState_z_get, _controller.MouseState_z_set)

    def __init__(self):
        this = _controller.new_MouseState()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_MouseState
    __del__ = lambda self: None
MouseState_swigregister = _controller.MouseState_swigregister
MouseState_swigregister(MouseState)

class Mouse(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Mouse, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Mouse, name)
    __repr__ = _swig_repr

    def __init__(self):
        this = _controller.new_Mouse()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Mouse
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.Mouse_enable(self, samplingPeriod)

    def disable(self):
        return _controller.Mouse_disable(self)

    def getSamplingPeriod(self):
        return _controller.Mouse_getSamplingPeriod(self)

    def enable3dPosition(self):
        return _controller.Mouse_enable3dPosition(self)

    def disable3dPosition(self):
        return _controller.Mouse_disable3dPosition(self)

    def is3dPositionEnabled(self):
        return _controller.Mouse_is3dPositionEnabled(self)

    def getState(self):
        return _controller.Mouse_getState(self)
Mouse_swigregister = _controller.Mouse_swigregister
Mouse_swigregister(Mouse)

class Node(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Node, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Node, name)

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    NO_NODE = _controller.Node_NO_NODE
    APPEARANCE = _controller.Node_APPEARANCE
    BACKGROUND = _controller.Node_BACKGROUND
    BOX = _controller.Node_BOX
    CAPSULE = _controller.Node_CAPSULE
    COLOR = _controller.Node_COLOR
    CONE = _controller.Node_CONE
    COORDINATE = _controller.Node_COORDINATE
    CYLINDER = _controller.Node_CYLINDER
    DIRECTIONAL_LIGHT = _controller.Node_DIRECTIONAL_LIGHT
    ELEVATION_GRID = _controller.Node_ELEVATION_GRID
    FOG = _controller.Node_FOG
    GROUP = _controller.Node_GROUP
    IMAGE_TEXTURE = _controller.Node_IMAGE_TEXTURE
    INDEXED_FACE_SET = _controller.Node_INDEXED_FACE_SET
    INDEXED_LINE_SET = _controller.Node_INDEXED_LINE_SET
    MATERIAL = _controller.Node_MATERIAL
    MESH = _controller.Node_MESH
    MUSCLE = _controller.Node_MUSCLE
    NORMAL = _controller.Node_NORMAL
    PBR_APPEARANCE = _controller.Node_PBR_APPEARANCE
    PLANE = _controller.Node_PLANE
    POINT_LIGHT = _controller.Node_POINT_LIGHT
    POINT_SET = _controller.Node_POINT_SET
    SHAPE = _controller.Node_SHAPE
    SPHERE = _controller.Node_SPHERE
    SPOT_LIGHT = _controller.Node_SPOT_LIGHT
    TEXTURE_COORDINATE = _controller.Node_TEXTURE_COORDINATE
    TEXTURE_TRANSFORM = _controller.Node_TEXTURE_TRANSFORM
    TRANSFORM = _controller.Node_TRANSFORM
    VIEWPOINT = _controller.Node_VIEWPOINT
    ROBOT = _controller.Node_ROBOT
    DIFFERENTIAL_WHEELS = _controller.Node_DIFFERENTIAL_WHEELS
    ACCELEROMETER = _controller.Node_ACCELEROMETER
    BRAKE = _controller.Node_BRAKE
    CAMERA = _controller.Node_CAMERA
    COMPASS = _controller.Node_COMPASS
    CONNECTOR = _controller.Node_CONNECTOR
    DISPLAY = _controller.Node_DISPLAY
    DISTANCE_SENSOR = _controller.Node_DISTANCE_SENSOR
    EMITTER = _controller.Node_EMITTER
    GPS = _controller.Node_GPS
    GYRO = _controller.Node_GYRO
    INERTIAL_UNIT = _controller.Node_INERTIAL_UNIT
    LED = _controller.Node_LED
    LIDAR = _controller.Node_LIDAR
    LIGHT_SENSOR = _controller.Node_LIGHT_SENSOR
    LINEAR_MOTOR = _controller.Node_LINEAR_MOTOR
    PEN = _controller.Node_PEN
    POSITION_SENSOR = _controller.Node_POSITION_SENSOR
    PROPELLER = _controller.Node_PROPELLER
    RADAR = _controller.Node_RADAR
    RANGE_FINDER = _controller.Node_RANGE_FINDER
    RECEIVER = _controller.Node_RECEIVER
    ROTATIONAL_MOTOR = _controller.Node_ROTATIONAL_MOTOR
    SPEAKER = _controller.Node_SPEAKER
    TOUCH_SENSOR = _controller.Node_TOUCH_SENSOR
    BALL_JOINT = _controller.Node_BALL_JOINT
    BALL_JOINT_PARAMETERS = _controller.Node_BALL_JOINT_PARAMETERS
    CHARGER = _controller.Node_CHARGER
    CONTACT_PROPERTIES = _controller.Node_CONTACT_PROPERTIES
    DAMPING = _controller.Node_DAMPING
    FLUID = _controller.Node_FLUID
    FOCUS = _controller.Node_FOCUS
    HINGE_JOINT = _controller.Node_HINGE_JOINT
    HINGE_JOINT_PARAMETERS = _controller.Node_HINGE_JOINT_PARAMETERS
    HINGE_2_JOINT = _controller.Node_HINGE_2_JOINT
    IMMERSION_PROPERTIES = _controller.Node_IMMERSION_PROPERTIES
    JOINT_PARAMETERS = _controller.Node_JOINT_PARAMETERS
    LENS = _controller.Node_LENS
    LENS_FLARE = _controller.Node_LENS_FLARE
    PHYSICS = _controller.Node_PHYSICS
    RECOGNITION = _controller.Node_RECOGNITION
    SLIDER_JOINT = _controller.Node_SLIDER_JOINT
    SLOT = _controller.Node_SLOT
    SOLID = _controller.Node_SOLID
    SOLID_REFERENCE = _controller.Node_SOLID_REFERENCE
    TRACK = _controller.Node_TRACK
    TRACK_WHEEL = _controller.Node_TRACK_WHEEL
    WORLD_INFO = _controller.Node_WORLD_INFO
    ZOOM = _controller.Node_ZOOM
    MICROPHONE = _controller.Node_MICROPHONE
    RADIO = _controller.Node_RADIO
    SKIN = _controller.Node_SKIN

    def remove(self):
        return _controller.Node_remove(self)

    def getId(self):
        return _controller.Node_getId(self)

    def getType(self):
        return _controller.Node_getType(self)

    def getDef(self):
        return _controller.Node_getDef(self)

    def getTypeName(self):
        return _controller.Node_getTypeName(self)

    def getBaseTypeName(self):
        return _controller.Node_getBaseTypeName(self)

    def getParentNode(self):
        return _controller.Node_getParentNode(self)

    def isProto(self):
        return _controller.Node_isProto(self)

    def getFromProtoDef(self, name):
        return _controller.Node_getFromProtoDef(self, name)

    def getField(self, fieldName):
        return _controller.Node_getField(self, fieldName)

    def getProtoField(self, fieldName):
        return _controller.Node_getProtoField(self, fieldName)

    def getPosition(self):
        return _controller.Node_getPosition(self)

    def getOrientation(self):
        return _controller.Node_getOrientation(self)

    def getCenterOfMass(self):
        return _controller.Node_getCenterOfMass(self)

    def getContactPoint(self, index):
        return _controller.Node_getContactPoint(self, index)

    def getContactPointNode(self, index):
        return _controller.Node_getContactPointNode(self, index)

    def getNumberOfContactPoints(self, includeDescendants=False):
        return _controller.Node_getNumberOfContactPoints(self, includeDescendants)

    def getStaticBalance(self):
        return _controller.Node_getStaticBalance(self)

    def getVelocity(self):
        return _controller.Node_getVelocity(self)

    def setVelocity(self, velocity):
        return _controller.Node_setVelocity(self, velocity)

    def resetPhysics(self):
        return _controller.Node_resetPhysics(self)

    def restartController(self):
        return _controller.Node_restartController(self)

    def moveViewpoint(self):
        return _controller.Node_moveViewpoint(self)

    def setVisibility(self, arg2, visible):
        return _controller.Node_setVisibility(self, arg2, visible)

    def addForce(self, force, relative):
        return _controller.Node_addForce(self, force, relative)

    def addForceWithOffset(self, force, offset, relative):
        return _controller.Node_addForceWithOffset(self, force, offset, relative)

    def addTorque(self, torque, relative):
        return _controller.Node_addTorque(self, torque, relative)

    def __eq__(self, other):
        if self is None and other is None:
            return True
        elif self is None or other is None:
            return False
        elif self.getId() == other.getId():
            return True
        return False

    def __ne__(self, other):
        return not self.__eq__(other)

Node_swigregister = _controller.Node_swigregister
Node_swigregister(Node)

class Pen(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Pen, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Pen, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Pen(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Pen
    __del__ = lambda self: None

    def write(self, write):
        return _controller.Pen_write(self, write)

    def setInkColor(self, color, density):
        return _controller.Pen_setInkColor(self, color, density)
Pen_swigregister = _controller.Pen_swigregister
Pen_swigregister(Pen)

class PositionSensor(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, PositionSensor, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, PositionSensor, name)
    __repr__ = _swig_repr
    ROTATIONAL = _controller.PositionSensor_ROTATIONAL
    LINEAR = _controller.PositionSensor_LINEAR

    def __init__(self, name):
        this = _controller.new_PositionSensor(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_PositionSensor
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.PositionSensor_enable(self, samplingPeriod)

    def disable(self):
        return _controller.PositionSensor_disable(self)

    def getSamplingPeriod(self):
        return _controller.PositionSensor_getSamplingPeriod(self)

    def getValue(self):
        return _controller.PositionSensor_getValue(self)

    def getType(self):
        return _controller.PositionSensor_getType(self)

    def getBrake(self):
        return _controller.PositionSensor_getBrake(self)

    def getMotor(self):
        return _controller.PositionSensor_getMotor(self)

    def getBrakeTag(self):
        return _controller.PositionSensor_getBrakeTag(self)

    def getMotorTag(self):
        return _controller.PositionSensor_getMotorTag(self)
    ANGULAR = _controller.PositionSensor_ANGULAR

    def getBrake(self):
        try:
            return self.__brake
        except AttributeError:
            self.__brake = Robot.internalGetDeviceFromTag(self.getBrakeTag())
            return self.__brake
    def getMotor(self):
        try:
            return self.__motor
        except AttributeError:
            self.__motor = Robot.internalGetDeviceFromTag(self.getMotorTag())
            return self.__motor

PositionSensor_swigregister = _controller.PositionSensor_swigregister
PositionSensor_swigregister(PositionSensor)

class RadarTarget(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, RadarTarget, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, RadarTarget, name)
    __repr__ = _swig_repr
    __swig_setmethods__["distance"] = _controller.RadarTarget_distance_set
    __swig_getmethods__["distance"] = _controller.RadarTarget_distance_get
    if _newclass:
        distance = _swig_property(_controller.RadarTarget_distance_get, _controller.RadarTarget_distance_set)
    __swig_setmethods__["received_power"] = _controller.RadarTarget_received_power_set
    __swig_getmethods__["received_power"] = _controller.RadarTarget_received_power_get
    if _newclass:
        received_power = _swig_property(_controller.RadarTarget_received_power_get, _controller.RadarTarget_received_power_set)
    __swig_setmethods__["speed"] = _controller.RadarTarget_speed_set
    __swig_getmethods__["speed"] = _controller.RadarTarget_speed_get
    if _newclass:
        speed = _swig_property(_controller.RadarTarget_speed_get, _controller.RadarTarget_speed_set)
    __swig_setmethods__["azimuth"] = _controller.RadarTarget_azimuth_set
    __swig_getmethods__["azimuth"] = _controller.RadarTarget_azimuth_get
    if _newclass:
        azimuth = _swig_property(_controller.RadarTarget_azimuth_get, _controller.RadarTarget_azimuth_set)

    def __init__(self):
        this = _controller.new_RadarTarget()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_RadarTarget
    __del__ = lambda self: None
RadarTarget_swigregister = _controller.RadarTarget_swigregister
RadarTarget_swigregister(RadarTarget)

class Radar(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Radar, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Radar, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Radar(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Radar
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.Radar_enable(self, samplingPeriod)

    def disable(self):
        return _controller.Radar_disable(self)

    def getSamplingPeriod(self):
        return _controller.Radar_getSamplingPeriod(self)

    def getNumberOfTargets(self):
        return _controller.Radar_getNumberOfTargets(self)

    def getTargets(self):
        return _controller.Radar_getTargets(self)

    def getMinRange(self):
        return _controller.Radar_getMinRange(self)

    def getMaxRange(self):
        return _controller.Radar_getMaxRange(self)

    def getHorizontalFov(self):
        return _controller.Radar_getHorizontalFov(self)

    def getVerticalFov(self):
        return _controller.Radar_getVerticalFov(self)

    def getTarget(self, index):
        return _controller.Radar_getTarget(self, index)

    def getTargets(self):
       ret = []
       for i in range(self.getNumberOfTargets()):
         ret.append(self.getTarget(i))
       return ret

Radar_swigregister = _controller.Radar_swigregister
Radar_swigregister(Radar)

class RangeFinder(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, RangeFinder, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, RangeFinder, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_RangeFinder(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_RangeFinder
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.RangeFinder_enable(self, samplingPeriod)

    def disable(self):
        return _controller.RangeFinder_disable(self)

    def getSamplingPeriod(self):
        return _controller.RangeFinder_getSamplingPeriod(self)

    def getRangeImage(self):
        return _controller.RangeFinder_getRangeImage(self)

    def getWidth(self):
        return _controller.RangeFinder_getWidth(self)

    def getHeight(self):
        return _controller.RangeFinder_getHeight(self)

    def getFov(self):
        return _controller.RangeFinder_getFov(self)

    def getMinRange(self):
        return _controller.RangeFinder_getMinRange(self)

    def getMaxRange(self):
        return _controller.RangeFinder_getMaxRange(self)

    def saveImage(self, filename, quality):
        return _controller.RangeFinder_saveImage(self, filename, quality)

    def getRangeImageArray(self):
        return _controller.RangeFinder_getRangeImageArray(self)
    if _newclass:
        rangeImageGetValue = staticmethod(_controller.RangeFinder_rangeImageGetValue)
    else:
        rangeImageGetValue = _controller.RangeFinder_rangeImageGetValue
    if _newclass:
        rangeImageGetDepth = staticmethod(_controller.RangeFinder_rangeImageGetDepth)
    else:
        rangeImageGetDepth = _controller.RangeFinder_rangeImageGetDepth
RangeFinder_swigregister = _controller.RangeFinder_swigregister
RangeFinder_swigregister(RangeFinder)

def RangeFinder_rangeImageGetValue(im, minRange, maxRange, width, x, y):
    return _controller.RangeFinder_rangeImageGetValue(im, minRange, maxRange, width, x, y)
RangeFinder_rangeImageGetValue = _controller.RangeFinder_rangeImageGetValue

def RangeFinder_rangeImageGetDepth(*args):
    return _controller.RangeFinder_rangeImageGetDepth(*args)
RangeFinder_rangeImageGetDepth = _controller.RangeFinder_rangeImageGetDepth

class Receiver(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Receiver, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Receiver, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Receiver(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Receiver
    __del__ = lambda self: None
    CHANNEL_BROADCAST = _controller.Receiver_CHANNEL_BROADCAST

    def enable(self, samplingPeriod):
        return _controller.Receiver_enable(self, samplingPeriod)

    def disable(self):
        return _controller.Receiver_disable(self)

    def getSamplingPeriod(self):
        return _controller.Receiver_getSamplingPeriod(self)

    def setChannel(self, channel):
        return _controller.Receiver_setChannel(self, channel)

    def getChannel(self):
        return _controller.Receiver_getChannel(self)

    def getQueueLength(self):
        return _controller.Receiver_getQueueLength(self)

    def nextPacket(self):
        return _controller.Receiver_nextPacket(self)

    def getDataSize(self):
        return _controller.Receiver_getDataSize(self)

    def getData(self):
        return _controller.Receiver_getData(self)

    def getSignalStrength(self):
        return _controller.Receiver_getSignalStrength(self)

    def getEmitterDirection(self):
        return _controller.Receiver_getEmitterDirection(self)
Receiver_swigregister = _controller.Receiver_swigregister
Receiver_swigregister(Receiver)

class Skin(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Skin, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Skin, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Skin(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Skin
    __del__ = lambda self: None

    def setBoneOrientation(self, index, orientation, absolute):
        return _controller.Skin_setBoneOrientation(self, index, orientation, absolute)

    def setBonePosition(self, index, position, absolute):
        return _controller.Skin_setBonePosition(self, index, position, absolute)

    def getBoneCount(self):
        return _controller.Skin_getBoneCount(self)

    def getBoneName(self, index):
        return _controller.Skin_getBoneName(self, index)

    def getBoneOrientation(self, index, absolute):
        return _controller.Skin_getBoneOrientation(self, index, absolute)

    def getBonePosition(self, index, absolute):
        return _controller.Skin_getBonePosition(self, index, absolute)
Skin_swigregister = _controller.Skin_swigregister
Skin_swigregister(Skin)

class Speaker(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Speaker, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Speaker, name)
    __repr__ = _swig_repr

    def __init__(self, name):
        this = _controller.new_Speaker(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Speaker
    __del__ = lambda self: None
    if _newclass:
        playSound = staticmethod(_controller.Speaker_playSound)
    else:
        playSound = _controller.Speaker_playSound

    def isSoundPlaying(self, sound):
        return _controller.Speaker_isSoundPlaying(self, sound)

    def stop(self, sound):
        return _controller.Speaker_stop(self, sound)

    def setEngine(self, engine):
        return _controller.Speaker_setEngine(self, engine)

    def setLanguage(self, language):
        return _controller.Speaker_setLanguage(self, language)

    def getEngine(self):
        return _controller.Speaker_getEngine(self)

    def getLanguage(self):
        return _controller.Speaker_getLanguage(self)

    def speak(self, text, volume):
        return _controller.Speaker_speak(self, text, volume)

    def isSpeaking(self):
        return _controller.Speaker_isSpeaking(self)
Speaker_swigregister = _controller.Speaker_swigregister
Speaker_swigregister(Speaker)

def Speaker_playSound(left, right, sound, volume, pitch, balance, loop):
    return _controller.Speaker_playSound(left, right, sound, volume, pitch, balance, loop)
Speaker_playSound = _controller.Speaker_playSound

class TouchSensor(Device):
    __swig_setmethods__ = {}
    for _s in [Device]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, TouchSensor, name, value)
    __swig_getmethods__ = {}
    for _s in [Device]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, TouchSensor, name)
    __repr__ = _swig_repr
    BUMPER = _controller.TouchSensor_BUMPER
    FORCE = _controller.TouchSensor_FORCE
    FORCE3D = _controller.TouchSensor_FORCE3D

    def __init__(self, name):
        this = _controller.new_TouchSensor(name)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_TouchSensor
    __del__ = lambda self: None

    def enable(self, samplingPeriod):
        return _controller.TouchSensor_enable(self, samplingPeriod)

    def disable(self):
        return _controller.TouchSensor_disable(self)

    def getSamplingPeriod(self):
        return _controller.TouchSensor_getSamplingPeriod(self)

    def getValue(self):
        return _controller.TouchSensor_getValue(self)

    def getValues(self):
        return _controller.TouchSensor_getValues(self)

    def __internalGetLookupTableSize(self):
        return _controller.TouchSensor___internalGetLookupTableSize(self)

    def getLookupTable(self):
        return _controller.TouchSensor_getLookupTable(self)

    def getType(self):
        return _controller.TouchSensor_getType(self)
TouchSensor_swigregister = _controller.TouchSensor_swigregister
TouchSensor_swigregister(TouchSensor)

class Robot(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, Robot, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, Robot, name)
    __repr__ = _swig_repr
    MODE_SIMULATION = _controller.Robot_MODE_SIMULATION
    MODE_CROSS_COMPILATION = _controller.Robot_MODE_CROSS_COMPILATION
    MODE_REMOTE_CONTROL = _controller.Robot_MODE_REMOTE_CONTROL
    EVENT_QUIT = _controller.Robot_EVENT_QUIT
    EVENT_NO_EVENT = _controller.Robot_EVENT_NO_EVENT
    EVENT_MOUSE_CLICK = _controller.Robot_EVENT_MOUSE_CLICK
    EVENT_MOUSE_MOVE = _controller.Robot_EVENT_MOUSE_MOVE
    EVENT_KEYBOARD = _controller.Robot_EVENT_KEYBOARD
    EVENT_JOYSTICK_BUTTON = _controller.Robot_EVENT_JOYSTICK_BUTTON
    EVENT_JOYSTICK_AXIS = _controller.Robot_EVENT_JOYSTICK_AXIS
    EVENT_JOYSTICK_POV = _controller.Robot_EVENT_JOYSTICK_POV

    def __init__(self):
        this = _controller.new_Robot()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Robot
    __del__ = lambda self: None

    def step(self, duration):
        return _controller.Robot_step(self, duration)

    def waitForUserInputEvent(self, event_type, timeout):
        return _controller.Robot_waitForUserInputEvent(self, event_type, timeout)

    def getName(self):
        return _controller.Robot_getName(self)

    def getUrdf(self, *args):
        return _controller.Robot_getUrdf(self, *args)

    def getTime(self):
        return _controller.Robot_getTime(self)

    def getModel(self):
        return _controller.Robot_getModel(self)

    def getCustomData(self):
        return _controller.Robot_getCustomData(self)

    def setCustomData(self, data):
        return _controller.Robot_setCustomData(self, data)

    def getMode(self):
        return _controller.Robot_getMode(self)

    def setMode(self, arg2, arg3):
        return _controller.Robot_setMode(self, arg2, arg3)

    def getSupervisor(self):
        return _controller.Robot_getSupervisor(self)

    def getSynchronization(self):
        return _controller.Robot_getSynchronization(self)

    def getProjectPath(self):
        return _controller.Robot_getProjectPath(self)

    def getWorldPath(self):
        return _controller.Robot_getWorldPath(self)

    def getBasicTimeStep(self):
        return _controller.Robot_getBasicTimeStep(self)

    def getNumberOfDevices(self):
        return _controller.Robot_getNumberOfDevices(self)

    def __internalGetDeviceByIndex(self, index):
        return _controller.Robot___internalGetDeviceByIndex(self, index)

    def __internalGetDevice(self, name):
        return _controller.Robot___internalGetDevice(self, name)

    def getType(self):
        return _controller.Robot_getType(self)

    def batterySensorEnable(self, samplingPeriod):
        return _controller.Robot_batterySensorEnable(self, samplingPeriod)

    def batterySensorDisable(self):
        return _controller.Robot_batterySensorDisable(self)

    def batterySensorGetSamplingPeriod(self):
        return _controller.Robot_batterySensorGetSamplingPeriod(self)

    def batterySensorGetValue(self):
        return _controller.Robot_batterySensorGetValue(self)

    def wwiSendText(self, text):
        return _controller.Robot_wwiSendText(self, text)

    def wwiReceiveText(self):
        return _controller.Robot_wwiReceiveText(self)

    def getData(self):
        return _controller.Robot_getData(self)

    def setData(self, data):
        return _controller.Robot_setData(self, data)
    if _newclass:
        getDeviceFromTag = staticmethod(_controller.Robot_getDeviceFromTag)
    else:
        getDeviceFromTag = _controller.Robot_getDeviceFromTag
    if _newclass:
        __internalGetDeviceTypeFromTag = staticmethod(_controller.Robot___internalGetDeviceTypeFromTag)
    else:
        __internalGetDeviceTypeFromTag = _controller.Robot___internalGetDeviceTypeFromTag
    if _newclass:
        __internalGetDeviceNameFromTag = staticmethod(_controller.Robot___internalGetDeviceNameFromTag)
    else:
        __internalGetDeviceNameFromTag = _controller.Robot___internalGetDeviceNameFromTag
    if _newclass:
        __internalGetDeviceTagFromIndex = staticmethod(_controller.Robot___internalGetDeviceTagFromIndex)
    else:
        __internalGetDeviceTagFromIndex = _controller.Robot___internalGetDeviceTagFromIndex
    if _newclass:
        __internalGetDeviceTagFromName = staticmethod(_controller.Robot___internalGetDeviceTagFromName)
    else:
        __internalGetDeviceTagFromName = _controller.Robot___internalGetDeviceTagFromName

    __devices = []
    joystick = Joystick()
    keyboard = Keyboard()
    mouse = Mouse()
    import sys
    if sys.version_info[0] < 3:
      sys.stderr.write("DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of Webots will drop support for Python 2.7.\n")
    def createAccelerometer(self, name):
      return Accelerometer(name)
    def getAccelerometer(self, name):
      sys.stderr.write("DEPRECATION: Robot.getAccelerometer is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.ACCELEROMETER):
        return None
      return self.__getOrCreateDevice(tag)
    def createBrake(self, name):
      return Brake(name)
    def getBrake(self, name):
      sys.stderr.write("DEPRECATION: Robot.getBrake is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.BRAKE):
        return None
      return self.__getOrCreateDevice(tag)
    def createCamera(self, name):
      return Camera(name)
    def getCamera(self, name):
      sys.stderr.write("DEPRECATION: Robot.getCamera is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.CAMERA):
        return None
      return self.__getOrCreateDevice(tag)
    def createCompass(self, name):
      return Compass(name)
    def getCompass(self, name):
      sys.stderr.write("DEPRECATION: Robot.getCompass is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.COMPASS):
        return None
      return self.__getOrCreateDevice(tag)
    def createConnector(self, name):
      return Connector(name)
    def getConnector(self, name):
      sys.stderr.write("DEPRECATION: Robot.getConnector is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.CONNECTOR):
        return None
      return self.__getOrCreateDevice(tag)
    def createDisplay(self, name):
      return Display(name)
    def getDisplay(self, name):
      sys.stderr.write("DEPRECATION: Robot.getDisplay is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.DISPLAY):
        return None
      return self.__getOrCreateDevice(tag)
    def createDistanceSensor(self, name):
      return DistanceSensor(name)
    def getDistanceSensor(self, name):
      sys.stderr.write("DEPRECATION: Robot.getDistanceSensor is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.DISTANCE_SENSOR):
        return None
      return self.__getOrCreateDevice(tag)
    def createEmitter(self, name):
      return Emitter(name)
    def getEmitter(self, name):
      sys.stderr.write("DEPRECATION: Robot.getEmitter is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.EMITTER):
        return None
      return self.__getOrCreateDevice(tag)
    def createGPS(self, name):
      return GPS(name)
    def getGPS(self, name):
      sys.stderr.write("DEPRECATION: Robot.getGPS is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.GPS):
        return None
      return self.__getOrCreateDevice(tag)
    def createGyro(self, name):
      return Gyro(name)
    def getGyro(self, name):
      sys.stderr.write("DEPRECATION: Robot.getGyro is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.GYRO):
        return None
      return self.__getOrCreateDevice(tag)
    def createInertialUnit(self, name):
      return InertialUnit(name)
    def getInertialUnit(self, name):
      sys.stderr.write("DEPRECATION: Robot.getInertialUnit is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.INERTIAL_UNIT):
        return None
      return self.__getOrCreateDevice(tag)
    def getJoystick(self):
      return self.joystick
    def getKeyboard(self):
      return self.keyboard
    def createLED(self, name):
      return LED(name)
    def getLED(self, name):
      sys.stderr.write("DEPRECATION: Robot.getLED is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.LED):
        return None
      return self.__getOrCreateDevice(tag)
    def createLidar(self, name):
      return Lidar(name)
    def getLidar(self, name):
      sys.stderr.write("DEPRECATION: Robot.getLidar is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.LIDAR):
        return None
      return self.__getOrCreateDevice(tag)
    def createLightSensor(self, name):
      return LightSensor(name)
    def getLightSensor(self, name):
      sys.stderr.write("DEPRECATION: Robot.getLightSensor is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.LIGHT_SENSOR):
        return None
      return self.__getOrCreateDevice(tag)
    def createMotor(self, name):
      return Motor(name)
    def getMotor(self, name):
      sys.stderr.write("DEPRECATION: Robot.getMotor is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.LINEAR_MOTOR) and not Device.hasType(tag, Node.ROTATIONAL_MOTOR):
        return None
      return self.__getOrCreateDevice(tag)
    def getMouse(self):
      return self.mouse
    def createPen(self, name):
      return Pen(name)
    def getPen(self, name):
      sys.stderr.write("DEPRECATION: Robot.getPen is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.PEN):
        return None
      return self.__getOrCreateDevice(tag)
    def createPositionSensor(self, name):
      return PositionSensor(name)
    def getPositionSensor(self, name):
      sys.stderr.write("DEPRECATION: Robot.getPositionSensor is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.POSITION_SENSOR):
        return None
      return self.__getOrCreateDevice(tag)
    def createRadar(self, name):
      return Radar(name)
    def getRadar(self, name):
      sys.stderr.write("DEPRECATION: Robot.getRadar is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.RADAR):
        return None
      return self.__getOrCreateDevice(tag)
    def createRangeFinder(self, name):
      return RangeFinder(name)
    def getRangeFinder(self, name):
      sys.stderr.write("DEPRECATION: Robot.getRangeFinder is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.RANGE_FINDER):
        return None
      return self.__getOrCreateDevice(tag)
    def createReceiver(self, name):
      return Receiver(name)
    def getReceiver(self, name):
      sys.stderr.write("DEPRECATION: Robot.getReceiver is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.RECEIVER):
        return None
      return self.__getOrCreateDevice(tag)
    def createSkin(self, name):
      return Skin(name)
    def getSkin(self, name):
      sys.stderr.write("DEPRECATION: Robot.getSkin is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.SKIN):
        return None
      return self.__getOrCreateDevice(tag)
    def createSpeaker(self, name):
      return Speaker(name)
    def getSpeaker(self, name):
      sys.stderr.write("DEPRECATION: Robot.getSpeaker is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.SPEAKER):
        return None
      return self.__getOrCreateDevice(tag)
    def createTouchSensor(self, name):
      return TouchSensor(name)
    def getTouchSensor(self, name):
      sys.stderr.write("DEPRECATION: Robot.getTouchSensor is deprecated, please use Robot.getDevice instead.\n")
      tag = self.__internalGetDeviceTagFromName(name)
      if not Device.hasType(tag, Node.TOUCH_SENSOR):
        return None
      return self.__getOrCreateDevice(tag)
    def getDeviceByIndex(self, index):
      tag = self.__internalGetDeviceTagFromIndex(index)
      return self.__getOrCreateDevice(tag)
    def getDevice(self, name):
      tag = self.__internalGetDeviceTagFromName(name)
      return self.__getOrCreateDevice(tag)
    @staticmethod
    def internalGetDeviceFromTag(tag):
      if tag == 0:
          return None
      size = len(Robot.__devices)
      if size == 0 or tag >= size:
          return None
      return Robot.__devices[tag]
    def __getOrCreateDevice(self, tag):
      if tag == 0:
          return None
      count = self.getNumberOfDevices()
      size = len(Robot.__devices)
    # if new devices have been added, then count is greater than size
    # deleted devices are not removed from the C API list and don't affect the number of devices
      if count == size and size > 0 and tag < size:
          return Robot.__devices[tag]

    # (re-)initialize Robot.__devices list
      if tag > count:
          return None
      Robot.__devices = [None] * (count + 1)
      for i in range(0, count):
          otherTag = self.__internalGetDeviceTagFromIndex(i)
          name = self.__internalGetDeviceNameFromTag(otherTag)
          nodeType = self.__internalGetDeviceTypeFromTag(otherTag)
          if nodeType == Node.ACCELEROMETER:
              Robot.__devices[otherTag] = self.createAccelerometer(name)
          elif nodeType == Node.BRAKE:
              Robot.__devices[otherTag] = self.createBrake(name)
          elif nodeType == Node.CAMERA:
              Robot.__devices[otherTag] = self.createCamera(name)
          elif nodeType == Node.COMPASS:
              Robot.__devices[otherTag] = self.createCompass(name)
          elif nodeType == Node.CONNECTOR:
              Robot.__devices[otherTag] = self.createConnector(name)
          elif nodeType == Node.DISPLAY:
              Robot.__devices[otherTag] = self.createDisplay(name)
          elif nodeType == Node.DISTANCE_SENSOR:
              Robot.__devices[otherTag] = self.createDistanceSensor(name)
          elif nodeType == Node.EMITTER:
              Robot.__devices[otherTag] = self.createEmitter(name)
          elif nodeType == Node.GPS:
              Robot.__devices[otherTag] = self.createGPS(name)
          elif nodeType == Node.GYRO:
              Robot.__devices[otherTag] = self.createGyro(name)
          elif nodeType == Node.INERTIAL_UNIT:
              Robot.__devices[otherTag] = self.createInertialUnit(name)
          elif nodeType == Node.LED:
              Robot.__devices[otherTag] = self.createLED(name)
          elif nodeType == Node.LIDAR:
              Robot.__devices[otherTag] = self.createLidar(name)
          elif nodeType == Node.LIGHT_SENSOR:
              Robot.__devices[otherTag] = self.createLightSensor(name)
          elif nodeType == Node.LINEAR_MOTOR or nodeType == Node.ROTATIONAL_MOTOR:
              Robot.__devices[otherTag] = self.createMotor(name)
          elif nodeType == Node.PEN:
              Robot.__devices[otherTag] = self.createPen(name)
          elif nodeType == Node.POSITION_SENSOR:
              Robot.__devices[otherTag] = self.createPositionSensor(name)
          elif nodeType == Node.RADAR:
              Robot.__devices[otherTag] = self.createRadar(name)
          elif nodeType == Node.RANGE_FINDER:
              Robot.__devices[otherTag] = self.createRangeFinder(name)
          elif nodeType == Node.RECEIVER:
              Robot.__devices[otherTag] = self.createReceiver(name)
          elif nodeType == Node.SPEAKER:
              Robot.__devices[otherTag] = self.createSpeaker(name)
          elif nodeType == Node.TOUCH_SENSOR:
              Robot.__devices[otherTag] = self.createTouchSensor(name)
      return Robot.__devices[tag]

Robot_swigregister = _controller.Robot_swigregister
Robot_swigregister(Robot)

def Robot_getDeviceFromTag(tag):
    return _controller.Robot_getDeviceFromTag(tag)
Robot_getDeviceFromTag = _controller.Robot_getDeviceFromTag

def Robot___internalGetDeviceTypeFromTag(tag):
    return _controller.Robot___internalGetDeviceTypeFromTag(tag)
Robot___internalGetDeviceTypeFromTag = _controller.Robot___internalGetDeviceTypeFromTag

def Robot___internalGetDeviceNameFromTag(tag):
    return _controller.Robot___internalGetDeviceNameFromTag(tag)
Robot___internalGetDeviceNameFromTag = _controller.Robot___internalGetDeviceNameFromTag

def Robot___internalGetDeviceTagFromIndex(index):
    return _controller.Robot___internalGetDeviceTagFromIndex(index)
Robot___internalGetDeviceTagFromIndex = _controller.Robot___internalGetDeviceTagFromIndex

def Robot___internalGetDeviceTagFromName(name):
    return _controller.Robot___internalGetDeviceTagFromName(name)
Robot___internalGetDeviceTagFromName = _controller.Robot___internalGetDeviceTagFromName

class DifferentialWheels(Robot):
    __swig_setmethods__ = {}
    for _s in [Robot]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, DifferentialWheels, name, value)
    __swig_getmethods__ = {}
    for _s in [Robot]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, DifferentialWheels, name)
    __repr__ = _swig_repr

    def __init__(self):
        this = _controller.new_DifferentialWheels()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_DifferentialWheels
    __del__ = lambda self: None

    def setSpeed(self, left, right):
        return _controller.DifferentialWheels_setSpeed(self, left, right)

    def getLeftSpeed(self):
        return _controller.DifferentialWheels_getLeftSpeed(self)

    def getRightSpeed(self):
        return _controller.DifferentialWheels_getRightSpeed(self)

    def getMaxSpeed(self):
        return _controller.DifferentialWheels_getMaxSpeed(self)

    def getSpeedUnit(self):
        return _controller.DifferentialWheels_getSpeedUnit(self)

    def enableEncoders(self, samplingPeriod):
        return _controller.DifferentialWheels_enableEncoders(self, samplingPeriod)

    def disableEncoders(self):
        return _controller.DifferentialWheels_disableEncoders(self)

    def getEncodersSamplingPeriod(self):
        return _controller.DifferentialWheels_getEncodersSamplingPeriod(self)

    def getLeftEncoder(self):
        return _controller.DifferentialWheels_getLeftEncoder(self)

    def getRightEncoder(self):
        return _controller.DifferentialWheels_getRightEncoder(self)

    def setEncoders(self, left, right):
        return _controller.DifferentialWheels_setEncoders(self, left, right)
DifferentialWheels_swigregister = _controller.DifferentialWheels_swigregister
DifferentialWheels_swigregister(DifferentialWheels)

class Supervisor(Robot):
    __swig_setmethods__ = {}
    for _s in [Robot]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, Supervisor, name, value)
    __swig_getmethods__ = {}
    for _s in [Robot]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, Supervisor, name)
    __repr__ = _swig_repr
    SIMULATION_MODE_PAUSE = _controller.Supervisor_SIMULATION_MODE_PAUSE
    SIMULATION_MODE_REAL_TIME = _controller.Supervisor_SIMULATION_MODE_REAL_TIME
    SIMULATION_MODE_FAST = _controller.Supervisor_SIMULATION_MODE_FAST

    def __init__(self):
        this = _controller.new_Supervisor()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _controller.delete_Supervisor
    __del__ = lambda self: None

    def simulationQuit(self, status):
        return _controller.Supervisor_simulationQuit(self, status)

    def simulationReset(self):
        return _controller.Supervisor_simulationReset(self)

    def simulationResetPhysics(self):
        return _controller.Supervisor_simulationResetPhysics(self)

    def simulationGetMode(self):
        return _controller.Supervisor_simulationGetMode(self)

    def simulationSetMode(self, mode):
        return _controller.Supervisor_simulationSetMode(self, mode)

    def worldLoad(self, file):
        return _controller.Supervisor_worldLoad(self, file)

    def worldReload(self):
        return _controller.Supervisor_worldReload(self)

    def worldSave(self, *args):
        return _controller.Supervisor_worldSave(self, *args)

    def exportImage(self, file, quality):
        return _controller.Supervisor_exportImage(self, file, quality)

    def animationStartRecording(self, file):
        return _controller.Supervisor_animationStartRecording(self, file)

    def animationStopRecording(self):
        return _controller.Supervisor_animationStopRecording(self)

    def movieStartRecording(self, file, width, height, codec, quality, acceleration, caption):
        return _controller.Supervisor_movieStartRecording(self, file, width, height, codec, quality, acceleration, caption)

    def movieStopRecording(self):
        return _controller.Supervisor_movieStopRecording(self)

    def movieIsReady(self):
        return _controller.Supervisor_movieIsReady(self)

    def movieFailed(self):
        return _controller.Supervisor_movieFailed(self)

    def setLabel(self, *args):
        return _controller.Supervisor_setLabel(self, *args)

    def getRoot(self):
        return _controller.Supervisor_getRoot(self)

    def getSelf(self):
        return _controller.Supervisor_getSelf(self)

    def getFromDef(self, name):
        return _controller.Supervisor_getFromDef(self, name)

    def getFromId(self, id):
        return _controller.Supervisor_getFromId(self, id)

    def getFromDevice(self, device):
        return _controller.Supervisor_getFromDevice(self, device)

    def __internalGetFromDeviceTag(self, tag):
        return _controller.Supervisor___internalGetFromDeviceTag(self, tag)

    def getSelected(self):
        return _controller.Supervisor_getSelected(self)

    def virtualRealityHeadsetIsUsed(self):
        return _controller.Supervisor_virtualRealityHeadsetIsUsed(self)

    def virtualRealityHeadsetGetPosition(self):
        return _controller.Supervisor_virtualRealityHeadsetGetPosition(self)

    def virtualRealityHeadsetGetOrientation(self):
        return _controller.Supervisor_virtualRealityHeadsetGetOrientation(self)

    def simulationRevert(self):
        return _controller.Supervisor_simulationRevert(self)

    def loadWorld(self, file):
        return _controller.Supervisor_loadWorld(self, file)

    def saveWorld(self, *args):
        return _controller.Supervisor_saveWorld(self, *args)

    def simulationPhysicsReset(self):
        return _controller.Supervisor_simulationPhysicsReset(self)

    def startMovie(self, file, width, height, codec, quality, acceleration, caption):
        return _controller.Supervisor_startMovie(self, file, width, height, codec, quality, acceleration, caption)

    def stopMovie(self):
        return _controller.Supervisor_stopMovie(self)

    def getMovieStatus(self):
        return _controller.Supervisor_getMovieStatus(self)
    MOVIE_READY = _controller.Supervisor_MOVIE_READY
    MOVIE_RECORDING = _controller.Supervisor_MOVIE_RECORDING
    MOVIE_SAVING = _controller.Supervisor_MOVIE_SAVING
    MOVIE_WRITE_ERROR = _controller.Supervisor_MOVIE_WRITE_ERROR
    MOVIE_ENCODING_ERROR = _controller.Supervisor_MOVIE_ENCODING_ERROR
    MOVIE_SIMULATION_ERROR = _controller.Supervisor_MOVIE_SIMULATION_ERROR

    def movieGetStatus(self):
        return _controller.Supervisor_movieGetStatus(self)
Supervisor_swigregister = _controller.Supervisor_swigregister
Supervisor_swigregister(Supervisor)

# This file is compatible with both classic and new-style classes.


