diff --git a/docs/LCD_2inch/LCD_2inch.html b/docs/LCD_2inch/LCD_2inch.html new file mode 100644 index 0000000..20a2d17 --- /dev/null +++ b/docs/LCD_2inch/LCD_2inch.html @@ -0,0 +1,954 @@ + + + + + + + LCD_2inch API documentation + + + + + + + + + +
+
+

+LCD_2inch

+ + + + + + +
  1import time
+  2import xgoscreen.lcdconfig as lcdconfig
+  3
+  4class LCD_2inch(lcdconfig.RaspberryPi):
+  5    """
+  6    This class provides a high-level interface for controlling a 2-inch LCD display using the Raspberry Pi. 
+  7    It inherits from the `lcdconfig.RaspberryPi` class to manage low-level hardware interactions.
+  8
+  9    Attributes:
+ 10        width (int): The width of the LCD display in pixels (240).
+ 11        height (int): The height of the LCD display in pixels (320).
+ 12    """
+ 13
+ 14    width = 240
+ 15    height = 320
+ 16
+ 17    def command(self, cmd):
+ 18        """
+ 19        Sends a command to the LCD controller.
+ 20
+ 21        Parameters:
+ 22            cmd (int): The command byte to send.
+ 23        """
+ 24        self.digital_write(self.DC_PIN, self.GPIO.LOW)
+ 25        self.spi_writebyte([cmd])
+ 26
+ 27    def data(self, val):
+ 28        """
+ 29        Sends a data byte to the LCD controller.
+ 30
+ 31        Parameters:
+ 32            val (int): The data byte to send.
+ 33        """
+ 34        self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+ 35        self.spi_writebyte([val])
+ 36
+ 37    def reset(self):
+ 38        """
+ 39        Resets the LCD display.
+ 40        """
+ 41        self.GPIO.output(self.RST_PIN, self.GPIO.HIGH)
+ 42        time.sleep(0.01)
+ 43        self.GPIO.output(self.RST_PIN, self.GPIO.LOW)
+ 44        time.sleep(0.01)
+ 45        self.GPIO.output(self.RST_PIN, self.GPIO.HIGH)
+ 46        time.sleep(0.01)
+ 47
+ 48    def Init(self):
+ 49        """
+ 50        Initializes the LCD display.
+ 51
+ 52        This method performs the following steps:
+ 53        1. Initializes the Raspberry Pi module using `module_init()`.
+ 54        2. Resets the LCD display using `reset()`.
+ 55        3. Sends a sequence of commands and data bytes to configure the display controller.
+ 56        """
+ 57        self.module_init()
+ 58        self.reset()
+ 59
+ 60        self.command(0x36)
+ 61        self.data(0x00)
+ 62
+ 63        self.command(0x3A)
+ 64        self.data(0x05)
+ 65
+ 66        self.command(0x21)
+ 67
+ 68        self.command(0x2A)
+ 69        self.data(0x00)
+ 70        self.data(0x00)
+ 71        self.data(0x01)
+ 72        self.data(0x3F)
+ 73
+ 74        self.command(0x2B)
+ 75        self.data(0x00)
+ 76        self.data(0x00)
+ 77        self.data(0x00)
+ 78        self.data(0xEF)
+ 79
+ 80        self.command(0xB2)
+ 81        self.data(0x0C)
+ 82        self.data(0x0C)
+ 83        self.data(0x00)
+ 84        self.data(0x33)
+ 85        self.data(0x33)
+ 86
+ 87        self.command(0xB7)
+ 88        self.data(0x35)
+ 89
+ 90        self.command(0xBB)
+ 91        self.data(0x1F)
+ 92
+ 93        self.command(0xC0)
+ 94        self.data(0x2C)
+ 95
+ 96        self.command(0xC2)
+ 97        self.data(0x01)
+ 98
+ 99        self.command(0xC3)
+100        self.data(0x12)
+101
+102        self.command(0xC4)
+103        self.data(0x20)
+104
+105        self.command(0xC6)
+106        self.data(0x0F)
+107
+108        self.command(0xD0)
+109        self.data(0xA4)
+110        self.data(0xA1)
+111
+112        self.command(0xE0)
+113        self.data(0xD0)
+114        self.data(0x08)
+115        self.data(0x11)
+116        self.data(0x08)
+117        self.data(0x0C)
+118        self.data(0x15)
+119        self.data(0x39)
+120        self.data(0x33)
+121        self.data(0x50)
+122        self.data(0x36)
+123        self.data(0x13)
+124        self.data(0x14)
+125        self.data(0x29)
+126        self.data(0x2D)
+127
+128        self.command(0xE1)
+129        self.data(0xD0)
+130        self.data(0x08)
+131        self.data(0x10)
+132        self.data(0x08)
+133        self.data(0x06)
+134        self.data(0x06)
+135        self.data(0x39)
+136        self.data(0x44)
+137        self.data(0x51)
+138        self.data(0x0B)
+139        self.data(0x16)
+140        self.data(0x14)
+141        self.data(0x2F)
+142        self.data(0x31)
+143        self.command(0x21)
+144
+145        self.command(0x11)
+146
+147        self.command(0x29)
+148
+149    def SetWindows(self, Xstart, Ystart, Xend, Yend):
+150        """
+151        Sets the active window area on the LCD display.
+152
+153        Parameters:
+154            Xstart (int): The starting X-coordinate of the window.
+155            Ystart (int): The starting Y-coordinate of the window.
+156            Xend (int): The ending X-coordinate of the window.
+157            Yend (int): The ending Y-coordinate of the window.
+158        """
+159        # set the X coordinates
+160        self.command(0x2A)
+161        self.data(Xstart >> 8)  # Set the horizontal starting point to the high octet
+162        self.data(Xstart & 0xff)  # Set the horizontal starting point to the low octet
+163        self.data(Xend >> 8)  # Set the horizontal end to the high octet
+164        self.data((Xend - 1) & 0xff)  # Set the horizontal end to the low octet
+165
+166        # set the Y coordinates
+167        self.command(0x2B)
+168        self.data(Ystart >> 8)
+169        self.data((Ystart & 0xff))
+170        self.data(Yend >> 8)
+171        self.data((Yend - 1) & 0xff)
+172
+173        self.command(0x2C)
+174
+175    def ShowImage(self, Image, Xstart=0, Ystart=0):
+176        """
+177        Displays a PIL (Pillow) Image on the LCD.
+178
+179        Parameters:
+180            Image (PIL.Image.Image): The image to display.
+181            Xstart (int, optional): The starting X-coordinate for displaying the image. Defaults to 0.
+182            Ystart (int, optional): The starting Y-coordinate for displaying the image. Defaults to 0.
+183        """
+184        """Set buffer to value of Python Imaging Library image."""
+185        """Write display buffer to physical display"""
+186        imwidth, imheight = Image.size
+187        if imwidth == self.height and imheight == self.width:
+188            img = self.np.asarray(Image)
+189            pix = self.np.zeros((self.width, self.height, 2), dtype=self.np.uint8)
+190            # RGB888 >> RGB565
+191            pix[..., [0]] = self.np.add(self.np.bitwise_and(img[..., [0]], 0xF8), self.np.right_shift(img[..., [1]], 5))
+192            pix[..., [1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[..., [1]], 3), 0xE0),
+193                                        self.np.right_shift(img[..., [2]], 3))
+194            pix = pix.flatten().tolist()
+195
+196            self.command(0x36)
+197            self.data(0x70)
+198            self.SetWindows(0, 0, self.height, self.width)
+199            self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+200            for i in range(0, len(pix), 4096):
+201                self.spi_writebyte(pix[i:i + 4096])
+202
+203        else:
+204            img = self.np.asarray(Image)
+205            pix = self.np.zeros((imheight, imwidth, 2), dtype=self.np.uint8)
+206
+207            pix[..., [0]] = self.np.add(self.np.bitwise_and(img[..., [0]], 0xF8), self.np.right_shift(img[..., [1]], 5))
+208            pix[..., [1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[..., [1]], 3), 0xE0),
+209                                        self.np.right_shift(img[..., [2]], 3))
+210
+211            pix = pix.flatten().tolist()
+212
+213            self.command(0x36)
+214            self.data(0x00)
+215            self.SetWindows(0, 0, self.width, self.height)
+216            self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+217            for i in range(0, len(pix), 4096):
+218                self.spi_writebyte(pix[i:i + 4096])
+219
+220    def clear(self):
+221        """
+222        Clears the LCD display by filling it with white color (0xff).
+223        """
+224        """Clear contents of image buffer"""
+225        _buffer = [0xff] * (self.width * self.height * 2)
+226        self.SetWindows(0, 0, self.height, self.width)
+227        self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+228        for i in range(0, len(_buffer), 4096):
+229            self.spi_writebyte(_buffer[i:i + 4096])
+
+ + +
+
+ +
+ + class + LCD_2inch(xgoscreen.lcdconfig.RaspberryPi): + + + +
+ +
  5class LCD_2inch(lcdconfig.RaspberryPi):
+  6    """
+  7    This class provides a high-level interface for controlling a 2-inch LCD display using the Raspberry Pi. 
+  8    It inherits from the `lcdconfig.RaspberryPi` class to manage low-level hardware interactions.
+  9
+ 10    Attributes:
+ 11        width (int): The width of the LCD display in pixels (240).
+ 12        height (int): The height of the LCD display in pixels (320).
+ 13    """
+ 14
+ 15    width = 240
+ 16    height = 320
+ 17
+ 18    def command(self, cmd):
+ 19        """
+ 20        Sends a command to the LCD controller.
+ 21
+ 22        Parameters:
+ 23            cmd (int): The command byte to send.
+ 24        """
+ 25        self.digital_write(self.DC_PIN, self.GPIO.LOW)
+ 26        self.spi_writebyte([cmd])
+ 27
+ 28    def data(self, val):
+ 29        """
+ 30        Sends a data byte to the LCD controller.
+ 31
+ 32        Parameters:
+ 33            val (int): The data byte to send.
+ 34        """
+ 35        self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+ 36        self.spi_writebyte([val])
+ 37
+ 38    def reset(self):
+ 39        """
+ 40        Resets the LCD display.
+ 41        """
+ 42        self.GPIO.output(self.RST_PIN, self.GPIO.HIGH)
+ 43        time.sleep(0.01)
+ 44        self.GPIO.output(self.RST_PIN, self.GPIO.LOW)
+ 45        time.sleep(0.01)
+ 46        self.GPIO.output(self.RST_PIN, self.GPIO.HIGH)
+ 47        time.sleep(0.01)
+ 48
+ 49    def Init(self):
+ 50        """
+ 51        Initializes the LCD display.
+ 52
+ 53        This method performs the following steps:
+ 54        1. Initializes the Raspberry Pi module using `module_init()`.
+ 55        2. Resets the LCD display using `reset()`.
+ 56        3. Sends a sequence of commands and data bytes to configure the display controller.
+ 57        """
+ 58        self.module_init()
+ 59        self.reset()
+ 60
+ 61        self.command(0x36)
+ 62        self.data(0x00)
+ 63
+ 64        self.command(0x3A)
+ 65        self.data(0x05)
+ 66
+ 67        self.command(0x21)
+ 68
+ 69        self.command(0x2A)
+ 70        self.data(0x00)
+ 71        self.data(0x00)
+ 72        self.data(0x01)
+ 73        self.data(0x3F)
+ 74
+ 75        self.command(0x2B)
+ 76        self.data(0x00)
+ 77        self.data(0x00)
+ 78        self.data(0x00)
+ 79        self.data(0xEF)
+ 80
+ 81        self.command(0xB2)
+ 82        self.data(0x0C)
+ 83        self.data(0x0C)
+ 84        self.data(0x00)
+ 85        self.data(0x33)
+ 86        self.data(0x33)
+ 87
+ 88        self.command(0xB7)
+ 89        self.data(0x35)
+ 90
+ 91        self.command(0xBB)
+ 92        self.data(0x1F)
+ 93
+ 94        self.command(0xC0)
+ 95        self.data(0x2C)
+ 96
+ 97        self.command(0xC2)
+ 98        self.data(0x01)
+ 99
+100        self.command(0xC3)
+101        self.data(0x12)
+102
+103        self.command(0xC4)
+104        self.data(0x20)
+105
+106        self.command(0xC6)
+107        self.data(0x0F)
+108
+109        self.command(0xD0)
+110        self.data(0xA4)
+111        self.data(0xA1)
+112
+113        self.command(0xE0)
+114        self.data(0xD0)
+115        self.data(0x08)
+116        self.data(0x11)
+117        self.data(0x08)
+118        self.data(0x0C)
+119        self.data(0x15)
+120        self.data(0x39)
+121        self.data(0x33)
+122        self.data(0x50)
+123        self.data(0x36)
+124        self.data(0x13)
+125        self.data(0x14)
+126        self.data(0x29)
+127        self.data(0x2D)
+128
+129        self.command(0xE1)
+130        self.data(0xD0)
+131        self.data(0x08)
+132        self.data(0x10)
+133        self.data(0x08)
+134        self.data(0x06)
+135        self.data(0x06)
+136        self.data(0x39)
+137        self.data(0x44)
+138        self.data(0x51)
+139        self.data(0x0B)
+140        self.data(0x16)
+141        self.data(0x14)
+142        self.data(0x2F)
+143        self.data(0x31)
+144        self.command(0x21)
+145
+146        self.command(0x11)
+147
+148        self.command(0x29)
+149
+150    def SetWindows(self, Xstart, Ystart, Xend, Yend):
+151        """
+152        Sets the active window area on the LCD display.
+153
+154        Parameters:
+155            Xstart (int): The starting X-coordinate of the window.
+156            Ystart (int): The starting Y-coordinate of the window.
+157            Xend (int): The ending X-coordinate of the window.
+158            Yend (int): The ending Y-coordinate of the window.
+159        """
+160        # set the X coordinates
+161        self.command(0x2A)
+162        self.data(Xstart >> 8)  # Set the horizontal starting point to the high octet
+163        self.data(Xstart & 0xff)  # Set the horizontal starting point to the low octet
+164        self.data(Xend >> 8)  # Set the horizontal end to the high octet
+165        self.data((Xend - 1) & 0xff)  # Set the horizontal end to the low octet
+166
+167        # set the Y coordinates
+168        self.command(0x2B)
+169        self.data(Ystart >> 8)
+170        self.data((Ystart & 0xff))
+171        self.data(Yend >> 8)
+172        self.data((Yend - 1) & 0xff)
+173
+174        self.command(0x2C)
+175
+176    def ShowImage(self, Image, Xstart=0, Ystart=0):
+177        """
+178        Displays a PIL (Pillow) Image on the LCD.
+179
+180        Parameters:
+181            Image (PIL.Image.Image): The image to display.
+182            Xstart (int, optional): The starting X-coordinate for displaying the image. Defaults to 0.
+183            Ystart (int, optional): The starting Y-coordinate for displaying the image. Defaults to 0.
+184        """
+185        """Set buffer to value of Python Imaging Library image."""
+186        """Write display buffer to physical display"""
+187        imwidth, imheight = Image.size
+188        if imwidth == self.height and imheight == self.width:
+189            img = self.np.asarray(Image)
+190            pix = self.np.zeros((self.width, self.height, 2), dtype=self.np.uint8)
+191            # RGB888 >> RGB565
+192            pix[..., [0]] = self.np.add(self.np.bitwise_and(img[..., [0]], 0xF8), self.np.right_shift(img[..., [1]], 5))
+193            pix[..., [1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[..., [1]], 3), 0xE0),
+194                                        self.np.right_shift(img[..., [2]], 3))
+195            pix = pix.flatten().tolist()
+196
+197            self.command(0x36)
+198            self.data(0x70)
+199            self.SetWindows(0, 0, self.height, self.width)
+200            self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+201            for i in range(0, len(pix), 4096):
+202                self.spi_writebyte(pix[i:i + 4096])
+203
+204        else:
+205            img = self.np.asarray(Image)
+206            pix = self.np.zeros((imheight, imwidth, 2), dtype=self.np.uint8)
+207
+208            pix[..., [0]] = self.np.add(self.np.bitwise_and(img[..., [0]], 0xF8), self.np.right_shift(img[..., [1]], 5))
+209            pix[..., [1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[..., [1]], 3), 0xE0),
+210                                        self.np.right_shift(img[..., [2]], 3))
+211
+212            pix = pix.flatten().tolist()
+213
+214            self.command(0x36)
+215            self.data(0x00)
+216            self.SetWindows(0, 0, self.width, self.height)
+217            self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+218            for i in range(0, len(pix), 4096):
+219                self.spi_writebyte(pix[i:i + 4096])
+220
+221    def clear(self):
+222        """
+223        Clears the LCD display by filling it with white color (0xff).
+224        """
+225        """Clear contents of image buffer"""
+226        _buffer = [0xff] * (self.width * self.height * 2)
+227        self.SetWindows(0, 0, self.height, self.width)
+228        self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+229        for i in range(0, len(_buffer), 4096):
+230            self.spi_writebyte(_buffer[i:i + 4096])
+
+ + +

This class provides a high-level interface for controlling a 2-inch LCD display using the Raspberry Pi. +It inherits from the lcdconfig.RaspberryPi class to manage low-level hardware interactions.

+ +

Attributes: + width (int): The width of the LCD display in pixels (240). + height (int): The height of the LCD display in pixels (320).

+
+ + +
+
+ width = +240 + + +
+ + + + +
+
+
+ height = +320 + + +
+ + + + +
+
+ +
+ + def + command(self, cmd): + + + +
+ +
18    def command(self, cmd):
+19        """
+20        Sends a command to the LCD controller.
+21
+22        Parameters:
+23            cmd (int): The command byte to send.
+24        """
+25        self.digital_write(self.DC_PIN, self.GPIO.LOW)
+26        self.spi_writebyte([cmd])
+
+ + +

Sends a command to the LCD controller.

+ +

Parameters: + cmd (int): The command byte to send.

+
+ + +
+
+ +
+ + def + data(self, val): + + + +
+ +
28    def data(self, val):
+29        """
+30        Sends a data byte to the LCD controller.
+31
+32        Parameters:
+33            val (int): The data byte to send.
+34        """
+35        self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+36        self.spi_writebyte([val])
+
+ + +

Sends a data byte to the LCD controller.

+ +

Parameters: + val (int): The data byte to send.

+
+ + +
+
+ +
+ + def + reset(self): + + + +
+ +
38    def reset(self):
+39        """
+40        Resets the LCD display.
+41        """
+42        self.GPIO.output(self.RST_PIN, self.GPIO.HIGH)
+43        time.sleep(0.01)
+44        self.GPIO.output(self.RST_PIN, self.GPIO.LOW)
+45        time.sleep(0.01)
+46        self.GPIO.output(self.RST_PIN, self.GPIO.HIGH)
+47        time.sleep(0.01)
+
+ + +

Resets the LCD display.

+
+ + +
+
+ +
+ + def + Init(self): + + + +
+ +
 49    def Init(self):
+ 50        """
+ 51        Initializes the LCD display.
+ 52
+ 53        This method performs the following steps:
+ 54        1. Initializes the Raspberry Pi module using `module_init()`.
+ 55        2. Resets the LCD display using `reset()`.
+ 56        3. Sends a sequence of commands and data bytes to configure the display controller.
+ 57        """
+ 58        self.module_init()
+ 59        self.reset()
+ 60
+ 61        self.command(0x36)
+ 62        self.data(0x00)
+ 63
+ 64        self.command(0x3A)
+ 65        self.data(0x05)
+ 66
+ 67        self.command(0x21)
+ 68
+ 69        self.command(0x2A)
+ 70        self.data(0x00)
+ 71        self.data(0x00)
+ 72        self.data(0x01)
+ 73        self.data(0x3F)
+ 74
+ 75        self.command(0x2B)
+ 76        self.data(0x00)
+ 77        self.data(0x00)
+ 78        self.data(0x00)
+ 79        self.data(0xEF)
+ 80
+ 81        self.command(0xB2)
+ 82        self.data(0x0C)
+ 83        self.data(0x0C)
+ 84        self.data(0x00)
+ 85        self.data(0x33)
+ 86        self.data(0x33)
+ 87
+ 88        self.command(0xB7)
+ 89        self.data(0x35)
+ 90
+ 91        self.command(0xBB)
+ 92        self.data(0x1F)
+ 93
+ 94        self.command(0xC0)
+ 95        self.data(0x2C)
+ 96
+ 97        self.command(0xC2)
+ 98        self.data(0x01)
+ 99
+100        self.command(0xC3)
+101        self.data(0x12)
+102
+103        self.command(0xC4)
+104        self.data(0x20)
+105
+106        self.command(0xC6)
+107        self.data(0x0F)
+108
+109        self.command(0xD0)
+110        self.data(0xA4)
+111        self.data(0xA1)
+112
+113        self.command(0xE0)
+114        self.data(0xD0)
+115        self.data(0x08)
+116        self.data(0x11)
+117        self.data(0x08)
+118        self.data(0x0C)
+119        self.data(0x15)
+120        self.data(0x39)
+121        self.data(0x33)
+122        self.data(0x50)
+123        self.data(0x36)
+124        self.data(0x13)
+125        self.data(0x14)
+126        self.data(0x29)
+127        self.data(0x2D)
+128
+129        self.command(0xE1)
+130        self.data(0xD0)
+131        self.data(0x08)
+132        self.data(0x10)
+133        self.data(0x08)
+134        self.data(0x06)
+135        self.data(0x06)
+136        self.data(0x39)
+137        self.data(0x44)
+138        self.data(0x51)
+139        self.data(0x0B)
+140        self.data(0x16)
+141        self.data(0x14)
+142        self.data(0x2F)
+143        self.data(0x31)
+144        self.command(0x21)
+145
+146        self.command(0x11)
+147
+148        self.command(0x29)
+
+ + +

Initializes the LCD display.

+ +

This method performs the following steps:

+ +
    +
  1. Initializes the Raspberry Pi module using module_init().
  2. +
  3. Resets the LCD display using reset().
  4. +
  5. Sends a sequence of commands and data bytes to configure the display controller.
  6. +
+
+ + +
+
+ +
+ + def + SetWindows(self, Xstart, Ystart, Xend, Yend): + + + +
+ +
150    def SetWindows(self, Xstart, Ystart, Xend, Yend):
+151        """
+152        Sets the active window area on the LCD display.
+153
+154        Parameters:
+155            Xstart (int): The starting X-coordinate of the window.
+156            Ystart (int): The starting Y-coordinate of the window.
+157            Xend (int): The ending X-coordinate of the window.
+158            Yend (int): The ending Y-coordinate of the window.
+159        """
+160        # set the X coordinates
+161        self.command(0x2A)
+162        self.data(Xstart >> 8)  # Set the horizontal starting point to the high octet
+163        self.data(Xstart & 0xff)  # Set the horizontal starting point to the low octet
+164        self.data(Xend >> 8)  # Set the horizontal end to the high octet
+165        self.data((Xend - 1) & 0xff)  # Set the horizontal end to the low octet
+166
+167        # set the Y coordinates
+168        self.command(0x2B)
+169        self.data(Ystart >> 8)
+170        self.data((Ystart & 0xff))
+171        self.data(Yend >> 8)
+172        self.data((Yend - 1) & 0xff)
+173
+174        self.command(0x2C)
+
+ + +

Sets the active window area on the LCD display.

+ +

Parameters: + Xstart (int): The starting X-coordinate of the window. + Ystart (int): The starting Y-coordinate of the window. + Xend (int): The ending X-coordinate of the window. + Yend (int): The ending Y-coordinate of the window.

+
+ + +
+
+ +
+ + def + ShowImage(self, Image, Xstart=0, Ystart=0): + + + +
+ +
176    def ShowImage(self, Image, Xstart=0, Ystart=0):
+177        """
+178        Displays a PIL (Pillow) Image on the LCD.
+179
+180        Parameters:
+181            Image (PIL.Image.Image): The image to display.
+182            Xstart (int, optional): The starting X-coordinate for displaying the image. Defaults to 0.
+183            Ystart (int, optional): The starting Y-coordinate for displaying the image. Defaults to 0.
+184        """
+185        """Set buffer to value of Python Imaging Library image."""
+186        """Write display buffer to physical display"""
+187        imwidth, imheight = Image.size
+188        if imwidth == self.height and imheight == self.width:
+189            img = self.np.asarray(Image)
+190            pix = self.np.zeros((self.width, self.height, 2), dtype=self.np.uint8)
+191            # RGB888 >> RGB565
+192            pix[..., [0]] = self.np.add(self.np.bitwise_and(img[..., [0]], 0xF8), self.np.right_shift(img[..., [1]], 5))
+193            pix[..., [1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[..., [1]], 3), 0xE0),
+194                                        self.np.right_shift(img[..., [2]], 3))
+195            pix = pix.flatten().tolist()
+196
+197            self.command(0x36)
+198            self.data(0x70)
+199            self.SetWindows(0, 0, self.height, self.width)
+200            self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+201            for i in range(0, len(pix), 4096):
+202                self.spi_writebyte(pix[i:i + 4096])
+203
+204        else:
+205            img = self.np.asarray(Image)
+206            pix = self.np.zeros((imheight, imwidth, 2), dtype=self.np.uint8)
+207
+208            pix[..., [0]] = self.np.add(self.np.bitwise_and(img[..., [0]], 0xF8), self.np.right_shift(img[..., [1]], 5))
+209            pix[..., [1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[..., [1]], 3), 0xE0),
+210                                        self.np.right_shift(img[..., [2]], 3))
+211
+212            pix = pix.flatten().tolist()
+213
+214            self.command(0x36)
+215            self.data(0x00)
+216            self.SetWindows(0, 0, self.width, self.height)
+217            self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+218            for i in range(0, len(pix), 4096):
+219                self.spi_writebyte(pix[i:i + 4096])
+
+ + +

Displays a PIL (Pillow) Image on the LCD.

+ +

Parameters: + Image (PIL.Image.Image): The image to display. + Xstart (int, optional): The starting X-coordinate for displaying the image. Defaults to 0. + Ystart (int, optional): The starting Y-coordinate for displaying the image. Defaults to 0.

+
+ + +
+
+ +
+ + def + clear(self): + + + +
+ +
221    def clear(self):
+222        """
+223        Clears the LCD display by filling it with white color (0xff).
+224        """
+225        """Clear contents of image buffer"""
+226        _buffer = [0xff] * (self.width * self.height * 2)
+227        self.SetWindows(0, 0, self.height, self.width)
+228        self.digital_write(self.DC_PIN, self.GPIO.HIGH)
+229        for i in range(0, len(_buffer), 4096):
+230            self.spi_writebyte(_buffer[i:i + 4096])
+
+ + +

Clears the LCD display by filling it with white color (0xff).

+
+ + +
+
+
+ + \ No newline at end of file diff --git a/docs/LCD_2inch/index.html b/docs/LCD_2inch/index.html new file mode 100644 index 0000000..af3f065 --- /dev/null +++ b/docs/LCD_2inch/index.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/LCD_2inch/search.js b/docs/LCD_2inch/search.js new file mode 100644 index 0000000..eb68a9f --- /dev/null +++ b/docs/LCD_2inch/search.js @@ -0,0 +1,46 @@ +window.pdocSearch = (function(){ +/** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o

\n"}, "LCD_2inch.LCD_2inch": {"fullname": "LCD_2inch.LCD_2inch", "modulename": "LCD_2inch", "qualname": "LCD_2inch", "kind": "class", "doc": "

This class provides a high-level interface for controlling a 2-inch LCD display using the Raspberry Pi. \nIt inherits from the lcdconfig.RaspberryPi class to manage low-level hardware interactions.

\n\n

Attributes:\n width (int): The width of the LCD display in pixels (240).\n height (int): The height of the LCD display in pixels (320).

\n", "bases": "xgoscreen.lcdconfig.RaspberryPi"}, "LCD_2inch.LCD_2inch.width": {"fullname": "LCD_2inch.LCD_2inch.width", "modulename": "LCD_2inch", "qualname": "LCD_2inch.width", "kind": "variable", "doc": "

\n", "default_value": "240"}, "LCD_2inch.LCD_2inch.height": {"fullname": "LCD_2inch.LCD_2inch.height", "modulename": "LCD_2inch", "qualname": "LCD_2inch.height", "kind": "variable", "doc": "

\n", "default_value": "320"}, "LCD_2inch.LCD_2inch.command": {"fullname": "LCD_2inch.LCD_2inch.command", "modulename": "LCD_2inch", "qualname": "LCD_2inch.command", "kind": "function", "doc": "

Sends a command to the LCD controller.

\n\n

Parameters:\n cmd (int): The command byte to send.

\n", "signature": "(self, cmd):", "funcdef": "def"}, "LCD_2inch.LCD_2inch.data": {"fullname": "LCD_2inch.LCD_2inch.data", "modulename": "LCD_2inch", "qualname": "LCD_2inch.data", "kind": "function", "doc": "

Sends a data byte to the LCD controller.

\n\n

Parameters:\n val (int): The data byte to send.

\n", "signature": "(self, val):", "funcdef": "def"}, "LCD_2inch.LCD_2inch.reset": {"fullname": "LCD_2inch.LCD_2inch.reset", "modulename": "LCD_2inch", "qualname": "LCD_2inch.reset", "kind": "function", "doc": "

Resets the LCD display.

\n", "signature": "(self):", "funcdef": "def"}, "LCD_2inch.LCD_2inch.Init": {"fullname": "LCD_2inch.LCD_2inch.Init", "modulename": "LCD_2inch", "qualname": "LCD_2inch.Init", "kind": "function", "doc": "

Initializes the LCD display.

\n\n

This method performs the following steps:

\n\n
    \n
  1. Initializes the Raspberry Pi module using module_init().
  2. \n
  3. Resets the LCD display using reset().
  4. \n
  5. Sends a sequence of commands and data bytes to configure the display controller.
  6. \n
\n", "signature": "(self):", "funcdef": "def"}, "LCD_2inch.LCD_2inch.SetWindows": {"fullname": "LCD_2inch.LCD_2inch.SetWindows", "modulename": "LCD_2inch", "qualname": "LCD_2inch.SetWindows", "kind": "function", "doc": "

Sets the active window area on the LCD display.

\n\n

Parameters:\n Xstart (int): The starting X-coordinate of the window.\n Ystart (int): The starting Y-coordinate of the window.\n Xend (int): The ending X-coordinate of the window.\n Yend (int): The ending Y-coordinate of the window.

\n", "signature": "(self, Xstart, Ystart, Xend, Yend):", "funcdef": "def"}, "LCD_2inch.LCD_2inch.ShowImage": {"fullname": "LCD_2inch.LCD_2inch.ShowImage", "modulename": "LCD_2inch", "qualname": "LCD_2inch.ShowImage", "kind": "function", "doc": "

Displays a PIL (Pillow) Image on the LCD.

\n\n

Parameters:\n Image (PIL.Image.Image): The image to display.\n Xstart (int, optional): The starting X-coordinate for displaying the image. Defaults to 0.\n Ystart (int, optional): The starting Y-coordinate for displaying the image. Defaults to 0.

\n", "signature": "(self, Image, Xstart=0, Ystart=0):", "funcdef": "def"}, "LCD_2inch.LCD_2inch.clear": {"fullname": "LCD_2inch.LCD_2inch.clear", "modulename": "LCD_2inch", "qualname": "LCD_2inch.clear", "kind": "function", "doc": "

Clears the LCD display by filling it with white color (0xff).

\n", "signature": "(self):", "funcdef": "def"}}, "docInfo": {"LCD_2inch": {"qualname": 0, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "LCD_2inch.LCD_2inch": {"qualname": 2, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 3, "doc": 64}, "LCD_2inch.LCD_2inch.width": {"qualname": 3, "fullname": 5, "annotation": 0, "default_value": 1, "signature": 0, "bases": 0, "doc": 3}, "LCD_2inch.LCD_2inch.height": {"qualname": 3, "fullname": 5, "annotation": 0, "default_value": 1, "signature": 0, "bases": 0, "doc": 3}, "LCD_2inch.LCD_2inch.command": {"qualname": 3, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 22}, "LCD_2inch.LCD_2inch.data": {"qualname": 3, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 23}, "LCD_2inch.LCD_2inch.reset": {"qualname": 3, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 7}, "LCD_2inch.LCD_2inch.Init": {"qualname": 3, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 61}, "LCD_2inch.LCD_2inch.SetWindows": {"qualname": 3, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 31, "bases": 0, "doc": 56}, "LCD_2inch.LCD_2inch.ShowImage": {"qualname": 3, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 36, "bases": 0, "doc": 54}, "LCD_2inch.LCD_2inch.clear": {"qualname": 3, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 14}}, "length": 11, "save": true}, "index": {"qualname": {"root": {"2": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch.width": {"tf": 1}, "LCD_2inch.LCD_2inch.height": {"tf": 1}, "LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}, "LCD_2inch.LCD_2inch.reset": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}, "LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 10}}}}}, "docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch.width": {"tf": 1}, "LCD_2inch.LCD_2inch.height": {"tf": 1}, "LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}, "LCD_2inch.LCD_2inch.reset": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}, "LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 10}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"LCD_2inch.LCD_2inch.width": {"tf": 1}}, "df": 1}}}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.height": {"tf": 1}}, "df": 1}}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}}, "df": 1}}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 1}}}}}, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"LCD_2inch.LCD_2inch.data": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.reset": {"tf": 1}}, "df": 1}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}}, "df": 1}}}}}}}}}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 1}}}}}}}}}}}, "fullname": {"root": {"2": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.width": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.height": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.command": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.data": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.reset": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.Init": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.clear": {"tf": 1.4142135623730951}}, "df": 11}}}}}, "docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.width": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.height": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.command": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.data": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.reset": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.Init": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.clear": {"tf": 1.4142135623730951}}, "df": 11}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"LCD_2inch.LCD_2inch.width": {"tf": 1}}, "df": 1}}}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.height": {"tf": 1}}, "df": 1}}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}}, "df": 1}}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 1}}}}}, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"LCD_2inch.LCD_2inch.data": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.reset": {"tf": 1}}, "df": 1}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}}, "df": 1}}}}}}}}}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 1}}}}}}}}}}}, "annotation": {"root": {"docs": {}, "df": 0}}, "default_value": {"root": {"2": {"4": {"0": {"docs": {"LCD_2inch.LCD_2inch.width": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "3": {"2": {"0": {"docs": {"LCD_2inch.LCD_2inch.height": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}}, "signature": {"root": {"0": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 1}, "docs": {"LCD_2inch.LCD_2inch.command": {"tf": 3.7416573867739413}, "LCD_2inch.LCD_2inch.data": {"tf": 3.7416573867739413}, "LCD_2inch.LCD_2inch.reset": {"tf": 3.1622776601683795}, "LCD_2inch.LCD_2inch.Init": {"tf": 3.1622776601683795}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 5.0990195135927845}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 5.477225575051661}, "LCD_2inch.LCD_2inch.clear": {"tf": 3.1622776601683795}}, "df": 7, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "f": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}, "LCD_2inch.LCD_2inch.reset": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}, "LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 7}}}}, "c": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}}, "df": 1}}}, "v": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"LCD_2inch.LCD_2inch.data": {"tf": 1}}, "df": 1}}}, "x": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 2}}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}}, "df": 1}}}}, "y": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 2}}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 1}}}}}}}, "bases": {"root": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}}}}, "l": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}}}}}}}}, "doc": {"root": {"0": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 1, "x": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "f": {"docs": {"LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 1}}}}, "2": {"4": {"0": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}, "3": {"2": {"0": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {"LCD_2inch": {"tf": 1.7320508075688772}, "LCD_2inch.LCD_2inch": {"tf": 3.1622776601683795}, "LCD_2inch.LCD_2inch.width": {"tf": 1.7320508075688772}, "LCD_2inch.LCD_2inch.height": {"tf": 1.7320508075688772}, "LCD_2inch.LCD_2inch.command": {"tf": 2.6457513110645907}, "LCD_2inch.LCD_2inch.data": {"tf": 2.6457513110645907}, "LCD_2inch.LCD_2inch.reset": {"tf": 1.7320508075688772}, "LCD_2inch.LCD_2inch.Init": {"tf": 4.898979485566356}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 3.1622776601683795}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 3}, "LCD_2inch.LCD_2inch.clear": {"tf": 1.7320508075688772}}, "df": 11, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 2}}, "e": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 2.449489742783178}, "LCD_2inch.LCD_2inch.command": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.data": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.reset": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 2.23606797749979}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 3.1622776601683795}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 2.449489742783178}, "LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 8}}, "o": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch.command": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.data": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.7320508075688772}}, "df": 5}}, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 1}}}}}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 3}}}}}}}, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}}}}}, "m": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1.4142135623730951}}, "df": 1, "s": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 2}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 2}}}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 1}}}}, "m": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}}, "df": 1}}}, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}}, "i": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 2, "x": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}}, "df": 1}}}}, "l": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 1, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 4}}}}}}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}}}}}}, "a": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 5, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}}}}, "n": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}}, "df": 1}}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}}, "df": 1}}}}, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}}, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}}, "df": 1}}}}, "c": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.7320508075688772}, "LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}, "LCD_2inch.LCD_2inch.reset": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}, "LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 8, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}}}, "o": {"docs": {}, "df": 0, "w": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}}, "df": 1, "t": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 2}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 5, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}}}}}, "c": {"docs": {}, "df": 0, "h": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}, "t": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 2}, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 2.6457513110645907}}, "df": 1}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 2}, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}}}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 1}}}}}}}, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.7320508075688772}, "LCD_2inch.LCD_2inch.reset": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1.7320508075688772}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}, "LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 6, "s": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 1}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"LCD_2inch.LCD_2inch.data": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 2}}}, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1.4142135623730951}}, "df": 2}}}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 2, "p": {"docs": {}, "df": 0, "i": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1, "s": {"docs": {"LCD_2inch.LCD_2inch.reset": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 2}}}}}}, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}}}, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}}, "df": 1}}}, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 2.23606797749979}}, "df": 1}}}}, "t": {"docs": {}, "df": 0, "h": {"docs": {"LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 1}}}, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 1}}}}}, "o": {"docs": {}, "df": 0, "f": {"docs": {"LCD_2inch.LCD_2inch": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}, "LCD_2inch.LCD_2inch.SetWindows": {"tf": 2}}, "df": 3}, "n": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 2}, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}}, "df": 2, "s": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1}, "LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 3}}}, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}}, "df": 1}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "s": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1.4142135623730951}}, "df": 2}}}}}}}}, "b": {"docs": {}, "df": 0, "y": {"docs": {"LCD_2inch.LCD_2inch.clear": {"tf": 1}}, "df": 1, "t": {"docs": {}, "df": 0, "e": {"docs": {"LCD_2inch.LCD_2inch.command": {"tf": 1}, "LCD_2inch.LCD_2inch.data": {"tf": 1.4142135623730951}}, "df": 2, "s": {"docs": {"LCD_2inch.LCD_2inch.Init": {"tf": 1}}, "df": 1}}}}}, "v": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"LCD_2inch.LCD_2inch.data": {"tf": 1}}, "df": 1}}}, "x": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 2, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 2}}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}}, "df": 1}}}}, "y": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1.4142135623730951}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 2, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}, "LCD_2inch.LCD_2inch.ShowImage": {"tf": 1}}, "df": 2}}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"LCD_2inch.LCD_2inch.SetWindows": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}, "pipeline": ["trimmer"], "_isPrebuiltIndex": true}; + + // mirrored in build-search-index.js (part 1) + // Also split on html tags. this is a cheap heuristic, but good enough. + elasticlunr.tokenizer.setSeperator(/[\s\-.;&_'"=,()]+|<[^>]*>/); + + let searchIndex; + if (docs._isPrebuiltIndex) { + console.info("using precompiled search index"); + searchIndex = elasticlunr.Index.load(docs); + } else { + console.time("building search index"); + // mirrored in build-search-index.js (part 2) + searchIndex = elasticlunr(function () { + this.pipeline.remove(elasticlunr.stemmer); + this.pipeline.remove(elasticlunr.stopWordFilter); + this.addField("qualname"); + this.addField("fullname"); + this.addField("annotation"); + this.addField("default_value"); + this.addField("signature"); + this.addField("bases"); + this.addField("doc"); + this.setRef("fullname"); + }); + for (let doc of docs) { + searchIndex.addDoc(doc); + } + console.timeEnd("building search index"); + } + + return (term) => searchIndex.search(term, { + fields: { + qualname: {boost: 4}, + fullname: {boost: 2}, + annotation: {boost: 2}, + default_value: {boost: 2}, + signature: {boost: 2}, + bases: {boost: 2}, + doc: {boost: 1}, + }, + expand: true + }); +})(); \ No newline at end of file diff --git a/docs/lcdconfig/index.html b/docs/lcdconfig/index.html new file mode 100644 index 0000000..1df91f5 --- /dev/null +++ b/docs/lcdconfig/index.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/lcdconfig/lcdconfig.html b/docs/lcdconfig/lcdconfig.html new file mode 100644 index 0000000..da2ffbf --- /dev/null +++ b/docs/lcdconfig/lcdconfig.html @@ -0,0 +1,837 @@ + + + + + + + lcdconfig API documentation + + + + + + + + + +
+
+

+lcdconfig

+ + + + + + +
  1import os
+  2import sys
+  3import time
+  4import spidev
+  5import logging
+  6import numpy as np
+  7
+  8class RaspberryPi:
+  9    """
+ 10    This class provides an interface for controlling hardware peripherals on a Raspberry Pi, specifically SPI, GPIO, and PWM, for use with devices like LCD displays.
+ 11
+ 12    Attributes:
+ 13        RST_PIN (int): GPIO pin number for the reset signal.
+ 14        DC_PIN (int): GPIO pin number for the data/command signal.
+ 15        BL_PIN (int): GPIO pin number for the backlight control signal.
+ 16        SPEED (int): SPI communication frequency.
+ 17        BL_freq (int): PWM frequency for backlight control.
+ 18        GPIO (RPi.GPIO): The RPi.GPIO module for GPIO control.
+ 19        SPI (spidev.SpiDev or None): The spidev.SpiDev object for SPI communication, or None if not used.
+ 20        _pwm (RPi.GPIO.PWM): The PWM object for backlight control.
+ 21    """
+ 22    def __init__(self, spi=spidev.SpiDev(0, 0), spi_freq=40000000, rst=27, dc=25, bl=0, bl_freq=1000, i2c=None, i2c_freq=100000):
+ 23        """
+ 24        Initializes the RaspberryPi object and configures GPIO, SPI, and PWM.
+ 25
+ 26        Parameters:
+ 27            spi (spidev.SpiDev, optional): The SPI device object. Defaults to spidev.SpiDev(0, 0). Set to None to disable SPI.
+ 28            spi_freq (int, optional): The SPI communication frequency in Hz. Defaults to 40000000.
+ 29            rst (int, optional): The GPIO pin number for the reset signal. Defaults to 27.
+ 30            dc (int, optional): The GPIO pin number for the data/command signal. Defaults to 25.
+ 31            bl (int, optional): The GPIO pin number for the backlight control signal. Defaults to 0.
+ 32            bl_freq (int, optional): The PWM frequency for backlight control in Hz. Defaults to 1000.
+ 33            i2c (None, optional): Placeholder for I2C configuration (not implemented in this version). Defaults to None.
+ 34            i2c_freq (int, optional): Placeholder for I2C frequency (not implemented in this version). Defaults to 100000.
+ 35        """
+ 36        import RPi.GPIO
+ 37        self.np = np
+ 38        self.RST_PIN = rst
+ 39        self.DC_PIN = dc
+ 40        self.BL_PIN = bl
+ 41        self.SPEED = spi_freq
+ 42        self.BL_freq = bl_freq
+ 43        self.GPIO = RPi.GPIO
+ 44        # self.GPIO.cleanup()
+ 45        self.GPIO.setmode(self.GPIO.BCM)
+ 46        self.GPIO.setwarnings(False)
+ 47        self.GPIO.setup(self.RST_PIN, self.GPIO.OUT)
+ 48        self.GPIO.setup(self.DC_PIN, self.GPIO.OUT)
+ 49        self.GPIO.setup(self.BL_PIN, self.GPIO.OUT)
+ 50        self.GPIO.output(self.BL_PIN, self.GPIO.HIGH)
+ 51        # Initialize SPI
+ 52        self.SPI = spi
+ 53        if self.SPI != None:
+ 54            self.SPI.max_speed_hz = spi_freq
+ 55            self.SPI.mode = 0b00
+ 56
+ 57    def digital_write(self, pin, value):
+ 58        """
+ 59        Writes a digital value to a specified GPIO pin.
+ 60
+ 61        Parameters:
+ 62            pin (int): The GPIO pin number.
+ 63            value (int): The value to write (HIGH or LOW, 1 or 0).
+ 64        """
+ 65        self.GPIO.output(pin, value)
+ 66
+ 67    def digital_read(self, pin):
+ 68        """
+ 69        Reads the digital value from a specified GPIO pin.
+ 70
+ 71        Parameters:
+ 72            pin (int): The GPIO pin number.
+ 73
+ 74        Returns:
+ 75            int: The digital value read from the pin (HIGH or LOW, 1 or 0).
+ 76        """
+ 77        return self.GPIO.input(pin)
+ 78
+ 79    def delay_ms(self, delaytime):
+ 80        """
+ 81        Pauses the program execution for a specified number of milliseconds.
+ 82
+ 83        Parameters:
+ 84            delaytime (int): The delay time in milliseconds.
+ 85        """
+ 86        time.sleep(delaytime / 1000.0)
+ 87
+ 88    def spi_writebyte(self, data):
+ 89        """
+ 90        Writes a list of bytes to the SPI bus.
+ 91
+ 92        Parameters:
+ 93            data (list): A list of bytes (integers) to be transmitted.
+ 94        """
+ 95        if self.SPI != None:
+ 96            self.SPI.writebytes(data)
+ 97
+ 98    def bl_DutyCycle(self, duty):
+ 99        """
+100        Sets the duty cycle of the PWM signal for backlight control.
+101
+102        Parameters:
+103            duty (int): The duty cycle percentage (0-100).
+104        """
+105        self._pwm.ChangeDutyCycle(duty)
+106
+107    def bl_Frequency(self, freq):
+108        """
+109        Sets the frequency of the PWM signal for backlight control.
+110
+111        Parameters:
+112            freq (int): The PWM frequency in Hz.
+113        """
+114        self._pwm.ChangeFrequency(freq)
+115
+116    def module_init(self):
+117        """
+118        Initializes the module by setting up GPIO pins and starting PWM for backlight control.
+119
+120        Returns:
+121            int: 0 if initialization is successful.
+122        """
+123        self.GPIO.setup(self.RST_PIN, self.GPIO.OUT)
+124        self.GPIO.setup(self.DC_PIN, self.GPIO.OUT)
+125        self.GPIO.setup(self.BL_PIN, self.GPIO.OUT)
+126        self._pwm = self.GPIO.PWM(self.BL_PIN, self.BL_freq)
+127        self._pwm.start(100)
+128        if self.SPI != None:
+129            self.SPI.max_speed_hz = self.SPEED
+130            self.SPI.mode = 0b00
+131        return 0
+132
+133    def module_exit(self):
+134        """
+135        Cleans up the module by closing the SPI connection, stopping PWM, and resetting GPIO pins.
+136        """
+137        logging.debug("spi end")
+138        if self.SPI != None:
+139            self.SPI.close()
+140
+141        logging.debug("gpio cleanup...")
+142        self.GPIO.output(self.RST_PIN, 1)
+143        self.GPIO.output(self.DC_PIN, 0)
+144        self._pwm.stop()
+145        time.sleep(0.001)
+146        self.GPIO.output(self.BL_PIN, 1)
+147        # self.GPIO.cleanup()
+
+ + +
+
+ +
+ + class + RaspberryPi: + + + +
+ +
  9class RaspberryPi:
+ 10    """
+ 11    This class provides an interface for controlling hardware peripherals on a Raspberry Pi, specifically SPI, GPIO, and PWM, for use with devices like LCD displays.
+ 12
+ 13    Attributes:
+ 14        RST_PIN (int): GPIO pin number for the reset signal.
+ 15        DC_PIN (int): GPIO pin number for the data/command signal.
+ 16        BL_PIN (int): GPIO pin number for the backlight control signal.
+ 17        SPEED (int): SPI communication frequency.
+ 18        BL_freq (int): PWM frequency for backlight control.
+ 19        GPIO (RPi.GPIO): The RPi.GPIO module for GPIO control.
+ 20        SPI (spidev.SpiDev or None): The spidev.SpiDev object for SPI communication, or None if not used.
+ 21        _pwm (RPi.GPIO.PWM): The PWM object for backlight control.
+ 22    """
+ 23    def __init__(self, spi=spidev.SpiDev(0, 0), spi_freq=40000000, rst=27, dc=25, bl=0, bl_freq=1000, i2c=None, i2c_freq=100000):
+ 24        """
+ 25        Initializes the RaspberryPi object and configures GPIO, SPI, and PWM.
+ 26
+ 27        Parameters:
+ 28            spi (spidev.SpiDev, optional): The SPI device object. Defaults to spidev.SpiDev(0, 0). Set to None to disable SPI.
+ 29            spi_freq (int, optional): The SPI communication frequency in Hz. Defaults to 40000000.
+ 30            rst (int, optional): The GPIO pin number for the reset signal. Defaults to 27.
+ 31            dc (int, optional): The GPIO pin number for the data/command signal. Defaults to 25.
+ 32            bl (int, optional): The GPIO pin number for the backlight control signal. Defaults to 0.
+ 33            bl_freq (int, optional): The PWM frequency for backlight control in Hz. Defaults to 1000.
+ 34            i2c (None, optional): Placeholder for I2C configuration (not implemented in this version). Defaults to None.
+ 35            i2c_freq (int, optional): Placeholder for I2C frequency (not implemented in this version). Defaults to 100000.
+ 36        """
+ 37        import RPi.GPIO
+ 38        self.np = np
+ 39        self.RST_PIN = rst
+ 40        self.DC_PIN = dc
+ 41        self.BL_PIN = bl
+ 42        self.SPEED = spi_freq
+ 43        self.BL_freq = bl_freq
+ 44        self.GPIO = RPi.GPIO
+ 45        # self.GPIO.cleanup()
+ 46        self.GPIO.setmode(self.GPIO.BCM)
+ 47        self.GPIO.setwarnings(False)
+ 48        self.GPIO.setup(self.RST_PIN, self.GPIO.OUT)
+ 49        self.GPIO.setup(self.DC_PIN, self.GPIO.OUT)
+ 50        self.GPIO.setup(self.BL_PIN, self.GPIO.OUT)
+ 51        self.GPIO.output(self.BL_PIN, self.GPIO.HIGH)
+ 52        # Initialize SPI
+ 53        self.SPI = spi
+ 54        if self.SPI != None:
+ 55            self.SPI.max_speed_hz = spi_freq
+ 56            self.SPI.mode = 0b00
+ 57
+ 58    def digital_write(self, pin, value):
+ 59        """
+ 60        Writes a digital value to a specified GPIO pin.
+ 61
+ 62        Parameters:
+ 63            pin (int): The GPIO pin number.
+ 64            value (int): The value to write (HIGH or LOW, 1 or 0).
+ 65        """
+ 66        self.GPIO.output(pin, value)
+ 67
+ 68    def digital_read(self, pin):
+ 69        """
+ 70        Reads the digital value from a specified GPIO pin.
+ 71
+ 72        Parameters:
+ 73            pin (int): The GPIO pin number.
+ 74
+ 75        Returns:
+ 76            int: The digital value read from the pin (HIGH or LOW, 1 or 0).
+ 77        """
+ 78        return self.GPIO.input(pin)
+ 79
+ 80    def delay_ms(self, delaytime):
+ 81        """
+ 82        Pauses the program execution for a specified number of milliseconds.
+ 83
+ 84        Parameters:
+ 85            delaytime (int): The delay time in milliseconds.
+ 86        """
+ 87        time.sleep(delaytime / 1000.0)
+ 88
+ 89    def spi_writebyte(self, data):
+ 90        """
+ 91        Writes a list of bytes to the SPI bus.
+ 92
+ 93        Parameters:
+ 94            data (list): A list of bytes (integers) to be transmitted.
+ 95        """
+ 96        if self.SPI != None:
+ 97            self.SPI.writebytes(data)
+ 98
+ 99    def bl_DutyCycle(self, duty):
+100        """
+101        Sets the duty cycle of the PWM signal for backlight control.
+102
+103        Parameters:
+104            duty (int): The duty cycle percentage (0-100).
+105        """
+106        self._pwm.ChangeDutyCycle(duty)
+107
+108    def bl_Frequency(self, freq):
+109        """
+110        Sets the frequency of the PWM signal for backlight control.
+111
+112        Parameters:
+113            freq (int): The PWM frequency in Hz.
+114        """
+115        self._pwm.ChangeFrequency(freq)
+116
+117    def module_init(self):
+118        """
+119        Initializes the module by setting up GPIO pins and starting PWM for backlight control.
+120
+121        Returns:
+122            int: 0 if initialization is successful.
+123        """
+124        self.GPIO.setup(self.RST_PIN, self.GPIO.OUT)
+125        self.GPIO.setup(self.DC_PIN, self.GPIO.OUT)
+126        self.GPIO.setup(self.BL_PIN, self.GPIO.OUT)
+127        self._pwm = self.GPIO.PWM(self.BL_PIN, self.BL_freq)
+128        self._pwm.start(100)
+129        if self.SPI != None:
+130            self.SPI.max_speed_hz = self.SPEED
+131            self.SPI.mode = 0b00
+132        return 0
+133
+134    def module_exit(self):
+135        """
+136        Cleans up the module by closing the SPI connection, stopping PWM, and resetting GPIO pins.
+137        """
+138        logging.debug("spi end")
+139        if self.SPI != None:
+140            self.SPI.close()
+141
+142        logging.debug("gpio cleanup...")
+143        self.GPIO.output(self.RST_PIN, 1)
+144        self.GPIO.output(self.DC_PIN, 0)
+145        self._pwm.stop()
+146        time.sleep(0.001)
+147        self.GPIO.output(self.BL_PIN, 1)
+148        # self.GPIO.cleanup()
+
+ + +

This class provides an interface for controlling hardware peripherals on a Raspberry Pi, specifically SPI, GPIO, and PWM, for use with devices like LCD displays.

+ +

Attributes: + RST_PIN (int): GPIO pin number for the reset signal. + DC_PIN (int): GPIO pin number for the data/command signal. + BL_PIN (int): GPIO pin number for the backlight control signal. + SPEED (int): SPI communication frequency. + BL_freq (int): PWM frequency for backlight control. + GPIO (RPi.GPIO): The RPi.GPIO module for GPIO control. + SPI (spidev.SpiDev or None): The spidev.SpiDev object for SPI communication, or None if not used. + _pwm (RPi.GPIO.PWM): The PWM object for backlight control.

+
+ + +
+ +
+ + RaspberryPi( spi=<SpiDev object>, spi_freq=40000000, rst=27, dc=25, bl=0, bl_freq=1000, i2c=None, i2c_freq=100000) + + + +
+ +
23    def __init__(self, spi=spidev.SpiDev(0, 0), spi_freq=40000000, rst=27, dc=25, bl=0, bl_freq=1000, i2c=None, i2c_freq=100000):
+24        """
+25        Initializes the RaspberryPi object and configures GPIO, SPI, and PWM.
+26
+27        Parameters:
+28            spi (spidev.SpiDev, optional): The SPI device object. Defaults to spidev.SpiDev(0, 0). Set to None to disable SPI.
+29            spi_freq (int, optional): The SPI communication frequency in Hz. Defaults to 40000000.
+30            rst (int, optional): The GPIO pin number for the reset signal. Defaults to 27.
+31            dc (int, optional): The GPIO pin number for the data/command signal. Defaults to 25.
+32            bl (int, optional): The GPIO pin number for the backlight control signal. Defaults to 0.
+33            bl_freq (int, optional): The PWM frequency for backlight control in Hz. Defaults to 1000.
+34            i2c (None, optional): Placeholder for I2C configuration (not implemented in this version). Defaults to None.
+35            i2c_freq (int, optional): Placeholder for I2C frequency (not implemented in this version). Defaults to 100000.
+36        """
+37        import RPi.GPIO
+38        self.np = np
+39        self.RST_PIN = rst
+40        self.DC_PIN = dc
+41        self.BL_PIN = bl
+42        self.SPEED = spi_freq
+43        self.BL_freq = bl_freq
+44        self.GPIO = RPi.GPIO
+45        # self.GPIO.cleanup()
+46        self.GPIO.setmode(self.GPIO.BCM)
+47        self.GPIO.setwarnings(False)
+48        self.GPIO.setup(self.RST_PIN, self.GPIO.OUT)
+49        self.GPIO.setup(self.DC_PIN, self.GPIO.OUT)
+50        self.GPIO.setup(self.BL_PIN, self.GPIO.OUT)
+51        self.GPIO.output(self.BL_PIN, self.GPIO.HIGH)
+52        # Initialize SPI
+53        self.SPI = spi
+54        if self.SPI != None:
+55            self.SPI.max_speed_hz = spi_freq
+56            self.SPI.mode = 0b00
+
+ + +

Initializes the RaspberryPi object and configures GPIO, SPI, and PWM.

+ +

Parameters: + spi (spidev.SpiDev, optional): The SPI device object. Defaults to spidev.SpiDev(0, 0). Set to None to disable SPI. + spi_freq (int, optional): The SPI communication frequency in Hz. Defaults to 40000000. + rst (int, optional): The GPIO pin number for the reset signal. Defaults to 27. + dc (int, optional): The GPIO pin number for the data/command signal. Defaults to 25. + bl (int, optional): The GPIO pin number for the backlight control signal. Defaults to 0. + bl_freq (int, optional): The PWM frequency for backlight control in Hz. Defaults to 1000. + i2c (None, optional): Placeholder for I2C configuration (not implemented in this version). Defaults to None. + i2c_freq (int, optional): Placeholder for I2C frequency (not implemented in this version). Defaults to 100000.

+
+ + +
+
+
+ np + + +
+ + + + +
+
+
+ RST_PIN + + +
+ + + + +
+
+
+ DC_PIN + + +
+ + + + +
+
+
+ BL_PIN + + +
+ + + + +
+
+
+ SPEED + + +
+ + + + +
+
+
+ BL_freq + + +
+ + + + +
+
+
+ GPIO + + +
+ + + + +
+
+
+ SPI + + +
+ + + + +
+
+ +
+ + def + digital_write(self, pin, value): + + + +
+ +
58    def digital_write(self, pin, value):
+59        """
+60        Writes a digital value to a specified GPIO pin.
+61
+62        Parameters:
+63            pin (int): The GPIO pin number.
+64            value (int): The value to write (HIGH or LOW, 1 or 0).
+65        """
+66        self.GPIO.output(pin, value)
+
+ + +

Writes a digital value to a specified GPIO pin.

+ +

Parameters: + pin (int): The GPIO pin number. + value (int): The value to write (HIGH or LOW, 1 or 0).

+
+ + +
+
+ +
+ + def + digital_read(self, pin): + + + +
+ +
68    def digital_read(self, pin):
+69        """
+70        Reads the digital value from a specified GPIO pin.
+71
+72        Parameters:
+73            pin (int): The GPIO pin number.
+74
+75        Returns:
+76            int: The digital value read from the pin (HIGH or LOW, 1 or 0).
+77        """
+78        return self.GPIO.input(pin)
+
+ + +

Reads the digital value from a specified GPIO pin.

+ +

Parameters: + pin (int): The GPIO pin number.

+ +

Returns: + int: The digital value read from the pin (HIGH or LOW, 1 or 0).

+
+ + +
+
+ +
+ + def + delay_ms(self, delaytime): + + + +
+ +
80    def delay_ms(self, delaytime):
+81        """
+82        Pauses the program execution for a specified number of milliseconds.
+83
+84        Parameters:
+85            delaytime (int): The delay time in milliseconds.
+86        """
+87        time.sleep(delaytime / 1000.0)
+
+ + +

Pauses the program execution for a specified number of milliseconds.

+ +

Parameters: + delaytime (int): The delay time in milliseconds.

+
+ + +
+
+ +
+ + def + spi_writebyte(self, data): + + + +
+ +
89    def spi_writebyte(self, data):
+90        """
+91        Writes a list of bytes to the SPI bus.
+92
+93        Parameters:
+94            data (list): A list of bytes (integers) to be transmitted.
+95        """
+96        if self.SPI != None:
+97            self.SPI.writebytes(data)
+
+ + +

Writes a list of bytes to the SPI bus.

+ +

Parameters: + data (list): A list of bytes (integers) to be transmitted.

+
+ + +
+
+ +
+ + def + bl_DutyCycle(self, duty): + + + +
+ +
 99    def bl_DutyCycle(self, duty):
+100        """
+101        Sets the duty cycle of the PWM signal for backlight control.
+102
+103        Parameters:
+104            duty (int): The duty cycle percentage (0-100).
+105        """
+106        self._pwm.ChangeDutyCycle(duty)
+
+ + +

Sets the duty cycle of the PWM signal for backlight control.

+ +

Parameters: + duty (int): The duty cycle percentage (0-100).

+
+ + +
+
+ +
+ + def + bl_Frequency(self, freq): + + + +
+ +
108    def bl_Frequency(self, freq):
+109        """
+110        Sets the frequency of the PWM signal for backlight control.
+111
+112        Parameters:
+113            freq (int): The PWM frequency in Hz.
+114        """
+115        self._pwm.ChangeFrequency(freq)
+
+ + +

Sets the frequency of the PWM signal for backlight control.

+ +

Parameters: + freq (int): The PWM frequency in Hz.

+
+ + +
+
+ +
+ + def + module_init(self): + + + +
+ +
117    def module_init(self):
+118        """
+119        Initializes the module by setting up GPIO pins and starting PWM for backlight control.
+120
+121        Returns:
+122            int: 0 if initialization is successful.
+123        """
+124        self.GPIO.setup(self.RST_PIN, self.GPIO.OUT)
+125        self.GPIO.setup(self.DC_PIN, self.GPIO.OUT)
+126        self.GPIO.setup(self.BL_PIN, self.GPIO.OUT)
+127        self._pwm = self.GPIO.PWM(self.BL_PIN, self.BL_freq)
+128        self._pwm.start(100)
+129        if self.SPI != None:
+130            self.SPI.max_speed_hz = self.SPEED
+131            self.SPI.mode = 0b00
+132        return 0
+
+ + +

Initializes the module by setting up GPIO pins and starting PWM for backlight control.

+ +

Returns: + int: 0 if initialization is successful.

+
+ + +
+
+ +
+ + def + module_exit(self): + + + +
+ +
134    def module_exit(self):
+135        """
+136        Cleans up the module by closing the SPI connection, stopping PWM, and resetting GPIO pins.
+137        """
+138        logging.debug("spi end")
+139        if self.SPI != None:
+140            self.SPI.close()
+141
+142        logging.debug("gpio cleanup...")
+143        self.GPIO.output(self.RST_PIN, 1)
+144        self.GPIO.output(self.DC_PIN, 0)
+145        self._pwm.stop()
+146        time.sleep(0.001)
+147        self.GPIO.output(self.BL_PIN, 1)
+148        # self.GPIO.cleanup()
+
+ + +

Cleans up the module by closing the SPI connection, stopping PWM, and resetting GPIO pins.

+
+ + +
+
+
+ + \ No newline at end of file diff --git a/docs/lcdconfig/search.js b/docs/lcdconfig/search.js new file mode 100644 index 0000000..d357022 --- /dev/null +++ b/docs/lcdconfig/search.js @@ -0,0 +1,46 @@ +window.pdocSearch = (function(){ +/** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o

\n"}, "lcdconfig.RaspberryPi": {"fullname": "lcdconfig.RaspberryPi", "modulename": "lcdconfig", "qualname": "RaspberryPi", "kind": "class", "doc": "

This class provides an interface for controlling hardware peripherals on a Raspberry Pi, specifically SPI, GPIO, and PWM, for use with devices like LCD displays.

\n\n

Attributes:\n RST_PIN (int): GPIO pin number for the reset signal.\n DC_PIN (int): GPIO pin number for the data/command signal.\n BL_PIN (int): GPIO pin number for the backlight control signal.\n SPEED (int): SPI communication frequency.\n BL_freq (int): PWM frequency for backlight control.\n GPIO (RPi.GPIO): The RPi.GPIO module for GPIO control.\n SPI (spidev.SpiDev or None): The spidev.SpiDev object for SPI communication, or None if not used.\n _pwm (RPi.GPIO.PWM): The PWM object for backlight control.

\n"}, "lcdconfig.RaspberryPi.__init__": {"fullname": "lcdconfig.RaspberryPi.__init__", "modulename": "lcdconfig", "qualname": "RaspberryPi.__init__", "kind": "function", "doc": "

Initializes the RaspberryPi object and configures GPIO, SPI, and PWM.

\n\n

Parameters:\n spi (spidev.SpiDev, optional): The SPI device object. Defaults to spidev.SpiDev(0, 0). Set to None to disable SPI.\n spi_freq (int, optional): The SPI communication frequency in Hz. Defaults to 40000000.\n rst (int, optional): The GPIO pin number for the reset signal. Defaults to 27.\n dc (int, optional): The GPIO pin number for the data/command signal. Defaults to 25.\n bl (int, optional): The GPIO pin number for the backlight control signal. Defaults to 0.\n bl_freq (int, optional): The PWM frequency for backlight control in Hz. Defaults to 1000.\n i2c (None, optional): Placeholder for I2C configuration (not implemented in this version). Defaults to None.\n i2c_freq (int, optional): Placeholder for I2C frequency (not implemented in this version). Defaults to 100000.

\n", "signature": "(\tspi=<SpiDev object>,\tspi_freq=40000000,\trst=27,\tdc=25,\tbl=0,\tbl_freq=1000,\ti2c=None,\ti2c_freq=100000)"}, "lcdconfig.RaspberryPi.np": {"fullname": "lcdconfig.RaspberryPi.np", "modulename": "lcdconfig", "qualname": "RaspberryPi.np", "kind": "variable", "doc": "

\n"}, "lcdconfig.RaspberryPi.RST_PIN": {"fullname": "lcdconfig.RaspberryPi.RST_PIN", "modulename": "lcdconfig", "qualname": "RaspberryPi.RST_PIN", "kind": "variable", "doc": "

\n"}, "lcdconfig.RaspberryPi.DC_PIN": {"fullname": "lcdconfig.RaspberryPi.DC_PIN", "modulename": "lcdconfig", "qualname": "RaspberryPi.DC_PIN", "kind": "variable", "doc": "

\n"}, "lcdconfig.RaspberryPi.BL_PIN": {"fullname": "lcdconfig.RaspberryPi.BL_PIN", "modulename": "lcdconfig", "qualname": "RaspberryPi.BL_PIN", "kind": "variable", "doc": "

\n"}, "lcdconfig.RaspberryPi.SPEED": {"fullname": "lcdconfig.RaspberryPi.SPEED", "modulename": "lcdconfig", "qualname": "RaspberryPi.SPEED", "kind": "variable", "doc": "

\n"}, "lcdconfig.RaspberryPi.BL_freq": {"fullname": "lcdconfig.RaspberryPi.BL_freq", "modulename": "lcdconfig", "qualname": "RaspberryPi.BL_freq", "kind": "variable", "doc": "

\n"}, "lcdconfig.RaspberryPi.GPIO": {"fullname": "lcdconfig.RaspberryPi.GPIO", "modulename": "lcdconfig", "qualname": "RaspberryPi.GPIO", "kind": "variable", "doc": "

\n"}, "lcdconfig.RaspberryPi.SPI": {"fullname": "lcdconfig.RaspberryPi.SPI", "modulename": "lcdconfig", "qualname": "RaspberryPi.SPI", "kind": "variable", "doc": "

\n"}, "lcdconfig.RaspberryPi.digital_write": {"fullname": "lcdconfig.RaspberryPi.digital_write", "modulename": "lcdconfig", "qualname": "RaspberryPi.digital_write", "kind": "function", "doc": "

Writes a digital value to a specified GPIO pin.

\n\n

Parameters:\n pin (int): The GPIO pin number.\n value (int): The value to write (HIGH or LOW, 1 or 0).

\n", "signature": "(self, pin, value):", "funcdef": "def"}, "lcdconfig.RaspberryPi.digital_read": {"fullname": "lcdconfig.RaspberryPi.digital_read", "modulename": "lcdconfig", "qualname": "RaspberryPi.digital_read", "kind": "function", "doc": "

Reads the digital value from a specified GPIO pin.

\n\n

Parameters:\n pin (int): The GPIO pin number.

\n\n

Returns:\n int: The digital value read from the pin (HIGH or LOW, 1 or 0).

\n", "signature": "(self, pin):", "funcdef": "def"}, "lcdconfig.RaspberryPi.delay_ms": {"fullname": "lcdconfig.RaspberryPi.delay_ms", "modulename": "lcdconfig", "qualname": "RaspberryPi.delay_ms", "kind": "function", "doc": "

Pauses the program execution for a specified number of milliseconds.

\n\n

Parameters:\n delaytime (int): The delay time in milliseconds.

\n", "signature": "(self, delaytime):", "funcdef": "def"}, "lcdconfig.RaspberryPi.spi_writebyte": {"fullname": "lcdconfig.RaspberryPi.spi_writebyte", "modulename": "lcdconfig", "qualname": "RaspberryPi.spi_writebyte", "kind": "function", "doc": "

Writes a list of bytes to the SPI bus.

\n\n

Parameters:\n data (list): A list of bytes (integers) to be transmitted.

\n", "signature": "(self, data):", "funcdef": "def"}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"fullname": "lcdconfig.RaspberryPi.bl_DutyCycle", "modulename": "lcdconfig", "qualname": "RaspberryPi.bl_DutyCycle", "kind": "function", "doc": "

Sets the duty cycle of the PWM signal for backlight control.

\n\n

Parameters:\n duty (int): The duty cycle percentage (0-100).

\n", "signature": "(self, duty):", "funcdef": "def"}, "lcdconfig.RaspberryPi.bl_Frequency": {"fullname": "lcdconfig.RaspberryPi.bl_Frequency", "modulename": "lcdconfig", "qualname": "RaspberryPi.bl_Frequency", "kind": "function", "doc": "

Sets the frequency of the PWM signal for backlight control.

\n\n

Parameters:\n freq (int): The PWM frequency in Hz.

\n", "signature": "(self, freq):", "funcdef": "def"}, "lcdconfig.RaspberryPi.module_init": {"fullname": "lcdconfig.RaspberryPi.module_init", "modulename": "lcdconfig", "qualname": "RaspberryPi.module_init", "kind": "function", "doc": "

Initializes the module by setting up GPIO pins and starting PWM for backlight control.

\n\n

Returns:\n int: 0 if initialization is successful.

\n", "signature": "(self):", "funcdef": "def"}, "lcdconfig.RaspberryPi.module_exit": {"fullname": "lcdconfig.RaspberryPi.module_exit", "modulename": "lcdconfig", "qualname": "RaspberryPi.module_exit", "kind": "function", "doc": "

Cleans up the module by closing the SPI connection, stopping PWM, and resetting GPIO pins.

\n", "signature": "(self):", "funcdef": "def"}}, "docInfo": {"lcdconfig": {"qualname": 0, "fullname": 1, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "lcdconfig.RaspberryPi": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 121}, "lcdconfig.RaspberryPi.__init__": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 103, "bases": 0, "doc": 147}, "lcdconfig.RaspberryPi.np": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "lcdconfig.RaspberryPi.RST_PIN": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "lcdconfig.RaspberryPi.DC_PIN": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "lcdconfig.RaspberryPi.BL_PIN": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "lcdconfig.RaspberryPi.SPEED": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "lcdconfig.RaspberryPi.BL_freq": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "lcdconfig.RaspberryPi.GPIO": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "lcdconfig.RaspberryPi.SPI": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "lcdconfig.RaspberryPi.digital_write": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 36}, "lcdconfig.RaspberryPi.digital_read": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 41}, "lcdconfig.RaspberryPi.delay_ms": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 25}, "lcdconfig.RaspberryPi.spi_writebyte": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 27}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 27}, "lcdconfig.RaspberryPi.bl_Frequency": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 25}, "lcdconfig.RaspberryPi.module_init": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 27}, "lcdconfig.RaspberryPi.module_exit": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 18}}, "length": 19, "save": true}, "index": {"qualname": {"root": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1}, "lcdconfig.RaspberryPi.np": {"tf": 1}, "lcdconfig.RaspberryPi.RST_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.DC_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.BL_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.SPEED": {"tf": 1}, "lcdconfig.RaspberryPi.BL_freq": {"tf": 1}, "lcdconfig.RaspberryPi.GPIO": {"tf": 1}, "lcdconfig.RaspberryPi.SPI": {"tf": 1}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 18}}}}}}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.RST_PIN": {"tf": 1}}, "df": 1}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 2}}}}, "n": {"docs": {}, "df": 0, "p": {"docs": {"lcdconfig.RaspberryPi.np": {"tf": 1}}, "df": 1}}, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi.RST_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.DC_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.BL_PIN": {"tf": 1}}, "df": 3}}}, "d": {"docs": {}, "df": 0, "c": {"docs": {"lcdconfig.RaspberryPi.DC_PIN": {"tf": 1}}, "df": 1}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 2}}}}}}, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}}, "df": 1}}}}}}}}}, "b": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi.BL_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.BL_freq": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 4}}, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi.SPEED": {"tf": 1}}, "df": 1}}}, "i": {"docs": {"lcdconfig.RaspberryPi.SPI": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 2}}}, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "q": {"docs": {"lcdconfig.RaspberryPi.BL_freq": {"tf": 1}}, "df": 1, "u": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 1}}}}}}}}}, "g": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {"lcdconfig.RaspberryPi.GPIO": {"tf": 1}}, "df": 1}}}}, "w": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}}, "df": 1, "b": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 1}}}}}}}}}, "m": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 2}}}}}}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 1}}}}}}, "fullname": {"root": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1, "l": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {"lcdconfig": {"tf": 1}, "lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1}, "lcdconfig.RaspberryPi.np": {"tf": 1}, "lcdconfig.RaspberryPi.RST_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.DC_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.BL_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.SPEED": {"tf": 1}, "lcdconfig.RaspberryPi.BL_freq": {"tf": 1}, "lcdconfig.RaspberryPi.GPIO": {"tf": 1}, "lcdconfig.RaspberryPi.SPI": {"tf": 1}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 19}}}}}}}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1}, "lcdconfig.RaspberryPi.np": {"tf": 1}, "lcdconfig.RaspberryPi.RST_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.DC_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.BL_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.SPEED": {"tf": 1}, "lcdconfig.RaspberryPi.BL_freq": {"tf": 1}, "lcdconfig.RaspberryPi.GPIO": {"tf": 1}, "lcdconfig.RaspberryPi.SPI": {"tf": 1}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 18}}}}}}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.RST_PIN": {"tf": 1}}, "df": 1}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 2}}}}, "n": {"docs": {}, "df": 0, "p": {"docs": {"lcdconfig.RaspberryPi.np": {"tf": 1}}, "df": 1}}, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi.RST_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.DC_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.BL_PIN": {"tf": 1}}, "df": 3}}}, "d": {"docs": {}, "df": 0, "c": {"docs": {"lcdconfig.RaspberryPi.DC_PIN": {"tf": 1}}, "df": 1}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 2}}}}}}, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}}, "df": 1}}}}}}}}}, "b": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi.BL_PIN": {"tf": 1}, "lcdconfig.RaspberryPi.BL_freq": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 4}}, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi.SPEED": {"tf": 1}}, "df": 1}}}, "i": {"docs": {"lcdconfig.RaspberryPi.SPI": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 2}}}, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "q": {"docs": {"lcdconfig.RaspberryPi.BL_freq": {"tf": 1}}, "df": 1, "u": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 1}}}}}}}}}, "g": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {"lcdconfig.RaspberryPi.GPIO": {"tf": 1}}, "df": 1}}}}, "w": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}}, "df": 1, "b": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 1}}}}}}}}}, "m": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 2}}}}}}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 1}}}}}}, "annotation": {"root": {"docs": {}, "df": 0}}, "default_value": {"root": {"docs": {}, "df": 0}}, "signature": {"root": {"0": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "1": {"0": {"0": {"0": {"0": {"0": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "2": {"5": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "7": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "4": {"0": {"0": {"0": {"0": {"0": {"0": {"0": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 9}, "lcdconfig.RaspberryPi.digital_write": {"tf": 4.242640687119285}, "lcdconfig.RaspberryPi.digital_read": {"tf": 3.7416573867739413}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 3.7416573867739413}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 3.7416573867739413}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 3.7416573867739413}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 3.7416573867739413}, "lcdconfig.RaspberryPi.module_init": {"tf": 3.1622776601683795}, "lcdconfig.RaspberryPi.module_exit": {"tf": 3.1622776601683795}}, "df": 9, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 1, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "v": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "f": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 8}}}}, "l": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}, "o": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "j": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}}}}}, "g": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "q": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 2}}}}, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}}, "d": {"docs": {}, "df": 0, "c": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}}}}}}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 1}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}}, "df": 1}}}}, "b": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 1}}, "i": {"2": {"docs": {}, "df": 0, "c": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 1}}, "docs": {}, "df": 0}, "n": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}}}, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 2}}}, "v": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}}, "df": 1}}}}}}}, "bases": {"root": {"docs": {}, "df": 0}}, "doc": {"root": {"0": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 5}, "1": {"0": {"0": {"0": {"0": {"0": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "docs": {"lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 2}, "2": {"5": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "7": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "4": {"0": {"0": {"0": {"0": {"0": {"0": {"0": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {"lcdconfig": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi": {"tf": 3.7416573867739413}, "lcdconfig.RaspberryPi.__init__": {"tf": 3.7416573867739413}, "lcdconfig.RaspberryPi.np": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.RST_PIN": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.DC_PIN": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.BL_PIN": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.SPEED": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.BL_freq": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.GPIO": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.SPI": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.digital_write": {"tf": 2.8284271247461903}, "lcdconfig.RaspberryPi.digital_read": {"tf": 3.1622776601683795}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 2.6457513110645907}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 2.6457513110645907}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 2.6457513110645907}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 2.6457513110645907}, "lcdconfig.RaspberryPi.module_init": {"tf": 2.449489742783178}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1.7320508075688772}}, "df": 19, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 2}}, "e": {"docs": {"lcdconfig.RaspberryPi": {"tf": 2.449489742783178}, "lcdconfig.RaspberryPi.__init__": {"tf": 3.1622776601683795}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.digital_read": {"tf": 2}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1.4142135623730951}}, "df": 10}}, "o": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 3.1622776601683795}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1.4142135623730951}}, "df": 3}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 1}}}}}}}}}}}, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 1}}}}, "o": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 1}}}}}}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi": {"tf": 2}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 5, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}}}}}}, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}}}}}}}}}, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 1}}}}}}}}, "m": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 2}}}}}}}}}}}}, "y": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}}}, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}}}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}}}}}}, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}}, "df": 1}}}}}}}}}, "i": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1, "n": {"docs": {"lcdconfig.RaspberryPi": {"tf": 2.449489742783178}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.digital_read": {"tf": 2}}, "df": 4, "s": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 2}}}, "w": {"docs": {}, "df": 0, "m": {"docs": {"lcdconfig.RaspberryPi": {"tf": 2.23606797749979}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 6}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 7}}}}}}}}, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}}, "a": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1.4142135623730951}}, "df": 5, "n": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1, "d": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 4}}, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}}}}}}}}, "i": {"2": {"docs": {}, "df": 0, "c": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 2}}, "df": 1}}, "docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 2}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 3, "t": {"docs": {"lcdconfig.RaspberryPi": {"tf": 2.23606797749979}, "lcdconfig.RaspberryPi.__init__": {"tf": 2.449489742783178}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 8, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 1}}}}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 2}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 1}}}}}}}}}}}}}, "f": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 2}, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}, "s": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 1}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"lcdconfig.RaspberryPi": {"tf": 3}, "lcdconfig.RaspberryPi.__init__": {"tf": 2.449489742783178}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 6}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "q": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 3, "u": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1.4142135623730951}}, "df": 3}}}}}}}, "o": {"docs": {}, "df": 0, "m": {"docs": {"lcdconfig.RaspberryPi.digital_read": {"tf": 1.4142135623730951}}, "df": 1}}}}, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}}}}}, "z": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 2}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 2}}}}, "o": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}, "r": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1.4142135623730951}}, "df": 3}, "b": {"docs": {}, "df": 0, "j": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 2}}}}}, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 2.8284271247461903}}, "df": 1}}}}}}}, "f": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 4}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1, "p": {"docs": {}, "df": 0, "i": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}}}}}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 2}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 2, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 1}}}}}}}, "a": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 1, "s": {"docs": {"lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 1}}}, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 2}}}}}}, "p": {"docs": {}, "df": 0, "i": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.7320508075688772}}, "df": 1}}}, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 3}}}}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}, "i": {"docs": {"lcdconfig.RaspberryPi": {"tf": 2}, "lcdconfig.RaspberryPi.__init__": {"tf": 2.449489742783178}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 4, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "v": {"docs": {"lcdconfig.RaspberryPi": {"tf": 2}, "lcdconfig.RaspberryPi.__init__": {"tf": 2}}, "df": 2}}}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 4}}}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1, "s": {"docs": {"lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}}, "df": 2}, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 1}}}}}}, "o": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 1}}}}}}}, "u": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 1}}}}}}}}}}, "g": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {"lcdconfig.RaspberryPi": {"tf": 3}, "lcdconfig.RaspberryPi.__init__": {"tf": 2}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 6}}}}, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1, "d": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}, "p": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 2}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}}, "df": 1, "s": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 2}}}}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1, "s": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}}}, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 2.8284271247461903}}, "df": 1}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}}}}}}}}, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 1}}}}}, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1.4142135623730951}}, "df": 2}}}}}}, "c": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 2}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 1, "/": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1}}, "df": 2}}}}}}}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1.7320508075688772}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}, "s": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1.7320508075688772}}, "df": 1}}}, "c": {"docs": {}, "df": 0, "d": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}}, "df": 1}}, "o": {"docs": {}, "df": 0, "w": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}}, "df": 2}}}, "n": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.digital_write": {"tf": 1}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1}, "lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 5}}}}}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.7320508075688772}}, "df": 2}}, "t": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 2}}}, "b": {"docs": {}, "df": 0, "l": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 2}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}, "lcdconfig.RaspberryPi.bl_DutyCycle": {"tf": 1}, "lcdconfig.RaspberryPi.bl_Frequency": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}}, "df": 5}}}}}}}}, "y": {"docs": {"lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 2, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1.4142135623730951}}, "df": 1}}}}, "u": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 1}}, "e": {"docs": {"lcdconfig.RaspberryPi.spi_writebyte": {"tf": 1}}, "df": 1}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi": {"tf": 1}, "lcdconfig.RaspberryPi.module_init": {"tf": 1}, "lcdconfig.RaspberryPi.module_exit": {"tf": 1}}, "df": 3}}}}}, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "s": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi.__init__": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"lcdconfig.RaspberryPi.digital_write": {"tf": 1.7320508075688772}, "lcdconfig.RaspberryPi.digital_read": {"tf": 1.4142135623730951}}, "df": 2}}}}}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"lcdconfig.RaspberryPi.delay_ms": {"tf": 1}}, "df": 1}}}}}}}}}}}}, "pipeline": ["trimmer"], "_isPrebuiltIndex": true}; + + // mirrored in build-search-index.js (part 1) + // Also split on html tags. this is a cheap heuristic, but good enough. + elasticlunr.tokenizer.setSeperator(/[\s\-.;&_'"=,()]+|<[^>]*>/); + + let searchIndex; + if (docs._isPrebuiltIndex) { + console.info("using precompiled search index"); + searchIndex = elasticlunr.Index.load(docs); + } else { + console.time("building search index"); + // mirrored in build-search-index.js (part 2) + searchIndex = elasticlunr(function () { + this.pipeline.remove(elasticlunr.stemmer); + this.pipeline.remove(elasticlunr.stopWordFilter); + this.addField("qualname"); + this.addField("fullname"); + this.addField("annotation"); + this.addField("default_value"); + this.addField("signature"); + this.addField("bases"); + this.addField("doc"); + this.setRef("fullname"); + }); + for (let doc of docs) { + searchIndex.addDoc(doc); + } + console.timeEnd("building search index"); + } + + return (term) => searchIndex.search(term, { + fields: { + qualname: {boost: 4}, + fullname: {boost: 2}, + annotation: {boost: 2}, + default_value: {boost: 2}, + signature: {boost: 2}, + bases: {boost: 2}, + doc: {boost: 1}, + }, + expand: true + }); +})(); \ No newline at end of file diff --git a/docs/xgoedu/index.html b/docs/xgoedu/index.html new file mode 100644 index 0000000..26423ae --- /dev/null +++ b/docs/xgoedu/index.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/xgoedu/search.js b/docs/xgoedu/search.js new file mode 100644 index 0000000..6be7f9d --- /dev/null +++ b/docs/xgoedu/search.js @@ -0,0 +1,46 @@ +window.pdocSearch = (function(){ +/** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();oxgo graphical python library edu library

\n"}, "xgoedu.camera_still": {"fullname": "xgoedu.camera_still", "modulename": "xgoedu", "qualname": "camera_still", "kind": "variable", "doc": "

Face detection

\n", "default_value": "False"}, "xgoedu.getFaceBox": {"fullname": "xgoedu.getFaceBox", "modulename": "xgoedu", "qualname": "getFaceBox", "kind": "function", "doc": "

Detects faces in a given frame using a pre-trained deep neural network.

\n\n

Parameters:\n net (cv2.dnn.Net): The pre-trained face detection model.\n frame (numpy.ndarray): The input image frame.\n conf_threshold (float, optional): The minimum confidence threshold for a detection to be considered a face. Defaults to 0.7.

\n\n

Returns:\n tuple: A tuple containing the frame with detected faces and a list of bounding boxes.\n - frameOpencvDnn (numpy.ndarray): The frame with bounding boxes drawn around detected faces.\n - bboxes (list): A list of bounding boxes, where each bounding box is represented as [x1, y1, x2, y2].

\n", "signature": "(net, frame, conf_threshold=0.7):", "funcdef": "def"}, "xgoedu.hand_pos": {"fullname": "xgoedu.hand_pos", "modulename": "xgoedu", "qualname": "hand_pos", "kind": "function", "doc": "

Recognizes hand gestures based on finger angles.

\n\n

Parameters:\n angle (list): A list of 5 finger angles (thumb, index, middle, ring, pinky).

\n\n

Returns:\n str or None: The recognized hand gesture ('Good', 'Ok', 'Rock', 'Stone', '1', '3', '4', '5', '2') or None if no gesture is recognized.

\n", "signature": "(angle):", "funcdef": "def"}, "xgoedu.color": {"fullname": "xgoedu.color", "modulename": "xgoedu", "qualname": "color", "kind": "function", "doc": "

Converts a color value between hexadecimal and RGB tuple formats.

\n\n

Parameters:\n value (str or tuple): The color value to convert. \n - If a string, it should be a hexadecimal color code (e.g., '#FF0000').\n - If a tuple, it should be an RGB tuple (e.g., (255, 0, 0)).

\n\n

Returns:\n str or tuple: The converted color value.\n - If the input is a tuple, the output is a hexadecimal color string.\n - If the input is a string, the output is an RGB tuple.

\n", "signature": "(value):", "funcdef": "def"}, "xgoedu.XGOEDU": {"fullname": "xgoedu.XGOEDU", "modulename": "xgoedu", "qualname": "XGOEDU", "kind": "class", "doc": "

A class for controlling and interacting with the XGO robot's educational features, including the LCD display, camera, and various AI functions.

\n"}, "xgoedu.XGOEDU.__init__": {"fullname": "xgoedu.XGOEDU.__init__", "modulename": "xgoedu", "qualname": "XGOEDU.__init__", "kind": "function", "doc": "

Initializes the XGOEDU object, setting up the LCD display, GPIO pins, and various attributes.

\n", "signature": "()"}, "xgoedu.XGOEDU.display": {"fullname": "xgoedu.XGOEDU.display", "modulename": "xgoedu", "qualname": "XGOEDU.display", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.splash": {"fullname": "xgoedu.XGOEDU.splash", "modulename": "xgoedu", "qualname": "XGOEDU.splash", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.draw": {"fullname": "xgoedu.XGOEDU.draw", "modulename": "xgoedu", "qualname": "XGOEDU.draw", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.font": {"fullname": "xgoedu.XGOEDU.font", "modulename": "xgoedu", "qualname": "XGOEDU.font", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.key1": {"fullname": "xgoedu.XGOEDU.key1", "modulename": "xgoedu", "qualname": "XGOEDU.key1", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.key2": {"fullname": "xgoedu.XGOEDU.key2", "modulename": "xgoedu", "qualname": "XGOEDU.key2", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.key3": {"fullname": "xgoedu.XGOEDU.key3", "modulename": "xgoedu", "qualname": "XGOEDU.key3", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.key4": {"fullname": "xgoedu.XGOEDU.key4", "modulename": "xgoedu", "qualname": "XGOEDU.key4", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.cap": {"fullname": "xgoedu.XGOEDU.cap", "modulename": "xgoedu", "qualname": "XGOEDU.cap", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.hand": {"fullname": "xgoedu.XGOEDU.hand", "modulename": "xgoedu", "qualname": "XGOEDU.hand", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.yolo": {"fullname": "xgoedu.XGOEDU.yolo", "modulename": "xgoedu", "qualname": "XGOEDU.yolo", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.face": {"fullname": "xgoedu.XGOEDU.face", "modulename": "xgoedu", "qualname": "XGOEDU.face", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.face_classifier": {"fullname": "xgoedu.XGOEDU.face_classifier", "modulename": "xgoedu", "qualname": "XGOEDU.face_classifier", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.classifier": {"fullname": "xgoedu.XGOEDU.classifier", "modulename": "xgoedu", "qualname": "XGOEDU.classifier", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.agesexmark": {"fullname": "xgoedu.XGOEDU.agesexmark", "modulename": "xgoedu", "qualname": "XGOEDU.agesexmark", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.camera_still": {"fullname": "xgoedu.XGOEDU.camera_still", "modulename": "xgoedu", "qualname": "XGOEDU.camera_still", "kind": "variable", "doc": "

\n"}, "xgoedu.XGOEDU.open_camera": {"fullname": "xgoedu.XGOEDU.open_camera", "modulename": "xgoedu", "qualname": "XGOEDU.open_camera", "kind": "function", "doc": "

Opens the camera if it's not already open.

\n", "signature": "(self):", "funcdef": "def"}, "xgoedu.XGOEDU.fetch_token": {"fullname": "xgoedu.XGOEDU.fetch_token", "modulename": "xgoedu", "qualname": "XGOEDU.fetch_token", "kind": "function", "doc": "

Fetches an access token from the Baidu AI platform.

\n\n

Returns:\n str: The access token.

\n\n

Raises:\n DemoError: If the API key or secret key is incorrect, or if the scope is not correct.

\n", "signature": "(self):", "funcdef": "def"}, "xgoedu.XGOEDU.lcd_line": {"fullname": "xgoedu.XGOEDU.lcd_line", "modulename": "xgoedu", "qualname": "XGOEDU.lcd_line", "kind": "function", "doc": "

Draws a straight line on the LCD display.

\n\n

Parameters:\n x1 (int): The x-coordinate of the starting point.\n y1 (int): The y-coordinate of the starting point.\n x2 (int): The x-coordinate of the ending point.\n y2 (int): The y-coordinate of the ending point.\n color (str, optional): The color of the line. Defaults to \"WHITE\".\n width (int, optional): The width of the line. Defaults to 2.

\n", "signature": "(self, x1, y1, x2, y2, color='WHITE', width=2):", "funcdef": "def"}, "xgoedu.XGOEDU.lcd_circle": {"fullname": "xgoedu.XGOEDU.lcd_circle", "modulename": "xgoedu", "qualname": "XGOEDU.lcd_circle", "kind": "function", "doc": "

Draws a circle or an arc on the LCD display.

\n\n

Parameters:\n x1 (int): The x-coordinate of the top-left corner of the bounding box.\n y1 (int): The y-coordinate of the top-left corner of the bounding box.\n x2 (int): The x-coordinate of the bottom-right corner of the bounding box.\n y2 (int): The y-coordinate of the bottom-right corner of the bounding box.\n angle0 (int): The starting angle (in degrees).\n angle1 (int): The ending angle (in degrees).\n color (str, optional): The color of the circle/arc. Defaults to \"WHITE\".\n width (int, optional): The width of the circle/arc. Defaults to 2.

\n", "signature": "(self, x1, y1, x2, y2, angle0, angle1, color='WHITE', width=2):", "funcdef": "def"}, "xgoedu.XGOEDU.lcd_round": {"fullname": "xgoedu.XGOEDU.lcd_round", "modulename": "xgoedu", "qualname": "XGOEDU.lcd_round", "kind": "function", "doc": "

Draws a circle on the LCD display using the center point and radius.

\n\n

Parameters:\n center_x (int): The x-coordinate of the center of the circle.\n center_y (int): The y-coordinate of the center of the circle.\n radius (int): The radius of the circle.\n color (str): The color of the circle.\n width (int, optional): The width of the circle's outline. Defaults to 2.

\n", "signature": "(self, center_x, center_y, radius, color, width=2):", "funcdef": "def"}, "xgoedu.XGOEDU.lcd_rectangle": {"fullname": "xgoedu.XGOEDU.lcd_rectangle", "modulename": "xgoedu", "qualname": "XGOEDU.lcd_rectangle", "kind": "function", "doc": "

Draws a rectangle on the LCD display.

\n\n

Parameters:\n x1 (int): The x-coordinate of the top-left corner.\n y1 (int): The y-coordinate of the top-left corner.\n x2 (int): The x-coordinate of the bottom-right corner.\n y2 (int): The y-coordinate of the bottom-right corner.\n fill (str, optional): The fill color of the rectangle. Defaults to None.\n outline (str, optional): The outline color of the rectangle. Defaults to \"WHITE\".\n width (int, optional): The width of the rectangle's outline. Defaults to 2.

\n", "signature": "(self, x1, y1, x2, y2, fill=None, outline='WHITE', width=2):", "funcdef": "def"}, "xgoedu.XGOEDU.lcd_clear": {"fullname": "xgoedu.XGOEDU.lcd_clear", "modulename": "xgoedu", "qualname": "XGOEDU.lcd_clear", "kind": "function", "doc": "

Clears the LCD display.

\n", "signature": "(self):", "funcdef": "def"}, "xgoedu.XGOEDU.lcd_picture": {"fullname": "xgoedu.XGOEDU.lcd_picture", "modulename": "xgoedu", "qualname": "XGOEDU.lcd_picture", "kind": "function", "doc": "

Displays an image on the LCD display.

\n\n

Parameters:\n filename (str): The name of the image file (must be in the /home/pi/xgoPictures/ directory).\n x (int, optional): The x-coordinate of the top-left corner where the image will be displayed. Defaults to 0.\n y (int, optional): The y-coordinate of the top-left corner where the image will be displayed. Defaults to 0.

\n", "signature": "(self, filename, x=0, y=0):", "funcdef": "def"}, "xgoedu.XGOEDU.lcd_text": {"fullname": "xgoedu.XGOEDU.lcd_text", "modulename": "xgoedu", "qualname": "XGOEDU.lcd_text", "kind": "function", "doc": "

Displays text on the LCD display.

\n\n

Parameters:\n x (int): The x-coordinate of the top-left corner of the text.\n y (int): The y-coordinate of the top-left corner of the text.\n content (str): The text to display.\n color (str, optional): The color of the text. Defaults to \"WHITE\".\n fontsize (int, optional): The font size of the text. Defaults to 15.

\n", "signature": "(self, x, y, content, color='WHITE', fontsize=15):", "funcdef": "def"}, "xgoedu.XGOEDU.display_text_on_screen": {"fullname": "xgoedu.XGOEDU.display_text_on_screen", "modulename": "xgoedu", "qualname": "XGOEDU.display_text_on_screen", "kind": "function", "doc": "

Displays text on the screen with automatic wrapping and page breaks.

\n\n

Parameters:\n content (str): The text content to display.\n color (str): The color of the text.\n start_x (int, optional): The x-coordinate of the starting position. Defaults to 2.\n start_y (int, optional): The y-coordinate of the starting position. Defaults to 2.\n font_size (int, optional): The font size. Defaults to 20.\n screen_width (int, optional): The width of the screen. Defaults to 320.\n screen_height (int, optional): The height of the screen. Defaults to 240.

\n", "signature": "(\tself,\tcontent,\tcolor,\tstart_x=2,\tstart_y=2,\tfont_size=20,\tscreen_width=320,\tscreen_height=240):", "funcdef": "def"}, "xgoedu.XGOEDU.xgoButton": {"fullname": "xgoedu.XGOEDU.xgoButton", "modulename": "xgoedu", "qualname": "XGOEDU.xgoButton", "kind": "function", "doc": "

Checks the state of a button.

\n\n

Parameters:\n button (str): The button to check ('a', 'b', 'c', or 'd').

\n\n

Returns:\n bool: True if the button is pressed, False otherwise.

\n", "signature": "(self, button):", "funcdef": "def"}, "xgoedu.XGOEDU.xgoSpeaker": {"fullname": "xgoedu.XGOEDU.xgoSpeaker", "modulename": "xgoedu", "qualname": "XGOEDU.xgoSpeaker", "kind": "function", "doc": "

Plays an audio file using mplayer.

\n\n

Parameters:\n filename (str): The name of the audio file (must be in the /home/pi/xgoMusic/ directory).

\n", "signature": "(self, filename):", "funcdef": "def"}, "xgoedu.XGOEDU.xgoVideoAudio": {"fullname": "xgoedu.XGOEDU.xgoVideoAudio", "modulename": "xgoedu", "qualname": "XGOEDU.xgoVideoAudio", "kind": "function", "doc": "

Plays the audio track of a video file using mplayer.

\n\n

Parameters:\n filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).

\n", "signature": "(self, filename):", "funcdef": "def"}, "xgoedu.XGOEDU.xgoVideo": {"fullname": "xgoedu.XGOEDU.xgoVideo", "modulename": "xgoedu", "qualname": "XGOEDU.xgoVideo", "kind": "function", "doc": "

Plays a video file on the LCD display while simultaneously playing its audio track in a separate thread.

\n\n

Parameters:\n filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).

\n", "signature": "(self, filename):", "funcdef": "def"}, "xgoedu.XGOEDU.xgoAudioRecord": {"fullname": "xgoedu.XGOEDU.xgoAudioRecord", "modulename": "xgoedu", "qualname": "XGOEDU.xgoAudioRecord", "kind": "function", "doc": "

Records audio for a specified duration and saves it as a WAV file.

\n\n

Parameters:\n filename (str, optional): The name of the output audio file. Defaults to \"record\".\n seconds (int, optional): The recording duration in seconds. Defaults to 5.

\n", "signature": "(self, filename='record', seconds=5):", "funcdef": "def"}, "xgoedu.XGOEDU.xgoCamera": {"fullname": "xgoedu.XGOEDU.xgoCamera", "modulename": "xgoedu", "qualname": "XGOEDU.xgoCamera", "kind": "function", "doc": "

Turns the camera on or off and displays the camera feed on the LCD.

\n\n

Parameters:\n switch (bool): True to turn the camera on, False to turn it off.

\n", "signature": "(self, switch):", "funcdef": "def"}, "xgoedu.XGOEDU.camera_mode": {"fullname": "xgoedu.XGOEDU.camera_mode", "modulename": "xgoedu", "qualname": "XGOEDU.camera_mode", "kind": "function", "doc": "

Continuously captures and displays the camera feed on the LCD until camera_still is set to False.

\n", "signature": "(self):", "funcdef": "def"}, "xgoedu.XGOEDU.xgoVideoRecord": {"fullname": "xgoedu.XGOEDU.xgoVideoRecord", "modulename": "xgoedu", "qualname": "XGOEDU.xgoVideoRecord", "kind": "function", "doc": "

Records a video for a specified duration, displays it on the LCD, and saves it as an MP4 file.

\n\n

Parameters:\n filename (str, optional): The name of the output video file. Defaults to \"record\".\n seconds (int, optional): The recording duration in seconds. Defaults to 5.

\n", "signature": "(self, filename='record', seconds=5):", "funcdef": "def"}, "xgoedu.XGOEDU.xgoTakePhoto": {"fullname": "xgoedu.XGOEDU.xgoTakePhoto", "modulename": "xgoedu", "qualname": "XGOEDU.xgoTakePhoto", "kind": "function", "doc": "

Takes a photo, displays it on the LCD, and saves it as a JPG file.

\n\n

Parameters:\n filename (str, optional): The name of the output image file. Defaults to \"photo\".

\n", "signature": "(self, filename='photo'):", "funcdef": "def"}, "xgoedu.XGOEDU.camera": {"fullname": "xgoedu.XGOEDU.camera", "modulename": "xgoedu", "qualname": "XGOEDU.camera", "kind": "function", "doc": "

Activates the camera and allows the user to take photos, record videos, or exit using the A, B, and C buttons, respectively.

\n\n

Parameters:\n filename (str, optional): The base filename for photos and videos. Defaults to \"camera\".

\n", "signature": "(self, filename='camera'):", "funcdef": "def"}, "xgoedu.XGOEDU.posenetRecognition": {"fullname": "xgoedu.XGOEDU.posenetRecognition", "modulename": "xgoedu", "qualname": "XGOEDU.posenetRecognition", "kind": "function", "doc": "

Performs skeletal (pose) recognition on an image or video frame and displays the results on the LCD.

\n\n

Parameters:\n target (str, optional): The source of the image data. Can be \"camera\" for live camera feed or a file path for an image. Defaults to \"camera\".

\n\n

Returns:\n list or None: A list of angles between key body joints if successful, or None if no pose is detected.

\n", "signature": "(self, target='camera'):", "funcdef": "def"}, "xgoedu.XGOEDU.gestureRecognition": {"fullname": "xgoedu.XGOEDU.gestureRecognition", "modulename": "xgoedu", "qualname": "XGOEDU.gestureRecognition", "kind": "function", "doc": "

Performs hand gesture recognition on an image or video frame and displays the results on the LCD.

\n\n

Parameters:\n target (str, optional): The source of the image data. Can be \"camera\" for live camera feed or a file path for an image. Defaults to \"camera\".

\n\n

Returns:\n tuple or None: A tuple containing the recognized gesture (str) and the center coordinates of the hand if successful, or None if no gesture is recognized.

\n", "signature": "(self, target='camera'):", "funcdef": "def"}, "xgoedu.XGOEDU.yoloFast": {"fullname": "xgoedu.XGOEDU.yoloFast", "modulename": "xgoedu", "qualname": "XGOEDU.yoloFast", "kind": "function", "doc": "

Performs object detection using YOLO on an image or video frame and displays the results on the LCD.

\n\n

Parameters:\n target (str, optional): The source of the image data. Can be \"camera\" for live camera feed or a file path for an image. Defaults to \"camera\".

\n\n

Returns:\n tuple or None: A tuple containing the detected class (str) and the bounding box coordinates if successful, or None if no object is detected.

\n", "signature": "(self, target='camera'):", "funcdef": "def"}, "xgoedu.XGOEDU.face_detect": {"fullname": "xgoedu.XGOEDU.face_detect", "modulename": "xgoedu", "qualname": "XGOEDU.face_detect", "kind": "function", "doc": "

Performs face detection (including facial landmarks) on an image or video frame and displays the results on the LCD.

\n\n

Parameters:\n target (str, optional): The source of the image data. Can be \"camera\" for live camera feed or a file path for an image. Defaults to \"camera\".

\n\n

Returns:\n list or None: A list of bounding box coordinates [x, y, w, h] of detected faces if successful, or None if no face is detected.

\n", "signature": "(self, target='camera'):", "funcdef": "def"}, "xgoedu.XGOEDU.emotion": {"fullname": "xgoedu.XGOEDU.emotion", "modulename": "xgoedu", "qualname": "XGOEDU.emotion", "kind": "function", "doc": "

Performs emotion recognition on an image or video frame and displays the results on the LCD.

\n\n

Parameters:\n target (str, optional): The source of the image data. Can be \"camera\" for live camera feed or a file path for an image. Defaults to \"camera\".

\n\n

Returns:\n tuple or None: A tuple containing the detected emotion (str) and the bounding box coordinates (x, y) of the face if successful, or None if no face or emotion is detected.

\n", "signature": "(self, target='camera'):", "funcdef": "def"}, "xgoedu.XGOEDU.agesex": {"fullname": "xgoedu.XGOEDU.agesex", "modulename": "xgoedu", "qualname": "XGOEDU.agesex", "kind": "function", "doc": "

Performs age and gender detection on an image or video frame and displays the results on the LCD.

\n\n

Parameters:\n target (str, optional): The source of the image data. Can be \"camera\" for live camera feed or a file path for an image. Defaults to \"camera\".

\n\n

Returns:\n tuple or None: A tuple containing the detected gender (str), age (str), and the bounding box coordinates (x, y) of the face if successful, or None if no face, gender, or age is detected.

\n", "signature": "(self, target='camera'):", "funcdef": "def"}, "xgoedu.XGOEDU.rectangle": {"fullname": "xgoedu.XGOEDU.rectangle", "modulename": "xgoedu", "qualname": "XGOEDU.rectangle", "kind": "function", "doc": "

Draws a rectangle on a given frame.

\n\n

Parameters:\n frame (numpy.ndarray): The image frame to draw on.\n z (tuple): A tuple of four integers (x, y, w, h) representing the top-left corner, width, and height of the rectangle.\n colors (str): The color of the rectangle in hexadecimal format (e.g., \"#FF0000\" for red).\n size (int): The thickness of the rectangle's outline.

\n\n

Returns:\n numpy.ndarray: The frame with the rectangle drawn on it.

\n", "signature": "(self, frame, z, colors, size):", "funcdef": "def"}, "xgoedu.XGOEDU.circle": {"fullname": "xgoedu.XGOEDU.circle", "modulename": "xgoedu", "qualname": "XGOEDU.circle", "kind": "function", "doc": "

Draws a circle on a given frame.

\n\n

Parameters:\n frame (numpy.ndarray): The image frame to draw on.\n xy (tuple): A tuple of two integers (x, y) representing the center coordinates of the circle.\n rad (int): The radius of the circle.\n colors (str): The color of the circle in hexadecimal format.\n tk (int): The thickness of the circle's outline. Use -1 to fill the circle.

\n\n

Returns:\n numpy.ndarray: The frame with the circle drawn on it.

\n", "signature": "(self, frame, xy, rad, colors, tk):", "funcdef": "def"}, "xgoedu.XGOEDU.text": {"fullname": "xgoedu.XGOEDU.text", "modulename": "xgoedu", "qualname": "XGOEDU.text", "kind": "function", "doc": "

Draws text on a given frame.

\n\n

Parameters:\n frame (numpy.ndarray): The image frame to draw on.\n text (str): The text to be drawn.\n xy (tuple): A tuple of two integers (x, y) representing the top-left corner of the text.\n font_size (float): The font size of the text.\n colors (str): The color of the text in hexadecimal format.\n size (int): The thickness of the text.

\n\n

Returns:\n numpy.ndarray: The frame with the text drawn on it.

\n", "signature": "(self, frame, text, xy, font_size, colors, size):", "funcdef": "def"}, "xgoedu.XGOEDU.SpeechRecognition": {"fullname": "xgoedu.XGOEDU.SpeechRecognition", "modulename": "xgoedu", "qualname": "XGOEDU.SpeechRecognition", "kind": "function", "doc": "

Performs speech recognition using the Baidu ASR API.

\n\n

Parameters:\n seconds (int, optional): The duration of the audio recording in seconds. Defaults to 3.

\n\n

Returns:\n str: The recognized text.

\n", "signature": "(self, seconds=3):", "funcdef": "def"}, "xgoedu.XGOEDU.SpeechSynthesis": {"fullname": "xgoedu.XGOEDU.SpeechSynthesis", "modulename": "xgoedu", "qualname": "XGOEDU.SpeechSynthesis", "kind": "function", "doc": "

Performs speech synthesis (text-to-speech) using the Baidu TTS API.

\n\n

Parameters:\n texts (str): The text to be synthesized.

\n", "signature": "(self, texts):", "funcdef": "def"}, "xgoedu.XGOEDU.cv2AddChineseText": {"fullname": "xgoedu.XGOEDU.cv2AddChineseText", "modulename": "xgoedu", "qualname": "XGOEDU.cv2AddChineseText", "kind": "function", "doc": "

Adds Chinese text to an image using PIL, as OpenCV doesn't support Chinese characters directly.

\n\n

Parameters:\n img (numpy.ndarray): The image to add text to.\n text (str): The Chinese text to add.\n position (tuple): The (x, y) coordinates of the top-left corner of the text.\n textColor (tuple, optional): The RGB color of the text. Defaults to (0, 255, 0) (green).\n textSize (int, optional): The font size. Defaults to 30.

\n\n

Returns:\n numpy.ndarray: The image with the Chinese text added.

\n", "signature": "(self, img, text, position, textColor=(0, 255, 0), textSize=30):", "funcdef": "def"}, "xgoedu.XGOEDU.QRRecognition": {"fullname": "xgoedu.XGOEDU.QRRecognition", "modulename": "xgoedu", "qualname": "XGOEDU.QRRecognition", "kind": "function", "doc": "

Performs QR code recognition on an image or video frame and displays the results on the LCD.

\n\n

Parameters:\n target (str, optional): The source of the image data. Can be \"camera\" for live camera feed or a file path for an image. Defaults to \"camera\".

\n\n

Returns:\n list: A list of decoded QR code data strings.

\n", "signature": "(self, target='camera'):", "funcdef": "def"}, "xgoedu.XGOEDU.ColorRecognition": {"fullname": "xgoedu.XGOEDU.ColorRecognition", "modulename": "xgoedu", "qualname": "XGOEDU.ColorRecognition", "kind": "function", "doc": "

Performs color recognition on an image or video frame, identifies the largest contour of the specified color, and displays the results on the LCD.

\n\n

Parameters:\n target (str, optional): The source of the image data. Can be \"camera\" for live camera feed or a file path for an image. Defaults to \"camera\".\n mode (str, optional): The color to recognize ('R' for red, 'G' for green, 'B' for blue, 'Y' for yellow). Defaults to 'R'.

\n\n

Returns:\n tuple: A tuple containing the center coordinates (x, y) and radius of the largest contour of the specified color.

\n", "signature": "(self, target='camera', mode='R'):", "funcdef": "def"}, "xgoedu.XGOEDU.cap_color_mask": {"fullname": "xgoedu.XGOEDU.cap_color_mask", "modulename": "xgoedu", "qualname": "XGOEDU.cap_color_mask", "kind": "function", "doc": "

Captures a color mask from the camera feed based on a specified region and displays it on the LCD.

\n\n

Parameters:\n position (list, optional): The top-left corner coordinates (x, y) of the region to sample for color. Defaults to [160, 100].\n scale (int, optional): The width and height of the square region to sample. Defaults to 25.\n h_error (int, optional): The tolerance for hue variation. Defaults to 20.\n s_limit (list, optional): The lower and upper limits for saturation. Defaults to [90, 255].\n v_limit (list, optional): The lower and upper limits for value (brightness). Defaults to [90, 230].

\n\n

Returns:\n list: A list containing two lists, representing the lower and upper bounds of the captured color mask in HSV format.

\n", "signature": "(\tself,\tposition=None,\tscale=25,\th_error=20,\ts_limit=[90, 255],\tv_limit=[90, 230]):", "funcdef": "def"}, "xgoedu.XGOEDU.filter_img": {"fullname": "xgoedu.XGOEDU.filter_img", "modulename": "xgoedu", "qualname": "XGOEDU.filter_img", "kind": "function", "doc": "

Applies a color mask to an image frame, isolating the specified color.

\n\n

Parameters:\n frame (numpy.ndarray): The input image frame.\n color (list or str): The color to filter. Can be a list of two lists representing the lower and upper bounds of the color mask in HSV format, or a string representing a predefined color ('red', 'green', 'blue', 'yellow').

\n\n

Returns:\n numpy.ndarray: The image frame with the color mask applied.

\n", "signature": "(self, frame, color):", "funcdef": "def"}, "xgoedu.XGOEDU.BallRecognition": {"fullname": "xgoedu.XGOEDU.BallRecognition", "modulename": "xgoedu", "qualname": "XGOEDU.BallRecognition", "kind": "function", "doc": "

Detects and tracks a ball of a specific color in an image or video frame using Hough Circle Transform.

\n\n

Parameters:\n color_mask (list): A list of two lists, representing the lower and upper bounds of the ball's color in HSV format.\n target (str, optional): The source of the image data. Can be \"camera\" for live camera feed or a file path for an image. Defaults to \"camera\".\n p1 (int, optional): The higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller). Defaults to 36.\n p2 (int, optional): The accumulator threshold for the circle centers at the detection stage. Defaults to 15.\n minR (int, optional): The minimum circle radius. Defaults to 6.\n maxR (int, optional): The maximum circle radius. Defaults to 35.

\n\n

Returns:\n tuple: A tuple containing the x-coordinate, y-coordinate, and radius of the detected ball.

\n", "signature": "(self, color_mask, target='camera', p1=36, p2=15, minR=6, maxR=35):", "funcdef": "def"}, "xgoedu.DemoError": {"fullname": "xgoedu.DemoError", "modulename": "xgoedu", "qualname": "DemoError", "kind": "class", "doc": "

A custom exception class for errors related to the Baidu AI API.

\n", "bases": "builtins.Exception"}, "xgoedu.hands": {"fullname": "xgoedu.hands", "modulename": "xgoedu", "qualname": "hands", "kind": "class", "doc": "

A class for hand detection and landmark estimation using MediaPipe.

\n"}, "xgoedu.hands.__init__": {"fullname": "xgoedu.hands.__init__", "modulename": "xgoedu", "qualname": "hands.__init__", "kind": "function", "doc": "

Initializes the hands object.

\n\n

Parameters:\n model_complexity (int): Complexity of the hand landmark model: 0 or 1.\n max_num_hands (int): Maximum number of hands to detect.\n min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for hand detection to be considered successful.\n min_tracking_confidence (float): Minimum confidence value ([0.0, 1.0]) for the hand landmarks to be considered tracked successfully.

\n", "signature": "(\tmodel_complexity,\tmax_num_hands,\tmin_detection_confidence,\tmin_tracking_confidence)"}, "xgoedu.hands.model_complexity": {"fullname": "xgoedu.hands.model_complexity", "modulename": "xgoedu", "qualname": "hands.model_complexity", "kind": "variable", "doc": "

\n"}, "xgoedu.hands.max_num_hands": {"fullname": "xgoedu.hands.max_num_hands", "modulename": "xgoedu", "qualname": "hands.max_num_hands", "kind": "variable", "doc": "

\n"}, "xgoedu.hands.min_detection_confidence": {"fullname": "xgoedu.hands.min_detection_confidence", "modulename": "xgoedu", "qualname": "hands.min_detection_confidence", "kind": "variable", "doc": "

\n"}, "xgoedu.hands.min_tracking_confidence": {"fullname": "xgoedu.hands.min_tracking_confidence", "modulename": "xgoedu", "qualname": "hands.min_tracking_confidence", "kind": "variable", "doc": "

\n"}, "xgoedu.hands.mp_hands": {"fullname": "xgoedu.hands.mp_hands", "modulename": "xgoedu", "qualname": "hands.mp_hands", "kind": "variable", "doc": "

\n"}, "xgoedu.hands.hands": {"fullname": "xgoedu.hands.hands", "modulename": "xgoedu", "qualname": "hands.hands", "kind": "variable", "doc": "

\n"}, "xgoedu.hands.run": {"fullname": "xgoedu.hands.run", "modulename": "xgoedu", "qualname": "hands.run", "kind": "function", "doc": "

Processes an image and returns hand landmarks and other related information.

\n\n

Parameters:\n cv_img (numpy.ndarray): The input image.

\n\n

Returns:\n list: A list of dictionaries, where each dictionary contains information about a detected hand, including center coordinates, bounding rectangle, landmark coordinates, hand angles, and right/left classification.

\n", "signature": "(self, cv_img):", "funcdef": "def"}, "xgoedu.hands.calc_palm_moment": {"fullname": "xgoedu.hands.calc_palm_moment", "modulename": "xgoedu", "qualname": "hands.calc_palm_moment", "kind": "function", "doc": "

Calculates the moment (center) of the palm.

\n\n

Parameters:\n image (numpy.ndarray): The input image.\n landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.

\n\n

Returns:\n tuple: The (x, y) coordinates of the palm's center.

\n", "signature": "(self, image, landmarks):", "funcdef": "def"}, "xgoedu.hands.calc_bounding_rect": {"fullname": "xgoedu.hands.calc_bounding_rect", "modulename": "xgoedu", "qualname": "hands.calc_bounding_rect", "kind": "function", "doc": "

Calculates the bounding rectangle of the hand.

\n\n

Parameters:\n image (numpy.ndarray): The input image.\n landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.

\n\n

Returns:\n list: A list [x, y, w, h] representing the bounding rectangle.

\n", "signature": "(self, image, landmarks):", "funcdef": "def"}, "xgoedu.hands.dlandmarks": {"fullname": "xgoedu.hands.dlandmarks", "modulename": "xgoedu", "qualname": "hands.dlandmarks", "kind": "function", "doc": "

Extracts and returns the coordinates of hand landmarks.

\n\n

Parameters:\n image (numpy.ndarray): The input image.\n landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.\n handedness (mediapipe.framework.formats.classification_pb2.ClassificationList): Handedness information.

\n\n

Returns:\n tuple: A tuple containing a list of landmark coordinates and the handedness label ('Right' or 'Left').

\n", "signature": "(self, image, landmarks, handedness):", "funcdef": "def"}, "xgoedu.hands.vector_2d_angle": {"fullname": "xgoedu.hands.vector_2d_angle", "modulename": "xgoedu", "qualname": "hands.vector_2d_angle", "kind": "function", "doc": "

Calculates the angle between two 2D vectors.

\n\n

Parameters:\n v1 (tuple): The first vector (x, y).\n v2 (tuple): The second vector (x, y).

\n\n

Returns:\n float: The angle between the two vectors in degrees.

\n", "signature": "(self, v1, v2):", "funcdef": "def"}, "xgoedu.hands.hand_angle": {"fullname": "xgoedu.hands.hand_angle", "modulename": "xgoedu", "qualname": "hands.hand_angle", "kind": "function", "doc": "

Calculates the angles of the fingers.

\n\n

Parameters:\n hand_ (list): A list of hand landmark coordinates.

\n\n

Returns:\n list: A list of finger angles (thumb, index, middle, ring, pinky).

\n", "signature": "(self, hand_):", "funcdef": "def"}, "xgoedu.yoloXgo": {"fullname": "xgoedu.yoloXgo", "modulename": "xgoedu", "qualname": "yoloXgo", "kind": "class", "doc": "

A class for object detection using YOLO (You Only Look Once) models with ONNX Runtime.

\n"}, "xgoedu.yoloXgo.__init__": {"fullname": "xgoedu.yoloXgo.__init__", "modulename": "xgoedu", "qualname": "yoloXgo.__init__", "kind": "function", "doc": "

Initializes the yoloXgo object.

\n\n

Parameters:\n model (str): The path to the ONNX model file.\n classes (list): A list of class names.\n inputwh (list): A list [width, height] representing the input size of the model.\n thresh (float): The confidence threshold for object detection.

\n", "signature": "(model, classes, inputwh, thresh)"}, "xgoedu.yoloXgo.session": {"fullname": "xgoedu.yoloXgo.session", "modulename": "xgoedu", "qualname": "yoloXgo.session", "kind": "variable", "doc": "

\n"}, "xgoedu.yoloXgo.input_width": {"fullname": "xgoedu.yoloXgo.input_width", "modulename": "xgoedu", "qualname": "yoloXgo.input_width", "kind": "variable", "doc": "

\n"}, "xgoedu.yoloXgo.input_height": {"fullname": "xgoedu.yoloXgo.input_height", "modulename": "xgoedu", "qualname": "yoloXgo.input_height", "kind": "variable", "doc": "

\n"}, "xgoedu.yoloXgo.thresh": {"fullname": "xgoedu.yoloXgo.thresh", "modulename": "xgoedu", "qualname": "yoloXgo.thresh", "kind": "variable", "doc": "

\n"}, "xgoedu.yoloXgo.classes": {"fullname": "xgoedu.yoloXgo.classes", "modulename": "xgoedu", "qualname": "yoloXgo.classes", "kind": "variable", "doc": "

\n"}, "xgoedu.yoloXgo.sigmoid": {"fullname": "xgoedu.yoloXgo.sigmoid", "modulename": "xgoedu", "qualname": "yoloXgo.sigmoid", "kind": "function", "doc": "

Computes the sigmoid function.

\n\n

Parameters:\n x (float or numpy.ndarray): The input value.

\n\n

Returns:\n float or numpy.ndarray: The sigmoid of the input.

\n", "signature": "(self, x):", "funcdef": "def"}, "xgoedu.yoloXgo.tanh": {"fullname": "xgoedu.yoloXgo.tanh", "modulename": "xgoedu", "qualname": "yoloXgo.tanh", "kind": "function", "doc": "

Computes the hyperbolic tangent function.

\n\n

Parameters:\n x (float or numpy.ndarray): The input value.

\n\n

Returns:\n float or numpy.ndarray: The hyperbolic tangent of the input.

\n", "signature": "(self, x):", "funcdef": "def"}, "xgoedu.yoloXgo.preprocess": {"fullname": "xgoedu.yoloXgo.preprocess", "modulename": "xgoedu", "qualname": "yoloXgo.preprocess", "kind": "function", "doc": "

Preprocesses the input image for the YOLO model.

\n\n

Parameters:\n src_img (numpy.ndarray): The input image.\n size (list): A list [width, height] representing the target size.

\n\n

Returns:\n numpy.ndarray: The preprocessed image data.

\n", "signature": "(self, src_img, size):", "funcdef": "def"}, "xgoedu.yoloXgo.nms": {"fullname": "xgoedu.yoloXgo.nms", "modulename": "xgoedu", "qualname": "yoloXgo.nms", "kind": "function", "doc": "

Performs Non-Maximum Suppression (NMS) to filter out overlapping bounding boxes.

\n\n

Parameters:\n dets (numpy.ndarray): An array of bounding boxes with shape (N, 6), where N is the number of boxes, and each box is represented as [x1, y1, x2, y2, score, class_index].\n thresh (float, optional): The IoU (Intersection over Union) threshold for suppression. Defaults to 0.45.

\n\n

Returns:\n list: A list of filtered bounding boxes, each represented as [x1, y1, x2, y2, score, class_index].

\n", "signature": "(self, dets, thresh=0.45):", "funcdef": "def"}, "xgoedu.yoloXgo.run": {"fullname": "xgoedu.yoloXgo.run", "modulename": "xgoedu", "qualname": "yoloXgo.run", "kind": "function", "doc": "

Runs object detection on an image using the YOLO model.

\n\n

Parameters:\n img (numpy.ndarray): The input image.

\n\n

Returns:\n list or bool: A list of dictionaries, where each dictionary represents a detected object and contains the class name, confidence score, and bounding box coordinates. Returns False if no objects are detected.

\n", "signature": "(self, img):", "funcdef": "def"}, "xgoedu.face_detection": {"fullname": "xgoedu.face_detection", "modulename": "xgoedu", "qualname": "face_detection", "kind": "class", "doc": "

A class for face detection using MediaPipe.

\n"}, "xgoedu.face_detection.__init__": {"fullname": "xgoedu.face_detection.__init__", "modulename": "xgoedu", "qualname": "face_detection.__init__", "kind": "function", "doc": "

Initializes the face_detection object.

\n\n

Parameters:\n min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for face detection to be considered successful.

\n", "signature": "(min_detection_confidence)"}, "xgoedu.face_detection.model_selection": {"fullname": "xgoedu.face_detection.model_selection", "modulename": "xgoedu", "qualname": "face_detection.model_selection", "kind": "variable", "doc": "

\n"}, "xgoedu.face_detection.min_detection_confidence": {"fullname": "xgoedu.face_detection.min_detection_confidence", "modulename": "xgoedu", "qualname": "face_detection.min_detection_confidence", "kind": "variable", "doc": "

\n"}, "xgoedu.face_detection.mp_face_detection": {"fullname": "xgoedu.face_detection.mp_face_detection", "modulename": "xgoedu", "qualname": "face_detection.mp_face_detection", "kind": "variable", "doc": "

\n"}, "xgoedu.face_detection.face_detection": {"fullname": "xgoedu.face_detection.face_detection", "modulename": "xgoedu", "qualname": "face_detection.face_detection", "kind": "variable", "doc": "

\n"}, "xgoedu.face_detection.run": {"fullname": "xgoedu.face_detection.run", "modulename": "xgoedu", "qualname": "face_detection.run", "kind": "function", "doc": "

Performs face detection on an image.

\n\n

Parameters:\n cv_img (numpy.ndarray): The input image.

\n\n

Returns:\n list: A list of dictionaries, where each dictionary contains information about a detected face, including bounding box coordinates and landmark coordinates.

\n", "signature": "(self, cv_img):", "funcdef": "def"}, "xgoedu.face_detection.draw_detection": {"fullname": "xgoedu.face_detection.draw_detection", "modulename": "xgoedu", "qualname": "face_detection.draw_detection", "kind": "function", "doc": "

Extracts face detection information and returns it as a dictionary.

\n\n

Parameters:\n image (numpy.ndarray): The input image.\n detection (mediapipe.framework.formats.detection_pb2.Detection): Face detection result.

\n\n

Returns:\n dict: A dictionary containing face detection information, including label ID, confidence score, bounding box coordinates, and landmark coordinates.

\n", "signature": "(self, image, detection):", "funcdef": "def"}}, "docInfo": {"xgoedu": {"qualname": 0, "fullname": 1, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 8}, "xgoedu.camera_still": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 1, "signature": 0, "bases": 0, "doc": 4}, "xgoedu.getFaceBox": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 28, "bases": 0, "doc": 111}, "xgoedu.hand_pos": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 55}, "xgoedu.color": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 90}, "xgoedu.XGOEDU": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 25}, "xgoedu.XGOEDU.__init__": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 4, "bases": 0, "doc": 17}, "xgoedu.XGOEDU.display": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.splash": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.draw": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.font": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.key1": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.key2": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.key3": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.key4": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.cap": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.hand": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.yolo": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.face": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.face_classifier": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.classifier": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.agesexmark": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.camera_still": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.XGOEDU.open_camera": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 12}, "xgoedu.XGOEDU.fetch_token": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 41}, "xgoedu.XGOEDU.lcd_line": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 55, "bases": 0, "doc": 79}, "xgoedu.XGOEDU.lcd_circle": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 65, "bases": 0, "doc": 117}, "xgoedu.XGOEDU.lcd_round": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 43, "bases": 0, "doc": 76}, "xgoedu.XGOEDU.lcd_rectangle": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 65, "bases": 0, "doc": 98}, "xgoedu.XGOEDU.lcd_clear": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 7}, "xgoedu.XGOEDU.lcd_picture": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 36, "bases": 0, "doc": 71}, "xgoedu.XGOEDU.lcd_text": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 50, "bases": 0, "doc": 73}, "xgoedu.XGOEDU.display_text_on_screen": {"qualname": 5, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 84, "bases": 0, "doc": 101}, "xgoedu.XGOEDU.xgoButton": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 38}, "xgoedu.XGOEDU.xgoSpeaker": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 28}, "xgoedu.XGOEDU.xgoVideoAudio": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 32}, "xgoedu.XGOEDU.xgoVideo": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 40}, "xgoedu.XGOEDU.xgoAudioRecord": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 35, "bases": 0, "doc": 46}, "xgoedu.XGOEDU.xgoCamera": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 35}, "xgoedu.XGOEDU.camera_mode": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 20}, "xgoedu.XGOEDU.xgoVideoRecord": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 35, "bases": 0, "doc": 52}, "xgoedu.XGOEDU.xgoTakePhoto": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 25, "bases": 0, "doc": 36}, "xgoedu.XGOEDU.camera": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 25, "bases": 0, "doc": 43}, "xgoedu.XGOEDU.posenetRecognition": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 25, "bases": 0, "doc": 75}, "xgoedu.XGOEDU.gestureRecognition": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 25, "bases": 0, "doc": 81}, "xgoedu.XGOEDU.yoloFast": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 25, "bases": 0, "doc": 80}, "xgoedu.XGOEDU.face_detect": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 25, "bases": 0, "doc": 82}, "xgoedu.XGOEDU.emotion": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 25, "bases": 0, "doc": 85}, "xgoedu.XGOEDU.agesex": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 25, "bases": 0, "doc": 90}, "xgoedu.XGOEDU.rectangle": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 31, "bases": 0, "doc": 87}, "xgoedu.XGOEDU.circle": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 36, "bases": 0, "doc": 90}, "xgoedu.XGOEDU.text": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 42, "bases": 0, "doc": 92}, "xgoedu.XGOEDU.SpeechRecognition": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 38}, "xgoedu.XGOEDU.SpeechSynthesis": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 26}, "xgoedu.XGOEDU.cv2AddChineseText": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 64, "bases": 0, "doc": 95}, "xgoedu.XGOEDU.QRRecognition": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 25, "bases": 0, "doc": 64}, "xgoedu.XGOEDU.ColorRecognition": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 39, "bases": 0, "doc": 104}, "xgoedu.XGOEDU.cap_color_mask": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 90, "bases": 0, "doc": 135}, "xgoedu.XGOEDU.filter_img": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 81}, "xgoedu.XGOEDU.BallRecognition": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 71, "bases": 0, "doc": 160}, "xgoedu.DemoError": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 0, "bases": 2, "doc": 15}, "xgoedu.hands": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 13}, "xgoedu.hands.__init__": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 35, "bases": 0, "doc": 75}, "xgoedu.hands.model_complexity": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.hands.max_num_hands": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.hands.min_detection_confidence": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.hands.min_tracking_confidence": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.hands.mp_hands": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.hands.hands": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.hands.run": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 17, "bases": 0, "doc": 56}, "xgoedu.hands.calc_palm_moment": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 45}, "xgoedu.hands.calc_bounding_rect": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 46}, "xgoedu.hands.dlandmarks": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 26, "bases": 0, "doc": 62}, "xgoedu.hands.vector_2d_angle": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 43}, "xgoedu.hands.hand_angle": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 17, "bases": 0, "doc": 37}, "xgoedu.yoloXgo": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 18}, "xgoedu.yoloXgo.__init__": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 24, "bases": 0, "doc": 52}, "xgoedu.yoloXgo.session": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.yoloXgo.input_width": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.yoloXgo.input_height": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.yoloXgo.thresh": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.yoloXgo.classes": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.yoloXgo.sigmoid": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 33}, "xgoedu.yoloXgo.tanh": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 35}, "xgoedu.yoloXgo.preprocess": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 22, "bases": 0, "doc": 44}, "xgoedu.yoloXgo.nms": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 27, "bases": 0, "doc": 88}, "xgoedu.yoloXgo.run": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 60}, "xgoedu.face_detection": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 10}, "xgoedu.face_detection.__init__": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 31}, "xgoedu.face_detection.model_selection": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.face_detection.min_detection_confidence": {"qualname": 5, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.face_detection.mp_face_detection": {"qualname": 5, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.face_detection.face_detection": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgoedu.face_detection.run": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 17, "bases": 0, "doc": 46}, "xgoedu.face_detection.draw_detection": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 57}}, "length": 95, "save": true}, "index": {"qualname": {"root": {"2": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}}, "docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 4, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {"xgoedu.camera_still": {"tf": 1}, "xgoedu.XGOEDU.camera_still": {"tf": 1}, "xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 5}}}}, "p": {"docs": {"xgoedu.XGOEDU.cap": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}, "l": {"docs": {}, "df": 0, "c": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}}, "df": 2}}}, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.hands.model_complexity": {"tf": 1}}, "df": 1}}}}}}}}, "n": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hands.min_detection_confidence": {"tf": 1}, "xgoedu.hands.min_tracking_confidence": {"tf": 1}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1}}, "df": 3}}}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.face_classifier": {"tf": 1}, "xgoedu.XGOEDU.classifier": {"tf": 1}}, "df": 2}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.classes": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.lcd_clear": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}}, "df": 2}}}}}, "v": {"2": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}}, "docs": {}, "df": 0}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.camera_still": {"tf": 1}, "xgoedu.XGOEDU.camera_still": {"tf": 1}}, "df": 2}}}}, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.splash": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}, "s": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}, "c": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.yoloXgo.session": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.face_detection.model_selection": {"tf": 1}}, "df": 1}}}}}}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.yoloXgo.sigmoid": {"tf": 1}}, "df": 1}}}}}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "x": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}}}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.gestureRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}}}}}, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.hand": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 3, "s": {"docs": {"xgoedu.hands": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.hands.model_complexity": {"tf": 1}, "xgoedu.hands.max_num_hands": {"tf": 1.4142135623730951}, "xgoedu.hands.min_detection_confidence": {"tf": 1}, "xgoedu.hands.min_tracking_confidence": {"tf": 1}, "xgoedu.hands.mp_hands": {"tf": 1.4142135623730951}, "xgoedu.hands.hands": {"tf": 1.4142135623730951}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 14}}}}, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.yoloXgo.input_height": {"tf": 1}}, "df": 1}}}}}}, "p": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}}}}, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}}, "df": 1}}}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 1}}}}}}}}}}, "x": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "u": {"docs": {"xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.XGOEDU.display": {"tf": 1}, "xgoedu.XGOEDU.splash": {"tf": 1}, "xgoedu.XGOEDU.draw": {"tf": 1}, "xgoedu.XGOEDU.font": {"tf": 1}, "xgoedu.XGOEDU.key1": {"tf": 1}, "xgoedu.XGOEDU.key2": {"tf": 1}, "xgoedu.XGOEDU.key3": {"tf": 1}, "xgoedu.XGOEDU.key4": {"tf": 1}, "xgoedu.XGOEDU.cap": {"tf": 1}, "xgoedu.XGOEDU.hand": {"tf": 1}, "xgoedu.XGOEDU.yolo": {"tf": 1}, "xgoedu.XGOEDU.face": {"tf": 1}, "xgoedu.XGOEDU.face_classifier": {"tf": 1}, "xgoedu.XGOEDU.classifier": {"tf": 1}, "xgoedu.XGOEDU.agesexmark": {"tf": 1}, "xgoedu.XGOEDU.camera_still": {"tf": 1}, "xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.fetch_token": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_clear": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 55}}}, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}}, "df": 1}}}}}}, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}}, "df": 1}}}}}}}, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}}, "df": 1}}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}}, "df": 1}}}}}}}}}}}, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}}, "df": 1}}}}}}}}}}}, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {"xgoedu.XGOEDU.xgoCamera": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}}, "df": 1}}}}}}}}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 4}}, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.yoloXgo.input_width": {"tf": 1}, "xgoedu.yoloXgo.input_height": {"tf": 1}}, "df": 2}}}}, "m": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 1}}}, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.display": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 2}}}}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgoedu.XGOEDU.draw": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 2}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.face_detect": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.min_detection_confidence": {"tf": 1}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}, "xgoedu.face_detection.model_selection": {"tf": 1}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1.4142135623730951}, "xgoedu.face_detection.mp_face_detection": {"tf": 1.4142135623730951}, "xgoedu.face_detection.face_detection": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1.4142135623730951}}, "df": 9}}}}}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.DemoError": {"tf": 1}}, "df": 1}}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hands.dlandmarks": {"tf": 1}}, "df": 1}}}}}}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.font": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.face": {"tf": 1}, "xgoedu.XGOEDU.face_classifier": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}, "xgoedu.face_detection.model_selection": {"tf": 1}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1}, "xgoedu.face_detection.mp_face_detection": {"tf": 1.4142135623730951}, "xgoedu.face_detection.face_detection": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 11}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 1}}}}}}, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "y": {"1": {"docs": {"xgoedu.XGOEDU.key1": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgoedu.XGOEDU.key2": {"tf": 1}}, "df": 1}, "3": {"docs": {"xgoedu.XGOEDU.key3": {"tf": 1}}, "df": 1}, "4": {"docs": {"xgoedu.XGOEDU.key4": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}}}, "y": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.yolo": {"tf": 1}}, "df": 1, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.yoloFast": {"tf": 1}}, "df": 1}}}}, "x": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.session": {"tf": 1}, "xgoedu.yoloXgo.input_width": {"tf": 1}, "xgoedu.yoloXgo.input_height": {"tf": 1}, "xgoedu.yoloXgo.thresh": {"tf": 1}, "xgoedu.yoloXgo.classes": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 12}}}}}}}, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {"xgoedu.XGOEDU.agesex": {"tf": 1}}, "df": 1, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.XGOEDU.agesexmark": {"tf": 1}}, "df": 1}}}}}}}}}, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 2}}}}}, "o": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.open_camera": {"tf": 1}}, "df": 1}}}, "n": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}}, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 3}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.hands.min_tracking_confidence": {"tf": 1}}, "df": 1}}}}}}}, "h": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.thresh": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.tanh": {"tf": 1}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_clear": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}}, "df": 7}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.lcd_round": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.calc_bounding_rect": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}}, "df": 2}}}}}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 3}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.camera_mode": {"tf": 1}}, "df": 1, "l": {"docs": {"xgoedu.hands.model_complexity": {"tf": 1}, "xgoedu.face_detection.model_selection": {"tf": 1}}, "df": 2}}}, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}, "x": {"docs": {"xgoedu.hands.max_num_hands": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.min_detection_confidence": {"tf": 1}, "xgoedu.hands.min_tracking_confidence": {"tf": 1}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1}}, "df": 3}}, "p": {"docs": {"xgoedu.hands.mp_hands": {"tf": 1}, "xgoedu.face_detection.mp_face_detection": {"tf": 1}}, "df": 2}}, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.emotion": {"tf": 1}}, "df": 1}}}}}}}, "q": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.QRRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}, "b": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.hands.calc_bounding_rect": {"tf": 1}}, "df": 1}}}}}}}}, "n": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.hands.max_num_hands": {"tf": 1}}, "df": 1}}, "m": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}}}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.input_width": {"tf": 1}}, "df": 1}}}}}}}, "fullname": {"root": {"2": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}}, "docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 4, "x": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "u": {"docs": {"xgoedu": {"tf": 1}, "xgoedu.camera_still": {"tf": 1}, "xgoedu.getFaceBox": {"tf": 1}, "xgoedu.hand_pos": {"tf": 1}, "xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.__init__": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.splash": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.draw": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.font": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.key1": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.key2": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.key3": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.key4": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.hand": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yolo": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_classifier": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.classifier": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesexmark": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.camera_still": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.open_camera": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.fetch_token": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_round": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_clear": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoButton": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.camera_mode": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.camera": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.filter_img": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}, "xgoedu.DemoError": {"tf": 1}, "xgoedu.hands": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.hands.model_complexity": {"tf": 1}, "xgoedu.hands.max_num_hands": {"tf": 1}, "xgoedu.hands.min_detection_confidence": {"tf": 1}, "xgoedu.hands.min_tracking_confidence": {"tf": 1}, "xgoedu.hands.mp_hands": {"tf": 1}, "xgoedu.hands.hands": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}, "xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.session": {"tf": 1}, "xgoedu.yoloXgo.input_width": {"tf": 1}, "xgoedu.yoloXgo.input_height": {"tf": 1}, "xgoedu.yoloXgo.thresh": {"tf": 1}, "xgoedu.yoloXgo.classes": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}, "xgoedu.face_detection.model_selection": {"tf": 1}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1}, "xgoedu.face_detection.mp_face_detection": {"tf": 1}, "xgoedu.face_detection.face_detection": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 95}}}, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}}, "df": 1}}}}}}, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}}, "df": 1}}}}}}}, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}}, "df": 1}}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}}, "df": 1}}}}}}}}}}}, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}}, "df": 1}}}}}}}}}}}, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {"xgoedu.XGOEDU.xgoCamera": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}}, "df": 1}}}}}}}}}}}}, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {"xgoedu.camera_still": {"tf": 1}, "xgoedu.XGOEDU.camera_still": {"tf": 1}, "xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 5}}}}, "p": {"docs": {"xgoedu.XGOEDU.cap": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}, "l": {"docs": {}, "df": 0, "c": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}}, "df": 2}}}, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.hands.model_complexity": {"tf": 1}}, "df": 1}}}}}}}}, "n": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hands.min_detection_confidence": {"tf": 1}, "xgoedu.hands.min_tracking_confidence": {"tf": 1}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1}}, "df": 3}}}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.face_classifier": {"tf": 1}, "xgoedu.XGOEDU.classifier": {"tf": 1}}, "df": 2}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.classes": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.lcd_clear": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}}, "df": 2}}}}}, "v": {"2": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}}, "docs": {}, "df": 0}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.camera_still": {"tf": 1}, "xgoedu.XGOEDU.camera_still": {"tf": 1}}, "df": 2}}}}, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.splash": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}, "s": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}, "c": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.yoloXgo.session": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.face_detection.model_selection": {"tf": 1}}, "df": 1}}}}}}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.yoloXgo.sigmoid": {"tf": 1}}, "df": 1}}}}}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "x": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}}}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.gestureRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}}}}}, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.hand": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 3, "s": {"docs": {"xgoedu.hands": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.hands.model_complexity": {"tf": 1}, "xgoedu.hands.max_num_hands": {"tf": 1.4142135623730951}, "xgoedu.hands.min_detection_confidence": {"tf": 1}, "xgoedu.hands.min_tracking_confidence": {"tf": 1}, "xgoedu.hands.mp_hands": {"tf": 1.4142135623730951}, "xgoedu.hands.hands": {"tf": 1.4142135623730951}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 14}}}}, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.yoloXgo.input_height": {"tf": 1}}, "df": 1}}}}}}, "p": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}}}}, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}}, "df": 1}}}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 1}}}}}}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 4}}, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.yoloXgo.input_width": {"tf": 1}, "xgoedu.yoloXgo.input_height": {"tf": 1}}, "df": 2}}}}, "m": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 1}}}, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.display": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 2}}}}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgoedu.XGOEDU.draw": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 2}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.face_detect": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.min_detection_confidence": {"tf": 1}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}, "xgoedu.face_detection.model_selection": {"tf": 1}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1.4142135623730951}, "xgoedu.face_detection.mp_face_detection": {"tf": 1.4142135623730951}, "xgoedu.face_detection.face_detection": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1.4142135623730951}}, "df": 9}}}}}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.DemoError": {"tf": 1}}, "df": 1}}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hands.dlandmarks": {"tf": 1}}, "df": 1}}}}}}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.font": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.face": {"tf": 1}, "xgoedu.XGOEDU.face_classifier": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}, "xgoedu.face_detection.model_selection": {"tf": 1}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1}, "xgoedu.face_detection.mp_face_detection": {"tf": 1.4142135623730951}, "xgoedu.face_detection.face_detection": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 11}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 1}}}}}}, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "y": {"1": {"docs": {"xgoedu.XGOEDU.key1": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgoedu.XGOEDU.key2": {"tf": 1}}, "df": 1}, "3": {"docs": {"xgoedu.XGOEDU.key3": {"tf": 1}}, "df": 1}, "4": {"docs": {"xgoedu.XGOEDU.key4": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}}}, "y": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.yolo": {"tf": 1}}, "df": 1, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.yoloFast": {"tf": 1}}, "df": 1}}}}, "x": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.session": {"tf": 1}, "xgoedu.yoloXgo.input_width": {"tf": 1}, "xgoedu.yoloXgo.input_height": {"tf": 1}, "xgoedu.yoloXgo.thresh": {"tf": 1}, "xgoedu.yoloXgo.classes": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 12}}}}}}}, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {"xgoedu.XGOEDU.agesex": {"tf": 1}}, "df": 1, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.XGOEDU.agesexmark": {"tf": 1}}, "df": 1}}}}}}}}}, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 2}}}}}, "o": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.open_camera": {"tf": 1}}, "df": 1}}}, "n": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}}, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 3}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.hands.min_tracking_confidence": {"tf": 1}}, "df": 1}}}}}}}, "h": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.thresh": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.tanh": {"tf": 1}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_clear": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}}, "df": 7}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.lcd_round": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.calc_bounding_rect": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}}, "df": 2}}}}}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 3}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.camera_mode": {"tf": 1}}, "df": 1, "l": {"docs": {"xgoedu.hands.model_complexity": {"tf": 1}, "xgoedu.face_detection.model_selection": {"tf": 1}}, "df": 2}}}, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}, "x": {"docs": {"xgoedu.hands.max_num_hands": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.min_detection_confidence": {"tf": 1}, "xgoedu.hands.min_tracking_confidence": {"tf": 1}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1}}, "df": 3}}, "p": {"docs": {"xgoedu.hands.mp_hands": {"tf": 1}, "xgoedu.face_detection.mp_face_detection": {"tf": 1}}, "df": 2}}, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.emotion": {"tf": 1}}, "df": 1}}}}}}}, "q": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.QRRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}, "b": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}}}}}}}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.hands.calc_bounding_rect": {"tf": 1}}, "df": 1}}}}}}}}, "n": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.hands.max_num_hands": {"tf": 1}}, "df": 1}}, "m": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}}}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.input_width": {"tf": 1}}, "df": 1}}}}}}}, "annotation": {"root": {"docs": {}, "df": 0}}, "default_value": {"root": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.camera_still": {"tf": 1}}, "df": 1}}}}}}}, "signature": {"root": {"0": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 4}, "1": {"5": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 2}, "docs": {}, "df": 0}, "2": {"0": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}, "3": {"0": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "4": {"0": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "5": {"5": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}, "docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}, "docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}}, "df": 5}, "3": {"0": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}, "2": {"0": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "5": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "6": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "9": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.camera": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 2}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}}, "df": 17}, "docs": {"xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 1}, "4": {"5": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "5": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}}, "df": 2}, "6": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "7": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}, "9": {"0": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"xgoedu.getFaceBox": {"tf": 4.69041575982343}, "xgoedu.hand_pos": {"tf": 3.1622776601683795}, "xgoedu.color": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.__init__": {"tf": 2}, "xgoedu.XGOEDU.open_camera": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.fetch_token": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.lcd_line": {"tf": 6.6332495807108}, "xgoedu.XGOEDU.lcd_circle": {"tf": 7.211102550927978}, "xgoedu.XGOEDU.lcd_round": {"tf": 5.830951894845301}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 7.211102550927978}, "xgoedu.XGOEDU.lcd_clear": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.lcd_picture": {"tf": 5.477225575051661}, "xgoedu.XGOEDU.lcd_text": {"tf": 6.324555320336759}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 8.12403840463596}, "xgoedu.XGOEDU.xgoButton": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.xgoVideo": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 5.291502622129181}, "xgoedu.XGOEDU.xgoCamera": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.camera_mode": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 5.291502622129181}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 4.47213595499958}, "xgoedu.XGOEDU.camera": {"tf": 4.47213595499958}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 4.47213595499958}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 4.47213595499958}, "xgoedu.XGOEDU.yoloFast": {"tf": 4.47213595499958}, "xgoedu.XGOEDU.face_detect": {"tf": 4.47213595499958}, "xgoedu.XGOEDU.emotion": {"tf": 4.47213595499958}, "xgoedu.XGOEDU.agesex": {"tf": 4.47213595499958}, "xgoedu.XGOEDU.rectangle": {"tf": 5.0990195135927845}, "xgoedu.XGOEDU.circle": {"tf": 5.477225575051661}, "xgoedu.XGOEDU.text": {"tf": 5.830951894845301}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 4.242640687119285}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 7.3484692283495345}, "xgoedu.XGOEDU.QRRecognition": {"tf": 4.47213595499958}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 5.477225575051661}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 8.602325267042627}, "xgoedu.XGOEDU.filter_img": {"tf": 4.242640687119285}, "xgoedu.XGOEDU.BallRecognition": {"tf": 7.483314773547883}, "xgoedu.hands.__init__": {"tf": 4.898979485566356}, "xgoedu.hands.run": {"tf": 3.7416573867739413}, "xgoedu.hands.calc_palm_moment": {"tf": 4.242640687119285}, "xgoedu.hands.calc_bounding_rect": {"tf": 4.242640687119285}, "xgoedu.hands.dlandmarks": {"tf": 4.69041575982343}, "xgoedu.hands.vector_2d_angle": {"tf": 4.242640687119285}, "xgoedu.hands.hand_angle": {"tf": 3.872983346207417}, "xgoedu.yoloXgo.__init__": {"tf": 4.47213595499958}, "xgoedu.yoloXgo.sigmoid": {"tf": 3.7416573867739413}, "xgoedu.yoloXgo.tanh": {"tf": 3.7416573867739413}, "xgoedu.yoloXgo.preprocess": {"tf": 4.242640687119285}, "xgoedu.yoloXgo.nms": {"tf": 4.69041575982343}, "xgoedu.yoloXgo.run": {"tf": 3.7416573867739413}, "xgoedu.face_detection.__init__": {"tf": 2.8284271247461903}, "xgoedu.face_detection.run": {"tf": 3.7416573867739413}, "xgoedu.face_detection.draw_detection": {"tf": 4.242640687119285}}, "df": 57, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}}}, "u": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1}}}, "f": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 5}}}}, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}}, "df": 1}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 8}}}}}}}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 2, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}}, "df": 1}}}}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "f": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 2}}}}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 2}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 7, "s": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 3}}}}, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1}}}}}}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.lcd_round": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 10}}}}}, "v": {"docs": {"xgoedu.hands.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 2}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 1}}}}}}}, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 2, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}}}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 9}}}}}, "k": {"docs": {"xgoedu.XGOEDU.circle": {"tf": 1}}, "df": 1}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 2, "s": {"docs": {"xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}}}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1}}}}}}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"0": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1}}, "df": 1}, "1": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1}}, "df": 1}, "docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1}}}}}, "v": {"1": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}, "docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.color": {"tf": 1}}, "df": 1}}}}}, "s": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "f": {"docs": {"xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.fetch_token": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_clear": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 50}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 3}}}}}}, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 4}}}, "c": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.xgoCamera": {"tf": 1}}, "df": 1}}}}}, "r": {"docs": {}, "df": 0, "c": {"docs": {"xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 1}}}, "x": {"1": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}}, "df": 3}, "2": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}}, "df": 3}, "docs": {"xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}}, "df": 6, "y": {"docs": {"xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 2}}, "y": {"1": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}}, "df": 3}, "2": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}}, "df": 3}, "docs": {"xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 4}, "w": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}}, "df": 4}}}}, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 5}}}}}, "r": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.circle": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.lcd_round": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}}, "df": 2}}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}}, "df": 1}}}}}}}, "h": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.hands.hand_angle": {"tf": 1}}, "df": 1, "s": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1}, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hands.dlandmarks": {"tf": 1}}, "df": 1}}}}}}}}}}, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}}, "df": 1}}}}}}, "p": {"1": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}}, "df": 1}}}}, "o": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}}}}}}}}, "z": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}}, "df": 1}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 5}, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 4}}}}, "n": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 1}}}}}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 1, "l": {"docs": {"xgoedu.hands.__init__": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 2}}}}, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}, "x": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1, "r": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 2, "r": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}}, "df": 3}}}}}}}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.__init__": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 3}}}}}}, "s": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}}}}, "bases": {"root": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.DemoError": {"tf": 1}}, "df": 1}}}}}}}}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.DemoError": {"tf": 1}}, "df": 1}}}}}}}}}}}, "doc": {"root": {"0": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.4142135623730951}, "xgoedu.hands.__init__": {"tf": 2.6457513110645907}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1.7320508075688772}}, "df": 7}, "1": {"0": {"0": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "5": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 2}, "6": {"0": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.7320508075688772}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 4}, "2": {"0": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}, "3": {"0": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "4": {"0": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "5": {"5": {"docs": {"xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 3}, "docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}, "docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}}, "df": 6, "d": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}}, "3": {"0": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}, "2": {"0": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "5": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "6": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 2}, "4": {"5": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}, "docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1}, "5": {"docs": {"xgoedu.hand_pos": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}}, "df": 3}, "6": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 2}, "7": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}, "9": {"0": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"xgoedu": {"tf": 1.4142135623730951}, "xgoedu.camera_still": {"tf": 1.4142135623730951}, "xgoedu.getFaceBox": {"tf": 3.7416573867739413}, "xgoedu.hand_pos": {"tf": 3.1622776601683795}, "xgoedu.color": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.__init__": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.display": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.splash": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.draw": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.font": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.key1": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.key2": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.key3": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.key4": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.cap": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.hand": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.yolo": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.face": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.face_classifier": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.classifier": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.agesexmark": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.camera_still": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.open_camera": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.fetch_token": {"tf": 3}, "xgoedu.XGOEDU.lcd_line": {"tf": 3.4641016151377544}, "xgoedu.XGOEDU.lcd_circle": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.lcd_round": {"tf": 3.3166247903554}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 3.605551275463989}, "xgoedu.XGOEDU.lcd_clear": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.lcd_picture": {"tf": 3}, "xgoedu.XGOEDU.lcd_text": {"tf": 3.3166247903554}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 3.605551275463989}, "xgoedu.XGOEDU.xgoButton": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.xgoVideo": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 2.8284271247461903}, "xgoedu.XGOEDU.xgoCamera": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.camera_mode": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 2.8284271247461903}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.camera": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.yoloFast": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.face_detect": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.emotion": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.agesex": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.rectangle": {"tf": 3.605551275463989}, "xgoedu.XGOEDU.circle": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.text": {"tf": 3.872983346207417}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.QRRecognition": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 3.3166247903554}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.filter_img": {"tf": 3.3166247903554}, "xgoedu.XGOEDU.BallRecognition": {"tf": 3.872983346207417}, "xgoedu.DemoError": {"tf": 1.7320508075688772}, "xgoedu.hands": {"tf": 1.7320508075688772}, "xgoedu.hands.__init__": {"tf": 3.1622776601683795}, "xgoedu.hands.model_complexity": {"tf": 1.7320508075688772}, "xgoedu.hands.max_num_hands": {"tf": 1.7320508075688772}, "xgoedu.hands.min_detection_confidence": {"tf": 1.7320508075688772}, "xgoedu.hands.min_tracking_confidence": {"tf": 1.7320508075688772}, "xgoedu.hands.mp_hands": {"tf": 1.7320508075688772}, "xgoedu.hands.hands": {"tf": 1.7320508075688772}, "xgoedu.hands.run": {"tf": 3.1622776601683795}, "xgoedu.hands.calc_palm_moment": {"tf": 3.3166247903554}, "xgoedu.hands.calc_bounding_rect": {"tf": 3.3166247903554}, "xgoedu.hands.dlandmarks": {"tf": 3.4641016151377544}, "xgoedu.hands.vector_2d_angle": {"tf": 3.3166247903554}, "xgoedu.hands.hand_angle": {"tf": 3.1622776601683795}, "xgoedu.yoloXgo": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.__init__": {"tf": 3.1622776601683795}, "xgoedu.yoloXgo.session": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.input_width": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.input_height": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.thresh": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.classes": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.sigmoid": {"tf": 3.1622776601683795}, "xgoedu.yoloXgo.tanh": {"tf": 3.1622776601683795}, "xgoedu.yoloXgo.preprocess": {"tf": 3.3166247903554}, "xgoedu.yoloXgo.nms": {"tf": 3.3166247903554}, "xgoedu.yoloXgo.run": {"tf": 3.1622776601683795}, "xgoedu.face_detection": {"tf": 1.7320508075688772}, "xgoedu.face_detection.__init__": {"tf": 2.6457513110645907}, "xgoedu.face_detection.model_selection": {"tf": 1.7320508075688772}, "xgoedu.face_detection.min_detection_confidence": {"tf": 1.7320508075688772}, "xgoedu.face_detection.mp_face_detection": {"tf": 1.7320508075688772}, "xgoedu.face_detection.face_detection": {"tf": 1.7320508075688772}, "xgoedu.face_detection.run": {"tf": 3.1622776601683795}, "xgoedu.face_detection.draw_detection": {"tf": 3.3166247903554}}, "df": 95, "x": {"1": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}}, "df": 5}, "2": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}}, "df": 5}, "docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_round": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.vector_2d_angle": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}}, "df": 22, "g": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu": {"tf": 1}, "xgoedu.XGOEDU": {"tf": 1}}, "df": 2, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "u": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}}, "df": 1}}}}}, "y": {"docs": {"xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 2}}, "g": {"docs": {"xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 3, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu": {"tf": 1}}, "df": 1}}}}}}}, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 3}}}}, "i": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 4}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hand_pos": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.7320508075688772}}, "df": 2, "s": {"docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1}}}}}}, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.agesex": {"tf": 1.7320508075688772}}, "df": 1}}}}}, "o": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1}}}, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}}, "df": 1}}}}, "p": {"1": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu": {"tf": 1}}, "df": 1}}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}}, "df": 1, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}}, "df": 1}}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 1}}}}}}}, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 1}, "d": {"docs": {"xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 1}}}}}}}}}}, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hands.run": {"tf": 1}}, "df": 1}}}}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.hand_pos": {"tf": 1}, "xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 52}}}}}}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}}, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 10}}, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1.4142135623730951}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 2}}, "s": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}}, "df": 1}}, "l": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}}, "y": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 3}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 1}}}}}}, "o": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 2}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}}, "df": 2}}}, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 3}}}}}, "e": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}}, "df": 1}}}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1.4142135623730951}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 12}}}}}}}, "b": {"2": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 4}, "docs": {}, "df": 0}}, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.getFaceBox": {"tf": 1.7320508075688772}, "xgoedu.hand_pos": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.filter_img": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}, "xgoedu.hands.run": {"tf": 1.4142135623730951}, "xgoedu.hands.calc_bounding_rect": {"tf": 1.4142135623730951}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 2}, "xgoedu.yoloXgo.__init__": {"tf": 2}, "xgoedu.yoloXgo.preprocess": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1.4142135623730951}}, "df": 17, "s": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 3}}}, "n": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1.7320508075688772}}, "df": 1}}, "v": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 9}}, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "c": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_clear": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 23}}, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}}, "df": 9}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.hands": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.hands.hand_angle": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 9, "s": {"docs": {"xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1.4142135623730951}, "xgoedu.hands.calc_bounding_rect": {"tf": 1.4142135623730951}, "xgoedu.hands.dlandmarks": {"tf": 1.7320508075688772}}, "df": 6}}}}}}}, "r": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 2}}}}, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}}, "df": 3}}}, "o": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.yoloXgo": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {"xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}}, "df": 2, "d": {"docs": {}, "df": 0, "u": {"docs": {"xgoedu": {"tf": 1}}, "df": 1, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU": {"tf": 1}}, "df": 1}}}}}}}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 5}}}, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}}, "df": 2}}}}}, "x": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 1}}, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.DemoError": {"tf": 1}}, "df": 1}}}}}}}, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 2}}}}}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.emotion": {"tf": 1.7320508075688772}}, "df": 1}}}}}}, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1, "s": {"docs": {"xgoedu.DemoError": {"tf": 1}}, "df": 1}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands": {"tf": 1}}, "df": 1}}}}}}}}}}, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.camera_still": {"tf": 1}, "xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.draw_detection": {"tf": 1.7320508075688772}}, "df": 9, "s": {"docs": {"xgoedu.getFaceBox": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.face_detect": {"tf": 1}}, "df": 2}}, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.face_detect": {"tf": 1}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 4}}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.getFaceBox": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 2}, "xgoedu.XGOEDU.circle": {"tf": 2}, "xgoedu.XGOEDU.text": {"tf": 2}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 2}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 14, "o": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}}}}}}}}, "w": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 4}}}}}}}, "o": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.tanh": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 9}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 2.449489742783178}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 2}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.7320508075688772}, "xgoedu.DemoError": {"tf": 1}, "xgoedu.hands": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 25, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 6, "s": {"docs": {"xgoedu.color": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 5}}}}}, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 4, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}}, "df": 1}}}}}}, "u": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.hand_pos": {"tf": 1.4142135623730951}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 2, "s": {"docs": {"xgoedu.hands.hand_angle": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.circle": {"tf": 1}}, "df": 2}, "e": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 17, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1.4142135623730951}}, "df": 8}}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 2, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}}}}, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}}}}, "f": {"0": {"0": {"0": {"0": {"docs": {"xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}}, "df": 2}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 12}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}}, "df": 2, "s": {"docs": {"xgoedu.XGOEDU": {"tf": 1}}, "df": 1}}}}}}}}}, "d": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.camera_still": {"tf": 1}, "xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1.7320508075688772}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 2.449489742783178}}, "df": 15}}}, "s": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 2}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 10}}, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}}, "s": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}, "e": {"docs": {}, "df": 0, "p": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.BallRecognition": {"tf": 2.23606797749979}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 25}}}}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}}}}, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 2}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.QRRecognition": {"tf": 1}}, "df": 1}}}}}}, "n": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 3, "n": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}}, "df": 4}, "s": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 7}}}}, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_clear": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 11, "s": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 16}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 4}}}, "l": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}}}, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 3}}}, "y": {"docs": {"xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1.4142135623730951}}, "df": 4}}}}}}}}}, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 3}}}}}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 10}}}, "o": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}, "xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 16, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.tanh": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.preprocess": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 14, "w": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 1}}}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}}, "df": 3}}}, "t": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.lcd_circle": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.lcd_round": {"tf": 2}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 2}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}}, "df": 17, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU": {"tf": 1}}, "df": 1}}}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}}}}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 3}}}}}}, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 5}}}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 4}}}}}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.run": {"tf": 1.4142135623730951}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1.4142135623730951}}, "df": 4}}}}}}}}}}, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 2}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.face_detect": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.emotion": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.agesex": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.filter_img": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.7320508075688772}, "xgoedu.hands.run": {"tf": 1.4142135623730951}, "xgoedu.hands.calc_palm_moment": {"tf": 1.4142135623730951}, "xgoedu.hands.calc_bounding_rect": {"tf": 1.4142135623730951}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.preprocess": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.draw_detection": {"tf": 1.4142135623730951}}, "df": 25}}}, "g": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 5}}, "s": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.hand_pos": {"tf": 1}, "xgoedu.color": {"tf": 2}, "xgoedu.XGOEDU.fetch_token": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}}, "df": 14, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 1}}}}}}}}, "f": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.color": {"tf": 2}, "xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.fetch_token": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 12}, "t": {"docs": {"xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 11, "s": {"docs": {"xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 1}}, "d": {"docs": {"xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 1, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 1}}}}}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}, "a": {"docs": {"xgoedu.getFaceBox": {"tf": 2.6457513110645907}, "xgoedu.hand_pos": {"tf": 1}, "xgoedu.color": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.xgoButton": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.circle": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.filter_img": {"tf": 2}, "xgoedu.XGOEDU.BallRecognition": {"tf": 2.23606797749979}, "xgoedu.DemoError": {"tf": 1}, "xgoedu.hands": {"tf": 1}, "xgoedu.hands.run": {"tf": 1.4142135623730951}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.hands.hand_angle": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.draw_detection": {"tf": 1.4142135623730951}}, "df": 43, "n": {"docs": {"xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.fetch_token": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 21, "d": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.7320508075688772}, "xgoedu.hands": {"tf": 1}, "xgoedu.hands.run": {"tf": 1.7320508075688772}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1.4142135623730951}}, "df": 31}, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"0": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1}}, "df": 1}, "1": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1}}, "df": 1}, "docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.hands.vector_2d_angle": {"tf": 1.4142135623730951}}, "df": 3, "s": {"docs": {"xgoedu.hand_pos": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1.4142135623730951}}, "df": 4}}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}}}, "c": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1}}, "df": 1}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}, "e": {"docs": {"xgoedu.yoloXgo.run": {"tf": 1}}, "df": 1}}, "s": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 7, "r": {"docs": {"xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 1}}, "i": {"docs": {"xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.fetch_token": {"tf": 1}, "xgoedu.DemoError": {"tf": 1}}, "df": 3}, "t": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}}, "df": 1}}}}}}}}}, "l": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.open_camera": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 1}}}}}, "c": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1.4142135623730951}}, "df": 1}}}, "u": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}}}}}}, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 1}}}}}}}}, "p": {"docs": {}, "df": 0, "i": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}, "xgoedu.DemoError": {"tf": 1}}, "df": 4}, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 1}, "d": {"docs": {"xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 1}}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}}}}}}}, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoSpeaker": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 5}}}}, "g": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.agesex": {"tf": 1.7320508075688772}}, "df": 1}}, "d": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.4142135623730951}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 2}}}}}, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands": {"tf": 1}, "xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection": {"tf": 1}}, "df": 14}}}, "e": {"docs": {"xgoedu.XGOEDU.circle": {"tf": 1}}, "df": 1, "r": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 1}}}, "p": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}}, "df": 1, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 3}}}}, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.camera_mode": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}}}, "t": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}}, "df": 1}}}}, "c": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 2, "s": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1}}}}, "n": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}}}}, "u": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}}, "df": 2}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.getFaceBox": {"tf": 2.23606797749979}, "xgoedu.hand_pos": {"tf": 1}, "xgoedu.color": {"tf": 2.449489742783178}, "xgoedu.XGOEDU": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.__init__": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.fetch_token": {"tf": 2}, "xgoedu.XGOEDU.lcd_line": {"tf": 3.605551275463989}, "xgoedu.XGOEDU.lcd_circle": {"tf": 4.358898943540674}, "xgoedu.XGOEDU.lcd_round": {"tf": 3.7416573867739413}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 3.872983346207417}, "xgoedu.XGOEDU.lcd_clear": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.lcd_text": {"tf": 3.4641016151377544}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 3.605551275463989}, "xgoedu.XGOEDU.xgoButton": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 2}, "xgoedu.XGOEDU.xgoVideo": {"tf": 2}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.xgoCamera": {"tf": 2}, "xgoedu.XGOEDU.camera_mode": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 2}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.camera": {"tf": 2}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 2}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.yoloFast": {"tf": 2.449489742783178}, "xgoedu.XGOEDU.face_detect": {"tf": 2}, "xgoedu.XGOEDU.emotion": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.agesex": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.rectangle": {"tf": 3}, "xgoedu.XGOEDU.circle": {"tf": 3.4641016151377544}, "xgoedu.XGOEDU.text": {"tf": 3.4641016151377544}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 2}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.QRRecognition": {"tf": 2}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 3.3166247903554}, "xgoedu.XGOEDU.filter_img": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.BallRecognition": {"tf": 3.872983346207417}, "xgoedu.DemoError": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.7320508075688772}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 2.23606797749979}, "xgoedu.hands.calc_bounding_rect": {"tf": 2}, "xgoedu.hands.dlandmarks": {"tf": 1.7320508075688772}, "xgoedu.hands.vector_2d_angle": {"tf": 2.23606797749979}, "xgoedu.hands.hand_angle": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.__init__": {"tf": 2.449489742783178}, "xgoedu.yoloXgo.sigmoid": {"tf": 2}, "xgoedu.yoloXgo.tanh": {"tf": 2}, "xgoedu.yoloXgo.preprocess": {"tf": 2.23606797749979}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1.7320508075688772}, "xgoedu.face_detection.__init__": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 59}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 2, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 4}}}}}, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 1}}}}, "u": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "b": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 2}}}, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 3}}}}}}}}, "o": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 2.449489742783178}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 2.449489742783178}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.filter_img": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 2.449489742783178}, "xgoedu.DemoError": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 38, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1.4142135623730951}}, "df": 1}}}, "p": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 8}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}}}}}}}, "u": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.color": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.hands.vector_2d_angle": {"tf": 1.4142135623730951}}, "df": 15}}}, "r": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.xgoCamera": {"tf": 1.4142135623730951}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.xgoCamera": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 2.449489742783178}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.text": {"tf": 2.8284271247461903}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 2.6457513110645907}}, "df": 6, "s": {"docs": {"xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}}}}}, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 10}}}}, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.yoloXgo.tanh": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "w": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}, "xgoedu.hands.vector_2d_angle": {"tf": 1.4142135623730951}}, "df": 6}, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}, "k": {"docs": {"xgoedu.XGOEDU.circle": {"tf": 1}}, "df": 1}, "t": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}}, "df": 1}}}, "n": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}}, "df": 1, "e": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}}}, "t": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}}, "df": 1, "w": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}}}}}, "u": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1, "p": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.filter_img": {"tf": 1.4142135623730951}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.tanh": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.preprocess": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 17}}, "b": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.hands.__init__": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 2}}}}}, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.filter_img": {"tf": 1.4142135623730951}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.tanh": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.preprocess": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 17}}}}}}, "o": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 8, "n": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1, "e": {"docs": {"xgoedu.hand_pos": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}}, "df": 8}}, "t": {"docs": {"xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 2}, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}}, "df": 3}}}}}}}}}}}}}}}}}}}}}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 8, "s": {"docs": {"xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 1}}}}, "m": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}, "c": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 2, "v": {"2": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}, "docs": {"xgoedu.hands.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 2}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "f": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 2}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1.4142135623730951}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 6}}}}}}}, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 3}}}}}}}, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 10}}}, "s": {"docs": {"xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 3}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU": {"tf": 1}}, "df": 1}}}}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}}, "df": 2}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.camera_mode": {"tf": 1}}, "df": 1}}}}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}}, "df": 1}}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.color": {"tf": 1}}, "df": 1, "s": {"docs": {"xgoedu.color": {"tf": 1}}, "df": 1}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.color": {"tf": 1}}, "df": 1}}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.color": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_round": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 2}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.filter_img": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.7320508075688772}}, "df": 15, "s": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 3}}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}}, "df": 2}}, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 2}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 2}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 8}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 2}, "xgoedu.XGOEDU.lcd_circle": {"tf": 2}, "xgoedu.XGOEDU.lcd_round": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 2}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}}, "df": 8, "s": {"docs": {"xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.hands.run": {"tf": 1.4142135623730951}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.hands.hand_angle": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.draw_detection": {"tf": 1.4142135623730951}}, "df": 16}}}}}}}}}, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.hands.__init__": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}}, "df": 2}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.DemoError": {"tf": 1}, "xgoedu.hands": {"tf": 1}, "xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection": {"tf": 1}}, "df": 9, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}}, "df": 2, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.dlandmarks": {"tf": 1}}, "df": 1}}}}}}}}}}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.lcd_clear": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {"xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.camera_mode": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.camera": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.face_detect": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.emotion": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.agesex": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.7320508075688772}}, "df": 15}}}}, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}, "d": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}}}}}, "n": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 10, "n": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}, "l": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 4}}}}}}}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 2.449489742783178}, "xgoedu.XGOEDU.circle": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.BallRecognition": {"tf": 2}}, "df": 4, "/": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "c": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.lcd_round": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1.4142135623730951}}, "df": 6, "s": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 2}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}}}}}}, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.DemoError": {"tf": 1}}, "df": 1}}}}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 1, "l": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.__init__": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 5, "s": {"docs": {"xgoedu.yoloXgo": {"tf": 1}}, "df": 1}}}}, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.calc_palm_moment": {"tf": 1}}, "df": 1}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 2, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 4}}}}, "r": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}, "d": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 2}}}}}, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 4}}}, "p": {"4": {"docs": {"xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}}, "df": 2}}}}}}, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.filter_img": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 3}}, "x": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1, "r": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 3}}}}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hands": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.face_detection": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 6}}}}}}}}}, "o": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.BallRecognition": {"tf": 2.23606797749979}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 25}}}}}}, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.open_camera": {"tf": 1}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.open_camera": {"tf": 1}}, "df": 1}, "c": {"docs": {}, "df": 0, "v": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}}}, "f": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 2.449489742783178}, "xgoedu.XGOEDU.lcd_circle": {"tf": 3.1622776601683795}, "xgoedu.XGOEDU.lcd_round": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 2.6457513110645907}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.lcd_text": {"tf": 2.449489742783178}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 2}, "xgoedu.XGOEDU.circle": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.text": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 2}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.filter_img": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 2.449489742783178}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1.4142135623730951}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.hands.hand_angle": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.__init__": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 44, "f": {"docs": {"xgoedu.XGOEDU.xgoCamera": {"tf": 1.4142135623730951}}, "df": 1}}, "n": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.camera_mode": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.circle": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.text": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 27, "e": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}, "l": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.yoloXgo": {"tf": 1}}, "df": 1}}, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.yoloXgo": {"tf": 1}}, "df": 1}}, "n": {"docs": {}, "df": 0, "x": {"docs": {"xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 2}}}, "r": {"docs": {"xgoedu.hand_pos": {"tf": 1.4142135623730951}, "xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.fetch_token": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 2}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 2}, "xgoedu.XGOEDU.yoloFast": {"tf": 2}, "xgoedu.XGOEDU.face_detect": {"tf": 2}, "xgoedu.XGOEDU.emotion": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.agesex": {"tf": 2.23606797749979}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.filter_img": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.4142135623730951}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.tanh": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 22}, "k": {"docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1}, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}}, "df": 4}}}, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}}, "df": 4}}}}}}, "b": {"docs": {}, "df": 0, "j": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 7, "s": {"docs": {"xgoedu.yoloXgo.run": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.hands.run": {"tf": 1}}, "df": 1, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}}, "df": 1}}}}}}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}}}}}}}}}, "b": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 3, "e": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 20, "t": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.hands.vector_2d_angle": {"tf": 1.4142135623730951}}, "df": 3}}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.getFaceBox": {"tf": 2}, "xgoedu.XGOEDU.lcd_circle": {"tf": 2}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.nms": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 12}}}, "s": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 3}}}}, "x": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 2}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 10, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.getFaceBox": {"tf": 1.7320508075688772}, "xgoedu.yoloXgo.nms": {"tf": 2}}, "df": 2}}}, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}}, "df": 2}}}}, "o": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoCamera": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 3}}, "d": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}}, "df": 1}}}, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.getFaceBox": {"tf": 1}}, "df": 1}}}}}, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 1, "d": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 2}}}, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "u": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}, "xgoedu.DemoError": {"tf": 1}}, "df": 4}}}, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1.7320508075688772}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}}}}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 2}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 1}}}}}}, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 2}}}}, "r": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}}, "df": 1, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.hand_pos": {"tf": 1}, "xgoedu.color": {"tf": 1}, "xgoedu.XGOEDU.fetch_token": {"tf": 1}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.run": {"tf": 1.4142135623730951}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.hands.vector_2d_angle": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1.4142135623730951}, "xgoedu.face_detection.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1.4142135623730951}}, "df": 34}}}}}, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}}, "df": 2}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 9}}}, "s": {"docs": {"xgoedu.yoloXgo.run": {"tf": 1}}, "df": 1}}}}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 1, "s": {"docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1}, "d": {"docs": {"xgoedu.hand_pos": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 3}}}, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 6}}}}}}}, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 3, "s": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}}, "df": 2}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}}, "df": 3}}}}}}, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_rectangle": {"tf": 2}, "xgoedu.XGOEDU.rectangle": {"tf": 2.23606797749979}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1.4142135623730951}}, "df": 4}}}}}}}, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1}}, "df": 1}}}}}}}}}, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}}, "df": 8}}}}}, "d": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 3}, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.7320508075688772}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.DemoError": {"tf": 1}, "xgoedu.hands.run": {"tf": 1}}, "df": 2}}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.hands.hand_angle": {"tf": 1}}, "df": 2}}, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.hands.dlandmarks": {"tf": 1}}, "df": 3, "/": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.hands.run": {"tf": 1}}, "df": 1}}}}}}}}}, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1}}, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU": {"tf": 1}}, "df": 1}}}}, "g": {"docs": {}, "df": 0, "b": {"docs": {"xgoedu.color": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 2}}, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}}, "d": {"docs": {"xgoedu.XGOEDU.circle": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.lcd_round": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1.7320508075688772}}, "df": 4}}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.yoloXgo": {"tf": 1}}, "df": 1}}}}, "s": {"docs": {"xgoedu.yoloXgo.run": {"tf": 1}}, "df": 1}}}}, "w": {"docs": {"xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}}, "df": 3, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.getFaceBox": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 10}}, "d": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_round": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 9}}}, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}}, "df": 1}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.hands.run": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.run": {"tf": 1}}, "df": 6}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1}}, "df": 4}}, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1}}, "df": 1}}}}}}}, "a": {"docs": {}, "df": 0, "v": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}}, "df": 1}}}, "y": {"1": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}}, "df": 5}, "2": {"docs": {"xgoedu.getFaceBox": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}}, "df": 5}, "docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_round": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}, "xgoedu.hands.vector_2d_angle": {"tf": 1.4142135623730951}}, "df": 20, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.yoloXgo": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}, "xgoedu.yoloXgo.run": {"tf": 1}}, "df": 4, "x": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 1}}}}}, "u": {"docs": {"xgoedu.yoloXgo": {"tf": 1}}, "df": 1}}, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {"xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 2}}}}}}, "h": {"docs": {"xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1}}, "df": 4, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.hand_pos": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.hands": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.7320508075688772}, "xgoedu.hands.run": {"tf": 1.7320508075688772}, "xgoedu.hands.calc_palm_moment": {"tf": 1}, "xgoedu.hands.calc_bounding_rect": {"tf": 1.4142135623730951}, "xgoedu.hands.dlandmarks": {"tf": 1.4142135623730951}, "xgoedu.hands.hand_angle": {"tf": 1.4142135623730951}}, "df": 9, "s": {"docs": {"xgoedu.hands.__init__": {"tf": 1.7320508075688772}}, "df": 1}, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.hands.dlandmarks": {"tf": 1.7320508075688772}}, "df": 1}}}}}}}}}, "e": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.color": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1}}, "df": 4}}}}}}}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 5}}}}}, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "/": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "/": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.lcd_picture": {"tf": 1}}, "df": 1}}}}}}}}, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {"xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}}, "df": 1}}}}}, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 2}}}}}}}}}}}}}}}, "u": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}, "u": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}, "s": {"docs": {}, "df": 0, "v": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 3}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}}, "y": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {"xgoedu.yoloXgo.tanh": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}, "s": {"docs": {"xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.open_camera": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.hands.calc_palm_moment": {"tf": 1}}, "df": 9, "t": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.hand_pos": {"tf": 1}, "xgoedu.color": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.fetch_token": {"tf": 1}, "xgoedu.XGOEDU.lcd_line": {"tf": 1}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.lcd_round": {"tf": 1}, "xgoedu.XGOEDU.lcd_rectangle": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_picture": {"tf": 1}, "xgoedu.XGOEDU.lcd_text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoButton": {"tf": 1}, "xgoedu.XGOEDU.xgoSpeaker": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1}, "xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}, "xgoedu.XGOEDU.camera": {"tf": 1}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.yoloFast": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.agesex": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.circle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.filter_img": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}}, "df": 35, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.color": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 2, "s": {"docs": {"xgoedu.XGOEDU.QRRecognition": {"tf": 1}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1}}, "df": 1}}}}}}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.hand_pos": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}}, "df": 1, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.lcd_line": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.lcd_circle": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}}, "df": 3}}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.xgoButton": {"tf": 1}}, "df": 1}}, "g": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.camera_mode": {"tf": 1}}, "df": 1}}}}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.color": {"tf": 1.4142135623730951}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.camera_mode": {"tf": 1}}, "df": 1, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.__init__": {"tf": 1}}, "df": 1}}}}}, "c": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1, "s": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.SpeechRecognition": {"tf": 1.4142135623730951}}, "df": 3}}}}}, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 1}}}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1}}, "df": 1}}, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.run": {"tf": 1}, "xgoedu.face_detection.draw_detection": {"tf": 1}}, "df": 3}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.display_text_on_screen": {"tf": 2.23606797749979}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.lcd_text": {"tf": 1}, "xgoedu.XGOEDU.display_text_on_screen": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.rectangle": {"tf": 1}, "xgoedu.XGOEDU.text": {"tf": 1.7320508075688772}, "xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}, "xgoedu.yoloXgo.__init__": {"tf": 1}, "xgoedu.yoloXgo.preprocess": {"tf": 1.4142135623730951}}, "df": 7}}, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.xgoVideo": {"tf": 1}}, "df": 1}}}}}}}}}}}}, "g": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.yoloXgo.sigmoid": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.XGOEDU.filter_img": {"tf": 1}}, "df": 5}}, "c": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.SpeechRecognition": {"tf": 1}, "xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1.4142135623730951}}, "df": 2}}}}}, "a": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.xgoAudioRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1}, "xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}}, "df": 3}}}, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1.4142135623730951}}, "df": 1}}}}, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}}}}}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgoedu.XGOEDU.xgoCamera": {"tf": 1}}, "df": 1}}}}}, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}}, "df": 1}}}}}}}, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 9}}}}}, "u": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 8, "l": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.hands.__init__": {"tf": 1}}, "df": 1}}}}}}}}}}, "p": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgoedu.XGOEDU.cv2AddChineseText": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.yoloXgo.nms": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}, "y": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}}, "df": 1}, "z": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgoedu.XGOEDU.SpeechSynthesis": {"tf": 1}}, "df": 1}}}}}}}}}}, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}}}}, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 1}}}}}}, "r": {"docs": {}, "df": 0, "c": {"docs": {"xgoedu.yoloXgo.preprocess": {"tf": 1}}, "df": 1}}}, "v": {"1": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1}}, "df": 1}, "docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"xgoedu.color": {"tf": 2}, "xgoedu.XGOEDU.cap_color_mask": {"tf": 1}, "xgoedu.hands.__init__": {"tf": 1.4142135623730951}, "xgoedu.yoloXgo.sigmoid": {"tf": 1}, "xgoedu.yoloXgo.tanh": {"tf": 1}, "xgoedu.face_detection.__init__": {"tf": 1}}, "df": 6}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU": {"tf": 1}, "xgoedu.XGOEDU.__init__": {"tf": 1}}, "df": 2}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgoedu.XGOEDU.cap_color_mask": {"tf": 1}}, "df": 1}}}}}}}}, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "o": {"docs": {"xgoedu.XGOEDU.xgoVideoAudio": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideo": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.xgoVideoRecord": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}, "xgoedu.XGOEDU.gestureRecognition": {"tf": 1}, "xgoedu.XGOEDU.yoloFast": {"tf": 1}, "xgoedu.XGOEDU.face_detect": {"tf": 1}, "xgoedu.XGOEDU.emotion": {"tf": 1}, "xgoedu.XGOEDU.agesex": {"tf": 1}, "xgoedu.XGOEDU.QRRecognition": {"tf": 1}, "xgoedu.XGOEDU.ColorRecognition": {"tf": 1}, "xgoedu.XGOEDU.BallRecognition": {"tf": 1}}, "df": 12, "s": {"docs": {"xgoedu.XGOEDU.camera": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1.4142135623730951}}, "df": 1, "s": {"docs": {"xgoedu.hands.vector_2d_angle": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "y": {"docs": {"xgoedu.XGOEDU.fetch_token": {"tf": 1.4142135623730951}, "xgoedu.XGOEDU.posenetRecognition": {"tf": 1}}, "df": 2}}}, "j": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "g": {"docs": {"xgoedu.XGOEDU.xgoTakePhoto": {"tf": 1}}, "df": 1}}, "o": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"xgoedu.XGOEDU.posenetRecognition": {"tf": 1}}, "df": 1}}}}}}, "z": {"docs": {"xgoedu.XGOEDU.rectangle": {"tf": 1}}, "df": 1}, "q": {"docs": {}, "df": 0, "r": {"docs": {"xgoedu.XGOEDU.QRRecognition": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "pipeline": ["trimmer"], "_isPrebuiltIndex": true}; + + // mirrored in build-search-index.js (part 1) + // Also split on html tags. this is a cheap heuristic, but good enough. + elasticlunr.tokenizer.setSeperator(/[\s\-.;&_'"=,()]+|<[^>]*>/); + + let searchIndex; + if (docs._isPrebuiltIndex) { + console.info("using precompiled search index"); + searchIndex = elasticlunr.Index.load(docs); + } else { + console.time("building search index"); + // mirrored in build-search-index.js (part 2) + searchIndex = elasticlunr(function () { + this.pipeline.remove(elasticlunr.stemmer); + this.pipeline.remove(elasticlunr.stopWordFilter); + this.addField("qualname"); + this.addField("fullname"); + this.addField("annotation"); + this.addField("default_value"); + this.addField("signature"); + this.addField("bases"); + this.addField("doc"); + this.setRef("fullname"); + }); + for (let doc of docs) { + searchIndex.addDoc(doc); + } + console.timeEnd("building search index"); + } + + return (term) => searchIndex.search(term, { + fields: { + qualname: {boost: 4}, + fullname: {boost: 2}, + annotation: {boost: 2}, + default_value: {boost: 2}, + signature: {boost: 2}, + bases: {boost: 2}, + doc: {boost: 1}, + }, + expand: true + }); +})(); \ No newline at end of file diff --git a/docs/xgoedu/xgoedu.html b/docs/xgoedu/xgoedu.html new file mode 100644 index 0000000..310e6b4 --- /dev/null +++ b/docs/xgoedu/xgoedu.html @@ -0,0 +1,7835 @@ + + + + + + + xgoedu API documentation + + + + + + + + + +
+
+

+xgoedu

+ +

xgo graphical python library edu library

+
+ + + + + +
   1'''
+   2xgo graphical python library edu library
+   3'''
+   4import cv2
+   5import numpy as np
+   6import math
+   7import os, sys, time, json, base64
+   8import spidev as SPI
+   9import xgoscreen.LCD_2inch as LCD_2inch
+  10import RPi.GPIO as GPIO
+  11from PIL import Image, ImageDraw, ImageFont
+  12import json
+  13import threading
+  14
+  15# from xgolib import XGO
+  16# from keras.preprocessing import image
+  17# import _thread  # using _thread will report an error, pitfall!
+  18
+  19__version__ = '1.5'
+  20__last_modified__ = '2024/12/18'
+  21
+  22GPIO.setwarnings(False)
+  23GPIO.setmode(GPIO.BCM)
+  24
+  25camera_still = False
+  26
+  27'''
+  28Face detection
+  29'''
+  30def getFaceBox(net, frame, conf_threshold=0.7):
+  31    """
+  32    Detects faces in a given frame using a pre-trained deep neural network.
+  33
+  34    Parameters:
+  35        net (cv2.dnn.Net): The pre-trained face detection model.
+  36        frame (numpy.ndarray): The input image frame.
+  37        conf_threshold (float, optional): The minimum confidence threshold for a detection to be considered a face. Defaults to 0.7.
+  38
+  39    Returns:
+  40        tuple: A tuple containing the frame with detected faces and a list of bounding boxes.
+  41            - frameOpencvDnn (numpy.ndarray): The frame with bounding boxes drawn around detected faces.
+  42            - bboxes (list): A list of bounding boxes, where each bounding box is represented as [x1, y1, x2, y2].
+  43    """
+  44    frameOpencvDnn = frame.copy()
+  45    frameHeight = frameOpencvDnn.shape[0]
+  46    frameWidth = frameOpencvDnn.shape[1]
+  47    blob = cv2.dnn.blobFromImage(frameOpencvDnn, 1.0, (300, 300), [104, 117, 123], True, False)
+  48    net.setInput(blob)
+  49    detections = net.forward()
+  50    bboxes = []
+  51    for i in range(detections.shape[2]):
+  52        confidence = detections[0, 0, i, 2]
+  53        if confidence > conf_threshold:
+  54            x1 = int(detections[0, 0, i, 3] * frameWidth)
+  55            y1 = int(detections[0, 0, i, 4] * frameHeight)
+  56            x2 = int(detections[0, 0, i, 5] * frameWidth)
+  57            y2 = int(detections[0, 0, i, 6] * frameHeight)
+  58            bboxes.append([x1, y1, x2, y2])
+  59            cv2.rectangle(frameOpencvDnn, (x1, y1), (x2, y2), (0, 255, 0), int(round(frameHeight / 150)), 8)
+  60    return frameOpencvDnn, bboxes
+  61
+  62'''
+  63Gesture recognition function
+  64'''
+  65def hand_pos(angle):
+  66    """
+  67    Recognizes hand gestures based on finger angles.
+  68
+  69    Parameters:
+  70        angle (list): A list of 5 finger angles (thumb, index, middle, ring, pinky).
+  71
+  72    Returns:
+  73        str or None: The recognized hand gesture ('Good', 'Ok', 'Rock', 'Stone', '1', '3', '4', '5', '2') or None if no gesture is recognized.
+  74    """
+  75    pos = None
+  76    # Thumb angle
+  77    f1 = angle[0]
+  78    # Index finger angle
+  79    f2 = angle[1]
+  80    # Middle finger angle
+  81    f3 = angle[2]
+  82    # Ring finger angle
+  83    f4 = angle[3]
+  84    # Pinky finger angle
+  85    f5 = angle[4]
+  86    if f1 < 50 and (f2 >= 50 and (f3 >= 50 and (f4 >= 50 and f5 >= 50))):
+  87        pos = 'Good'
+  88    elif f1 < 50 and (f2 >= 50 and (f3 < 50 and (f4 < 50 and f5 < 50))):
+  89        pos = 'Ok'
+  90    elif f1 < 50 and (f2 < 50 and (f3 >= 50 and (f4 >= 50 and f5 < 50))):
+  91        pos = 'Rock'
+  92    elif f1 >= 50 and (f2 >= 50 and (f3 >= 50 and (f4 >= 50 and f5 >= 50))):
+  93        pos = 'Stone'
+  94    elif f1 >= 50 and (f2 < 50 and (f3 >= 50 and (f4 >= 50 and f5 >= 50))):
+  95        pos = '1'
+  96    elif f1 >= 50 and (f2 < 50 and (f3 < 50 and (f4 < 50 and f5 >= 50))):
+  97        pos = '3'
+  98    elif f1 >= 50 and (f2 < 50 and (f3 < 50 and (f4 < 50 and f5 < 50))):
+  99        pos = '4'
+ 100    elif f1 < 50 and (f2 < 50 and (f3 < 50 and (f4 < 50 and f5 < 50))):
+ 101        pos = '5'
+ 102    elif f1 >= 50 and (f2 < 50 and (f3 < 50 and (f4 >= 50 and f5 >= 50))):
+ 103        pos = '2'
+ 104    return pos
+ 105
+ 106def color(value):
+ 107    """
+ 108    Converts a color value between hexadecimal and RGB tuple formats.
+ 109
+ 110    Parameters:
+ 111        value (str or tuple): The color value to convert. 
+ 112            - If a string, it should be a hexadecimal color code (e.g., '#FF0000').
+ 113            - If a tuple, it should be an RGB tuple (e.g., (255, 0, 0)).
+ 114
+ 115    Returns:
+ 116        str or tuple: The converted color value.
+ 117            - If the input is a tuple, the output is a hexadecimal color string.
+ 118            - If the input is a string, the output is an RGB tuple.
+ 119    """
+ 120    digit = list(map(str, range(10))) + list("ABCDEF")
+ 121    value = value.upper()
+ 122    if isinstance(value, tuple):
+ 123        string = '#'
+ 124        for i in value:
+ 125            a1 = i // 16
+ 126            a2 = i % 16
+ 127            string += digit[a1] + digit[a2]
+ 128        return string
+ 129    elif isinstance(value, str):
+ 130        a1 = digit.index(value[1]) * 16 + digit.index(value[2])
+ 131        a2 = digit.index(value[3]) * 16 + digit.index(value[4])
+ 132        a3 = digit.index(value[5]) * 16 + digit.index(value[6])
+ 133        return (a3, a2, a1)
+ 134
+ 135class XGOEDU():
+ 136    """
+ 137    A class for controlling and interacting with the XGO robot's educational features, including the LCD display, camera, and various AI functions.
+ 138    """
+ 139    def __init__(self):
+ 140        """
+ 141        Initializes the XGOEDU object, setting up the LCD display, GPIO pins, and various attributes.
+ 142        """
+ 143        self.display = LCD_2inch.LCD_2inch()
+ 144        self.display.Init()
+ 145        self.display.clear()
+ 146        self.splash = Image.new("RGB", (320, 240), "black")
+ 147        self.display.ShowImage(self.splash)
+ 148        self.draw = ImageDraw.Draw(self.splash)
+ 149        self.font = ImageFont.truetype("/home/pi/model/msyh.ttc", 15)
+ 150        self.key1 = 17
+ 151        self.key2 = 22
+ 152        self.key3 = 23
+ 153        self.key4 = 24
+ 154        self.cap = None
+ 155        self.hand = None
+ 156        self.yolo = None
+ 157        self.face = None
+ 158        self.face_classifier = None
+ 159        self.classifier = None
+ 160        self.agesexmark = None
+ 161        self.camera_still = False
+ 162        GPIO.setup(self.key1, GPIO.IN, GPIO.PUD_UP)
+ 163        GPIO.setup(self.key2, GPIO.IN, GPIO.PUD_UP)
+ 164        GPIO.setup(self.key3, GPIO.IN, GPIO.PUD_UP)
+ 165        GPIO.setup(self.key4, GPIO.IN, GPIO.PUD_UP)
+ 166
+ 167    def open_camera(self):
+ 168        """
+ 169        Opens the camera if it's not already open.
+ 170        """
+ 171        if self.cap == None:
+ 172            self.cap = cv2.VideoCapture(0)
+ 173            self.cap.set(3, 320)
+ 174            self.cap.set(4, 240)
+ 175
+ 176    def fetch_token(self):
+ 177        """
+ 178        Fetches an access token from the Baidu AI platform.
+ 179
+ 180        Returns:
+ 181            str: The access token.
+ 182
+ 183        Raises:
+ 184            DemoError: If the API key or secret key is incorrect, or if the scope is not correct.
+ 185        """
+ 186        from urllib.request import urlopen
+ 187        from urllib.request import Request
+ 188        from urllib.error import URLError
+ 189        from urllib.parse import urlencode
+ 190        API_KEY = 'Q4ZgU8bfnhA8HQFnNucBO2ut'
+ 191        SECRET_KEY = 'MqFrVgdwoM8ZuGIp0NIFF7qfYti4mjP6'
+ 192        TOKEN_URL = 'http://aip.baidubce.com/oauth/2.0/token'
+ 193        params = {'grant_type': 'client_credentials',
+ 194                  'client_id': API_KEY,
+ 195                  'client_secret': SECRET_KEY}
+ 196        post_data = urlencode(params)
+ 197        post_data = post_data.encode('utf-8')
+ 198        req = Request(TOKEN_URL, post_data)
+ 199        try:
+ 200            f = urlopen(req)
+ 201            result_str = f.read()
+ 202        except URLError as err:
+ 203            print('token http response http code : ' + str(err.code))
+ 204            result_str = err.read()
+ 205        result_str = result_str.decode()
+ 206
+ 207        # print(result_str)
+ 208        result = json.loads(result_str)
+ 209        # print(result)
+ 210        SCOPE = False
+ 211        if ('access_token' in result.keys() and 'scope' in result.keys()):
+ 212            # print(SCOPE)
+ 213            if SCOPE and (not SCOPE in result['scope'].split(' ')):  # SCOPE = False ignore check
+ 214                raise DemoError('scope is not correct')
+ 215            # print('SUCCESS WITH TOKEN: %s  EXPIRES IN SECONDS: %s' % (result['access_token'], result['expires_in']))
+ 216            return result['access_token']
+ 217        else:
+ 218            raise DemoError('MAYBE API_KEY or SECRET_KEY not correct: access_token or scope not found in token response')
+ 219
+ 220    # draw a straight line
+ 221    '''
+ 222    x1, y1 are the initial point coordinates, x2, y2 are the end point coordinates
+ 223    '''
+ 224    def lcd_line(self, x1, y1, x2, y2, color="WHITE", width=2):
+ 225        """
+ 226        Draws a straight line on the LCD display.
+ 227
+ 228        Parameters:
+ 229            x1 (int): The x-coordinate of the starting point.
+ 230            y1 (int): The y-coordinate of the starting point.
+ 231            x2 (int): The x-coordinate of the ending point.
+ 232            y2 (int): The y-coordinate of the ending point.
+ 233            color (str, optional): The color of the line. Defaults to "WHITE".
+ 234            width (int, optional): The width of the line. Defaults to 2.
+ 235        """
+ 236        self.draw.line([(x1, y1), (x2, y2)], fill=color, width=width)
+ 237        self.display.ShowImage(self.splash)
+ 238
+ 239    # draw circle
+ 240    '''
+ 241    x1, y1, x2, y2 are two points defining the given border, angle0 is the initial angle, angle1 is the end angle
+ 242    '''
+ 243    def lcd_circle(self, x1, y1, x2, y2, angle0, angle1, color="WHITE", width=2):
+ 244        """
+ 245        Draws a circle or an arc on the LCD display.
+ 246
+ 247        Parameters:
+ 248            x1 (int): The x-coordinate of the top-left corner of the bounding box.
+ 249            y1 (int): The y-coordinate of the top-left corner of the bounding box.
+ 250            x2 (int): The x-coordinate of the bottom-right corner of the bounding box.
+ 251            y2 (int): The y-coordinate of the bottom-right corner of the bounding box.
+ 252            angle0 (int): The starting angle (in degrees).
+ 253            angle1 (int): The ending angle (in degrees).
+ 254            color (str, optional): The color of the circle/arc. Defaults to "WHITE".
+ 255            width (int, optional): The width of the circle/arc. Defaults to 2.
+ 256        """
+ 257        self.draw.arc((x1, y1, x2, y2), angle0, angle1, fill=color, width=width)
+ 258        self.display.ShowImage(self.splash)
+ 259
+ 260    # draw a circle: draw a circle based on the circle point and radius
+ 261    '''
+ 262    center_x, center_y coordinates of the center point of the circle
+ 263    radius circle radius length mm
+ 264    
+ 265    '''
+ 266    def lcd_round(self, center_x, center_y, radius, color, width=2):
+ 267        """
+ 268        Draws a circle on the LCD display using the center point and radius.
+ 269
+ 270        Parameters:
+ 271            center_x (int): The x-coordinate of the center of the circle.
+ 272            center_y (int): The y-coordinate of the center of the circle.
+ 273            radius (int): The radius of the circle.
+ 274            color (str): The color of the circle.
+ 275            width (int, optional): The width of the circle's outline. Defaults to 2.
+ 276        """
+ 277        # Calculate the bounding box for the circle
+ 278        x1 = center_x - radius
+ 279        y1 = center_y - radius
+ 280        x2 = center_x + radius
+ 281        y2 = center_y + radius
+ 282
+ 283        # Call lcd_circle() function to draw the circle
+ 284        self.lcd_circle(x1, y1, x2, y2, 0, 360, color=color, width=width)
+ 285
+ 286    # draw rectangle
+ 287    '''
+ 288    x1, y1 are the initial point coordinates, x2, y2 are the diagonal end point coordinates
+ 289    '''
+ 290    def lcd_rectangle(self, x1, y1, x2, y2, fill=None, outline="WHITE", width=2):
+ 291        """
+ 292        Draws a rectangle on the LCD display.
+ 293
+ 294        Parameters:
+ 295            x1 (int): The x-coordinate of the top-left corner.
+ 296            y1 (int): The y-coordinate of the top-left corner.
+ 297            x2 (int): The x-coordinate of the bottom-right corner.
+ 298            y2 (int): The y-coordinate of the bottom-right corner.
+ 299            fill (str, optional): The fill color of the rectangle. Defaults to None.
+ 300            outline (str, optional): The outline color of the rectangle. Defaults to "WHITE".
+ 301            width (int, optional): The width of the rectangle's outline. Defaults to 2.
+ 302        """
+ 303        self.draw.rectangle((x1, y1, x2, y2), fill=fill, outline=outline, width=width)
+ 304        self.display.ShowImage(self.splash)
+ 305
+ 306    # clear the screen
+ 307    def lcd_clear(self):
+ 308        """
+ 309        Clears the LCD display.
+ 310        """
+ 311        self.splash = Image.new("RGB", (320, 240), "black")
+ 312        self.draw = ImageDraw.Draw(self.splash)
+ 313        self.display.ShowImage(self.splash)
+ 314
+ 315    # show picture
+ 316    '''
+ 317    The size of the picture is 320*240, jpg format
+ 318    '''
+ 319    def lcd_picture(self, filename, x=0, y=0):
+ 320        """
+ 321        Displays an image on the LCD display.
+ 322
+ 323        Parameters:
+ 324            filename (str): The name of the image file (must be in the /home/pi/xgoPictures/ directory).
+ 325            x (int, optional): The x-coordinate of the top-left corner where the image will be displayed. Defaults to 0.
+ 326            y (int, optional): The y-coordinate of the top-left corner where the image will be displayed. Defaults to 0.
+ 327        """
+ 328        path = "/home/pi/xgoPictures/"
+ 329        image = Image.open(path + filename)
+ 330        self.splash.paste(image, (x, y))
+ 331        self.display.ShowImage(self.splash)
+ 332
+ 333    # display text
+ 334    '''
+ 335    x1, y1 are the initial point coordinates, content is the content
+ 336    '''
+ 337    def lcd_text(self, x, y, content, color="WHITE", fontsize=15):
+ 338        """
+ 339        Displays text on the LCD display.
+ 340
+ 341        Parameters:
+ 342            x (int): The x-coordinate of the top-left corner of the text.
+ 343            y (int): The y-coordinate of the top-left corner of the text.
+ 344            content (str): The text to display.
+ 345            color (str, optional): The color of the text. Defaults to "WHITE".
+ 346            fontsize (int, optional): The font size of the text. Defaults to 15.
+ 347        """
+ 348        if fontsize != 15:
+ 349            self.font = ImageFont.truetype("/home/pi/model/msyh.ttc", fontsize)
+ 350        self.draw.text((x, y), content, fill=color, font=self.font)
+ 351        self.display.ShowImage(self.splash)
+ 352
+ 353    # streaming display all text
+ 354    '''
+ 355    x1, y1 are the initial point coordinates, content is the content
+ 356    Automatically wrap when encountering a carriage return character, wrap when encountering the edge, and automatically clear the screen when a page is full, 2, 2 continue to display
+ 357    '''
+ 358    def display_text_on_screen(self, content, color, start_x=2, start_y=2, font_size=20, screen_width=320,
+ 359                                screen_height=240):
+ 360        """
+ 361        Displays text on the screen with automatic wrapping and page breaks.
+ 362
+ 363        Parameters:
+ 364            content (str): The text content to display.
+ 365            color (str): The color of the text.
+ 366            start_x (int, optional): The x-coordinate of the starting position. Defaults to 2.
+ 367            start_y (int, optional): The y-coordinate of the starting position. Defaults to 2.
+ 368            font_size (int, optional): The font size. Defaults to 20.
+ 369            screen_width (int, optional): The width of the screen. Defaults to 320.
+ 370            screen_height (int, optional): The height of the screen. Defaults to 240.
+ 371        """
+ 372        # Calculate the number of characters that can be displayed per line and the number of lines
+ 373        char_width = font_size + 1  # // 2
+ 374        chars_per_line = screen_width // char_width
+ 375        lines = screen_height // char_width
+ 376
+ 377        # Split the content into a list of individual characters
+ 378        chars = list(content)
+ 379
+ 380        # Handle newline characters
+ 381        line_break_indices = [i for i, char in enumerate(chars) if char == '\n']
+ 382
+ 383        # Calculate the total number of lines and pages
+ 384        total_lines = len(chars) // chars_per_line + 1
+ 385        total_pages = (total_lines - 1 + len(line_break_indices)) // lines + 1
+ 386
+ 387        # Clear the screen
+ 388        self.display.clear()
+ 389
+ 390        # Display the text line by line
+ 391        current_page = 1
+ 392        current_line = 1
+ 393        current_char = 0
+ 394
+ 395        while current_page <= total_pages or current_char < len(chars):
+ 396            self.display.clear()
+ 397            # Calculate the number of lines to display on the current page
+ 398            if current_page < total_pages or current_char < len(chars):
+ 399                lines_to_display = lines
+ 400            else:
+ 401                lines_to_display = (total_lines - 1) % lines + 1
+ 402
+ 403            current_line = 1
+ 404            # Display the content of the current page
+ 405            for line in range(lines_to_display):
+ 406                current_x = start_x
+ 407                current_y = start_y + current_line * char_width  # font_size
+ 408                current_line += 1
+ 409                if current_line >= lines:
+ 410                    break
+ 411
+ 412                # Show the text of the current line
+ 413                for _ in range(chars_per_line):
+ 414                    # Check if all characters have been displayed
+ 415                    if current_char >= len(chars):
+ 416                        break
+ 417
+ 418                    char = chars[current_char]
+ 419                    if char == '\n':
+ 420                        current_x = start_x
+ 421                        current_y = start_y + current_line * char_width  # font_size
+ 422                        current_line += 1
+ 423
+ 424                        self.lcd_text(current_x, current_y, char, color, font_size)
+ 425                        current_char += 1
+ 426                        break  # continue
+ 427
+ 428                    self.lcd_text(current_x, current_y, char, color, font_size)
+ 429                    current_x += char_width
+ 430                    current_char += 1
+ 431
+ 432                # Check if all characters have been displayed
+ 433                if current_char >= len(chars):
+ 434                    break
+ 435
+ 436            # Update current page and current line
+ 437            current_page += 1
+ 438            current_line += lines_to_display
+ 439
+ 440            # Wait for display time or manually trigger page turning
+ 441            # Here you can add appropriate delay code or a mechanism to trigger page turning as needed
+ 442
+ 443        # If the content exceeds one screen, clear the screen
+ 444        # if total_lines > lines:
+ 445        if current_page < total_pages:
+ 446            self.display.clear()
+ 447
+ 448    # key_value
+ 449    '''
+ 450    a upper left button
+ 451    b upper right button
+ 452    c lower left button
+ 453    d lower right button
+ 454    Return value 0 not pressed, 1 pressed
+ 455    '''
+ 456    def xgoButton(self, button):
+ 457        """
+ 458        Checks the state of a button.
+ 459
+ 460        Parameters:
+ 461            button (str): The button to check ('a', 'b', 'c', or 'd').
+ 462
+ 463        Returns:
+ 464            bool: True if the button is pressed, False otherwise.
+ 465        """
+ 466        if button == "a":
+ 467            last_state_a = GPIO.input(self.key1)
+ 468            time.sleep(0.02)
+ 469            return (not last_state_a)
+ 470        elif button == "b":
+ 471            last_state_b = GPIO.input(self.key2)
+ 472            time.sleep(0.02)
+ 473            return (not last_state_b)
+ 474        elif button == "c":
+ 475            last_state_c = GPIO.input(self.key3)
+ 476            time.sleep(0.02)
+ 477            return (not last_state_c)
+ 478        elif button == "d":
+ 479            last_state_d = GPIO.input(self.key4)
+ 480            time.sleep(0.02)
+ 481            return (not last_state_d)
+ 482
+ 483    # speaker
+ 484    '''
+ 485    filename file name string
+ 486    '''
+ 487    def xgoSpeaker(self, filename):
+ 488        """
+ 489        Plays an audio file using mplayer.
+ 490
+ 491        Parameters:
+ 492            filename (str): The name of the audio file (must be in the /home/pi/xgoMusic/ directory).
+ 493        """
+ 494        path = "/home/pi/xgoMusic/"
+ 495        os.system("mplayer" + " " + path + filename)
+ 496
+ 497    def xgoVideoAudio(self, filename):
+ 498        """
+ 499        Plays the audio track of a video file using mplayer.
+ 500
+ 501        Parameters:
+ 502            filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).
+ 503        """
+ 504        path = "/home/pi/xgoVideos/"
+ 505        time.sleep(0.2)  # Synchronize sound and picture speed, but the timeline may not be synchronized. Adjust here.
+ 506        cmd = "sudo mplayer " + path + filename + " -novideo"
+ 507        os.system(cmd)
+ 508
+ 509    def xgoVideo(self, filename):
+ 510        """
+ 511        Plays a video file on the LCD display while simultaneously playing its audio track in a separate thread.
+ 512
+ 513        Parameters:
+ 514            filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).
+ 515        """
+ 516        path = "/home/pi/xgoVideos/"
+ 517        x = threading.Thread(target=self.xgoVideoAudio, args=(filename,))
+ 518        x.start()
+ 519        global counter
+ 520        video = cv2.VideoCapture(path + filename)
+ 521        print(path + filename)
+ 522        fps = video.get(cv2.CAP_PROP_FPS)
+ 523        print(fps)
+ 524        init_time = time.time()
+ 525        counter = 0
+ 526        while True:
+ 527            grabbed, dst = video.read()
+ 528            try:
+ 529                b, g, r = cv2.split(dst)
+ 530                dst = cv2.merge((r, g, b))
+ 531            except:
+ 532                pass
+ 533            try:
+ 534                imgok = Image.fromarray(dst)
+ 535            except:
+ 536                break
+ 537            self.display.ShowImage(imgok)
+ 538            # Force frame rate. It is recommended that the frame rate should not exceed 20 frames, otherwise the display will not keep up, but 20 frames often have problems, so it is recommended to directly use 15 frames.
+ 539            counter += 1
+ 540            ctime = time.time() - init_time
+ 541            if ctime != 0:
+ 542                qtime = counter / fps - ctime
+ 543                # print(qtime)
+ 544                if qtime > 0:
+ 545                    time.sleep(qtime)
+ 546            if not grabbed:
+ 547                break
+ 548
+ 549    # audio_record
+ 550    '''
+ 551    filename file name string
+ 552    seconds recording time S string
+ 553    '''
+ 554    def xgoAudioRecord(self, filename="record", seconds=5):
+ 555        """
+ 556        Records audio for a specified duration and saves it as a WAV file.
+ 557
+ 558        Parameters:
+ 559            filename (str, optional): The name of the output audio file. Defaults to "record".
+ 560            seconds (int, optional): The recording duration in seconds. Defaults to 5.
+ 561        """
+ 562        path = "/home/pi/xgoMusic/"
+ 563        command1 = "sudo arecord -d"
+ 564        command2 = "-f S32_LE -r 8000 -c 1 -t wav"
+ 565        cmd = command1 + " " + str(seconds) + " " + command2 + " " + path + filename + ".wav"
+ 566        print(cmd)
+ 567        os.system(cmd)
+ 568
+ 569    def xgoCamera(self, switch):
+ 570        """
+ 571        Turns the camera on or off and displays the camera feed on the LCD.
+ 572
+ 573        Parameters:
+ 574            switch (bool): True to turn the camera on, False to turn it off.
+ 575        """
+ 576        global camera_still
+ 577        if switch:
+ 578            self.open_camera()
+ 579            self.camera_still = True
+ 580            t = threading.Thread(target=self.camera_mode)
+ 581            t.start()
+ 582        else:
+ 583            self.camera_still = False
+ 584            time.sleep(0.5)
+ 585            splash = Image.new("RGB", (320, 240), "black")
+ 586            self.display.ShowImage(splash)
+ 587
+ 588    def camera_mode(self):
+ 589        """
+ 590        Continuously captures and displays the camera feed on the LCD until camera_still is set to False.
+ 591        """
+ 592        self.camera_still = True
+ 593        while 1:
+ 594            success, image = self.cap.read()
+ 595            b, g, r = cv2.split(image)
+ 596            image = cv2.merge((r, g, b))
+ 597            image = cv2.flip(image, 1)
+ 598            imgok = Image.fromarray(image)
+ 599            self.display.ShowImage(imgok)
+ 600            if not self.camera_still:
+ 601                break
+ 602
+ 603    def xgoVideoRecord(self, filename="record", seconds=5):
+ 604        """
+ 605        Records a video for a specified duration, displays it on the LCD, and saves it as an MP4 file.
+ 606
+ 607        Parameters:
+ 608            filename (str, optional): The name of the output video file. Defaults to "record".
+ 609            seconds (int, optional): The recording duration in seconds. Defaults to 5.
+ 610        """
+ 611        path = "/home/pi/xgoVideos/"
+ 612        self.camera_still = False
+ 613        time.sleep(0.6)
+ 614        self.open_camera()
+ 615        FPS = 15
+ 616        fourcc = cv2.VideoWriter_fourcc(*'mp4v')
+ 617        width = int(self.cap.get(cv2.CAP_PROP_FRAME_WIDTH))
+ 618        height = int(self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
+ 619        videoWrite = cv2.VideoWriter(path + filename + '.mp4', fourcc, FPS, (width, height))
+ 620        starttime = time.time()
+ 621        while 1:
+ 622            print('recording...')
+ 623            ret, image = self.cap.read()
+ 624            if not ret:
+ 625                break
+ 626            videoWrite.write(image)
+ 627            b, g, r = cv2.split(image)
+ 628            image = cv2.merge((r, g, b))
+ 629            image = cv2.flip(image, 1)
+ 630            imgok = Image.fromarray(image)
+ 631            self.display.ShowImage(imgok)
+ 632            if time.time() - starttime > seconds:
+ 633                break
+ 634        print('recording done')
+ 635        self.xgoCamera(True)
+ 636        videoWrite.release()
+ 637
+ 638    def xgoTakePhoto(self, filename="photo"):
+ 639        """
+ 640        Takes a photo, displays it on the LCD, and saves it as a JPG file.
+ 641
+ 642        Parameters:
+ 643            filename (str, optional): The name of the output image file. Defaults to "photo".
+ 644        """
+ 645        path = "/home/pi/xgoPictures/"
+ 646        self.camera_still = False
+ 647        time.sleep(0.6)
+ 648        self.open_camera()
+ 649        success, image = self.cap.read()
+ 650        cv2.imwrite(path + filename + '.jpg', image)
+ 651        if not success:
+ 652            print("Ignoring empty camera frame")
+ 653        b, g, r = cv2.split(image)
+ 654        image = cv2.merge((r, g, b))
+ 655        image = cv2.flip(image, 1)
+ 656        imgok = Image.fromarray(image)
+ 657        self.display.ShowImage(imgok)
+ 658        print('photo writed!')
+ 659        time.sleep(0.7)
+ 660        self.xgoCamera(True)
+ 661
+ 662    '''
+ 663    Turn on the camera, take a photo with the A button, record a video with the B button, and exit with the C button
+ 664    '''
+ 665    def camera(self, filename="camera"):
+ 666        """
+ 667        Activates the camera and allows the user to take photos, record videos, or exit using the A, B, and C buttons, respectively.
+ 668
+ 669        Parameters:
+ 670            filename (str, optional): The base filename for photos and videos. Defaults to "camera".
+ 671        """
+ 672        font = ImageFont.truetype("/home/pi/model/msyh.ttc", 20)
+ 673        self.open_camera()
+ 674        while True:
+ 675            success, image = self.cap.read()
+ 676            # cv2.imwrite('/home/pi/xgoEdu/camera/file.jpg',image)
+ 677            if not success:
+ 678                print("Ignoring empty camera frame")
+ 679                continue
+ 680            # cv2.imshow('frame',image)
+ 681            b, g, r = cv2.split(image)
+ 682            image = cv2.merge((r, g, b))
+ 683            image = cv2.flip(image, 1)
+ 684            imgok = Image.fromarray(image)
+ 685            self.display.ShowImage(imgok)
+ 686            if cv2.waitKey(5) & 0xFF == 27:
+ 687                XGOEDU.lcd_clear(self)
+ 688                time.sleep(0.5)
+ 689                break
+ 690            if XGOEDU.xgoButton(self, "a"):
+ 691                draw = ImageDraw.Draw(imgok)
+ 692                cv2.imwrite(filename + '.jpg', image)
+ 693                print('photo writed!')
+ 694                draw.text((5, 5), filename + '.jpg saved!', fill=(255, 0, 0), font=font)
+ 695                self.display.ShowImage(imgok)
+ 696                time.sleep(1)
+ 697            if XGOEDU.xgoButton(self, "b"):
+ 698                FPS = 15
+ 699                fourcc = cv2.VideoWriter_fourcc(*'mp4v')
+ 700                width = int(self.cap.get(cv2.CAP_PROP_FRAME_WIDTH))
+ 701                height = int(self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
+ 702                videoWrite = cv2.VideoWriter(filename + '.mp4', fourcc, FPS, (width, height))
+ 703                while 1:
+ 704                    ret, image = self.cap.read()
+ 705                    if not ret:
+ 706                        break
+ 707                    videoWrite.write(image)
+ 708                    b, g, r = cv2.split(image)
+ 709                    image = cv2.merge((r, g, b))
+ 710                    image = cv2.flip(image, 1)
+ 711                    imgok = Image.fromarray(image)
+ 712                    draw = ImageDraw.Draw(imgok)
+ 713                    draw.text((5, 5), 'recording', fill=(255, 0, 0), font=font)
+ 714                    self.display.ShowImage(imgok)
+ 715                    if cv2.waitKey(33) & 0xFF == ord('q'):
+ 716                        break
+ 717                    if XGOEDU.xgoButton(self, "b"):
+ 718                        break
+ 719                time.sleep(1)
+ 720                videoWrite.release()
+ 721            if XGOEDU.xgoButton(self, "c"):
+ 722                XGOEDU.lcd_clear(self)
+ 723                time.sleep(0.5)
+ 724                break
+ 725
+ 726    '''
+ 727    Skeletal recognition
+ 728    '''
+ 729    def posenetRecognition(self, target="camera"):
+ 730        """
+ 731        Performs skeletal (pose) recognition on an image or video frame and displays the results on the LCD.
+ 732
+ 733        Parameters:
+ 734            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 735
+ 736        Returns:
+ 737            list or None: A list of angles between key body joints if successful, or None if no pose is detected.
+ 738        """
+ 739        import mediapipe as mp
+ 740        mp_pose = mp.solutions.pose
+ 741        ges = ''
+ 742        mp_drawing = mp.solutions.drawing_utils
+ 743        mp_drawing_styles = mp.solutions.drawing_styles
+ 744        mp_holistic = mp.solutions.holistic
+ 745        joint_list = [[24, 26, 28], [23, 25, 27], [14, 12, 24], [13, 11, 23]]  # leg&arm
+ 746        if target == "camera":
+ 747            self.open_camera()
+ 748            success, image = self.cap.read()
+ 749        else:
+ 750            image = np.array(Image.open(target))
+ 751
+ 752        with mp_pose.Pose(
+ 753                min_detection_confidence=0.5,
+ 754                min_tracking_confidence=0.5) as pose:
+ 755
+ 756            image.flags.writeable = False
+ 757            image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+ 758            results = pose.process(image)
+ 759
+ 760            # Draw the pose annotation on the image.
+ 761            image.flags.writeable = True
+ 762            image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
+ 763            mp_drawing.draw_landmarks(
+ 764                image,
+ 765                results.pose_landmarks,
+ 766                mp_pose.POSE_CONNECTIONS,
+ 767                landmark_drawing_spec=mp_drawing_styles.get_default_pose_landmarks_style())
+ 768            # Flip the image horizontally for a selfie-view display.
+ 769
+ 770            if results.pose_landmarks:
+ 771                RHL = results.pose_landmarks
+ 772                angellist = []
+ 773                for joint in joint_list:
+ 774                    a = np.array([RHL.landmark[joint[0]].x, RHL.landmark[joint[0]].y])
+ 775                    b = np.array([RHL.landmark[joint[1]].x, RHL.landmark[joint[1]].y])
+ 776                    c = np.array([RHL.landmark[joint[2]].x, RHL.landmark[joint[2]].y])
+ 777                    radians_fingers = np.arctan2(c[1] - b[1], c[0] - b[0]) - np.arctan2(a[1] - b[1], a[0] - b[0])
+ 778                    angle = np.abs(radians_fingers * 180.0 / np.pi)
+ 779                    if angle > 180.0:
+ 780                        angle = 360 - angle
+ 781                    # cv2.putText(image, str(round(angle, 2)), tuple(np.multiply(b, [640, 480]).astype(int)),cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA)
+ 782                    angellist.append(angle)
+ 783            else:
+ 784                angellist = []
+ 785            print(angellist)
+ 786            b, g, r = cv2.split(image)
+ 787            image = cv2.merge((r, g, b))
+ 788            image = cv2.flip(image, 1)
+ 789            try:
+ 790                ges = str(int(angellist[0])) + '|' + str(int(angellist[1])) + '|' + str(int(angellist[2])) + '|' + str(
+ 791                    int(angellist[3]))
+ 792            except:
+ 793                ges = ' '
+ 794            cv2.putText(image, ges, (10, 220), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA)
+ 795            imgok = Image.fromarray(image)
+ 796            self.display.ShowImage(imgok)
+ 797
+ 798        # datas = self.hand.run(image)
+ 799        # b,g,r = cv2.split(image)
+ 800        # image = cv2.merge((r,g,b))
+ 801        # #image = cv2.flip(image,1)
+ 802        # for data in datas:
+ 803        #     rect = data['rect']
+ 804        #     right_left = data['right_left']
+ 805        #     center = data['center']
+ 806        #     dlandmark = data['dlandmark']
+ 807        #     hand_angle = data['hand_angle']
+ 808        #     XGOEDU.rectangle(self,image,rect,"#33cc00",2)
+ 809        #     #XGOEDU.text(self,image,right_left,center,2,"#cc0000",5)
+ 810        #     if right_left == 'L':
+ 811        #         XGOEDU.text(self,image,hand_pos(hand_angle),(180,80),1.5,"#33cc00",2)
+ 812        #     elif right_left == 'R':
+ 813        #         XGOEDU.text(self,image,hand_pos(hand_angle),(50,80),1.5,"#ff0000",2)
+ 814        #     ges = hand_pos(hand_angle)
+ 815        #     for i in dlandmark:
+ 816        #         XGOEDU.circle(self,image,i,3,"#ff9900",-1)
+ 817        # imgok = Image.fromarray(image)
+ 818        # self.display.ShowImage(imgok)
+ 819        if angellist == []:
+ 820            return None
+ 821        else:
+ 822            return angellist
+ 823
+ 824    '''
+ 825    Gesture recognition
+ 826    '''
+ 827    def gestureRecognition(self, target="camera"):
+ 828        """
+ 829        Performs hand gesture recognition on an image or video frame and displays the results on the LCD.
+ 830
+ 831        Parameters:
+ 832            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 833
+ 834        Returns:
+ 835            tuple or None: A tuple containing the recognized gesture (str) and the center coordinates of the hand if successful, or None if no gesture is recognized.
+ 836        """
+ 837        ges = ''
+ 838        if self.hand == None:
+ 839            self.hand = hands(0, 2, 0.6, 0.5)
+ 840        if target == "camera":
+ 841            self.open_camera()
+ 842            success, image = self.cap.read()
+ 843        else:
+ 844            image = np.array(Image.open(target))
+ 845        image = cv2.flip(image, 1)
+ 846        datas = self.hand.run(image)
+ 847        b, g, r = cv2.split(image)
+ 848        image = cv2.merge((r, g, b))
+ 849        for data in datas:
+ 850            rect = data['rect']
+ 851            right_left = data['right_left']
+ 852            center = data['center']
+ 853            dlandmark = data['dlandmark']
+ 854            hand_angle = data['hand_angle']
+ 855            XGOEDU.rectangle(self, image, rect, "#33cc00", 2)
+ 856            # XGOEDU.text(self,image,right_left,center,2,"#cc0000",5)
+ 857            if right_left == 'L':
+ 858                XGOEDU.text(self, image, hand_pos(hand_angle), (180, 80), 1.5, "#33cc00", 2)
+ 859            elif right_left == 'R':
+ 860                XGOEDU.text(self, image, hand_pos(hand_angle), (50, 80), 1.5, "#ff0000", 2)
+ 861            ges = hand_pos(hand_angle)
+ 862            for i in dlandmark:
+ 863                XGOEDU.circle(self, image, i, 3, "#ff9900", -1)
+ 864        imgok = Image.fromarray(image)
+ 865        self.display.ShowImage(imgok)
+ 866        if ges == '':
+ 867            return None
+ 868        else:
+ 869            return (ges, center)
+ 870
+ 871    '''
+ 872    yolo
+ 873    '''
+ 874    def yoloFast(self, target="camera"):
+ 875        """
+ 876        Performs object detection using YOLO on an image or video frame and displays the results on the LCD.
+ 877
+ 878        Parameters:
+ 879            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 880
+ 881        Returns:
+ 882            tuple or None: A tuple containing the detected class (str) and the bounding box coordinates if successful, or None if no object is detected.
+ 883        """
+ 884        ret = ''
+ 885        self.open_camera()
+ 886        if self.yolo == None:
+ 887            self.yolo = yoloXgo('/home/pi/model/Model.onnx',
+ 888                                ['person', 'bicycle', 'car', 'motorbike', 'aeroplane', 'bus', 'train', 'truck', 'boat',
+ 889                                 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat',
+ 890                                 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack',
+ 891                                 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball',
+ 892                                 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket',
+ 893                                 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
+ 894                                 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair',
+ 895                                 'sofa', 'pottedplant', 'bed', 'diningtable', 'toilet', 'tvmonitor', 'laptop', 'mouse',
+ 896                                 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink',
+ 897                                 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier',
+ 898                                 'toothbrush'],
+ 899                                [352, 352], 0.66)
+ 900        if target == "camera":
+ 901            self.open_camera()
+ 902            success, image = self.cap.read()
+ 903        else:
+ 904            image = np.array(Image.open(target))
+ 905        datas = self.yolo.run(image)
+ 906        b, g, r = cv2.split(image)
+ 907        image = cv2.merge((r, g, b))
+ 908        image = cv2.flip(image, 1)
+ 909        if datas:
+ 910            for data in datas:
+ 911                XGOEDU.rectangle(self, image, data['xywh'], "#33cc00", 2)
+ 912                xy = (data['xywh'][0], data['xywh'][1])
+ 913                XGOEDU.text(self, image, data['classes'], xy, 1, "#ff0000", 2)
+ 914                value_yolo = data['classes']
+ 915                ret = (value_yolo, xy)
+ 916        imgok = Image.fromarray(image)
+ 917        self.display.ShowImage(imgok)
+ 918        if ret == '':
+ 919            return None
+ 920        else:
+ 921            return ret
+ 922
+ 923    '''
+ 924    Face detection (coordinate points)
+ 925    '''
+ 926    def face_detect(self, target="camera"):
+ 927        """
+ 928        Performs face detection (including facial landmarks) on an image or video frame and displays the results on the LCD.
+ 929
+ 930        Parameters:
+ 931            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 932
+ 933        Returns:
+ 934            list or None: A list of bounding box coordinates [x, y, w, h] of detected faces if successful, or None if no face is detected.
+ 935        """
+ 936        ret = ''
+ 937        if self.face == None:
+ 938            self.face = face_detection(0.7)
+ 939        if target == "camera":
+ 940            self.open_camera()
+ 941            success, image = self.cap.read()
+ 942        else:
+ 943            image = np.array(Image.open(target))
+ 944        b, g, r = cv2.split(image)
+ 945        image = cv2.merge((r, g, b))
+ 946        image = cv2.flip(image, 1)
+ 947        datas = self.face.run(image)
+ 948        for data in datas:
+ 949            lefteye = str(data['left_eye'])
+ 950            righteye = str(data['right_eye'])
+ 951            nose = str(data['nose'])
+ 952            mouth = str(data['mouth'])
+ 953            leftear = str(data['left_ear'])
+ 954            rightear = str(data['right_ear'])
+ 955            cv2.putText(image, 'lefteye', (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2)
+ 956            cv2.putText(image, lefteye, (100, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2)
+ 957            cv2.putText(image, 'righteye', (10, 50), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)
+ 958            cv2.putText(image, righteye, (100, 50), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)
+ 959            cv2.putText(image, 'nose', (10, 70), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
+ 960            cv2.putText(image, nose, (100, 70), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
+ 961            cv2.putText(image, 'leftear', (10, 90), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 0), 2)
+ 962            cv2.putText(image, leftear, (100, 90), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 0), 2)
+ 963            cv2.putText(image, 'rightear', (10, 110), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (200, 0, 200), 2)
+ 964            cv2.putText(image, rightear, (100, 110), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (200, 0, 200), 2)
+ 965            XGOEDU.rectangle(self, image, data['rect'], "#33cc00", 2)
+ 966            ret = data['rect']
+ 967        imgok = Image.fromarray(image)
+ 968        self.display.ShowImage(imgok)
+ 969        if ret == '':
+ 970            return None
+ 971        else:
+ 972            return ret
+ 973
+ 974    '''
+ 975    Emotion recognition
+ 976    '''
+ 977    def emotion(self, target="camera"):
+ 978        """
+ 979        Performs emotion recognition on an image or video frame and displays the results on the LCD.
+ 980
+ 981        Parameters:
+ 982            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 983
+ 984        Returns:
+ 985            tuple or None: A tuple containing the detected emotion (str) and the bounding box coordinates (x, y) of the face if successful, or None if no face or emotion is detected.
+ 986        """
+ 987        ret = ''
+ 988        if self.classifier == None:
+ 989            from keras.models import load_model
+ 990            self.face_classifier = cv2.CascadeClassifier('/home/pi/model/haarcascade_frontalface_default.xml')
+ 991            self.classifier = load_model('/home/pi/model/EmotionDetectionModel.h5')
+ 992        class_labels = ['Angry', 'Happy', 'Neutral', 'Sad', 'Surprise']
+ 993        if target == "camera":
+ 994            self.open_camera()
+ 995            success, image = self.cap.read()
+ 996        else:
+ 997            image = np.array(Image.open(target))
+ 998        labels = []
+ 999        gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
+1000        faces = self.face_classifier.detectMultiScale(gray, 1.3, 5)
+1001        label = ''
+1002        for (x, y, w, h) in faces:
+1003            cv2.rectangle(image, (x, y), (x + w, y + h), (255, 0, 0), 2)
+1004            roi_gray = gray[y:y + h, x:x + w]
+1005            roi_gray = cv2.resize(roi_gray, (48, 48), interpolation=cv2.INTER_AREA)
+1006            if np.sum([roi_gray]) != 0:
+1007                from tensorflow.keras.utils import img_to_array
+1008                roi = roi_gray.astype('float') / 255.0
+1009                roi = img_to_array(roi)
+1010                roi = np.expand_dims(roi, axis=0)
+1011
+1012                preds = self.classifier.predict(roi)[0]
+1013                label = class_labels[preds.argmax()]
+1014                ret = (label, (x, y))
+1015            else:
+1016                pass
+1017        b, g, r = cv2.split(image)
+1018        image = cv2.merge((r, g, b))
+1019        image = cv2.flip(image, 1)
+1020        try:
+1021            cv2.putText(image, label, label_position, cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 3)
+1022        except:
+1023            pass
+1024        imgok = Image.fromarray(image)
+1025        self.display.ShowImage(imgok)
+1026        if ret == '':
+1027            return None
+1028        else:
+1029            return ret
+1030
+1031    '''
+1032    Age and gender detection
+1033    '''
+1034    def agesex(self, target="camera"):
+1035        """
+1036        Performs age and gender detection on an image or video frame and displays the results on the LCD.
+1037
+1038        Parameters:
+1039            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1040
+1041        Returns:
+1042            tuple or None: A tuple containing the detected gender (str), age (str), and the bounding box coordinates (x, y) of the face if successful, or None if no face, gender, or age is detected.
+1043        """
+1044        ret = ''
+1045        MODEL_MEAN_VALUES = (78.4263377603, 87.7689143744, 114.895847746)
+1046        ageList = ['(0-2)', '(4-6)', '(8-12)', '(15-20)', '(25-32)', '(38-43)', '(48-53)', '(60-100)']
+1047        genderList = ['Male', 'Female']
+1048        padding = 20
+1049        if target == "camera":
+1050            self.open_camera()
+1051            success, image = self.cap.read()
+1052        else:
+1053            image = np.array(Image.open(target))
+1054        if self.agesexmark == None:
+1055            faceProto = "/home/pi/model/opencv_face_detector.pbtxt"
+1056            faceModel = "/home/pi/model/opencv_face_detector_uint8.pb"
+1057            ageProto = "/home/pi/model/age_deploy.prototxt"
+1058            ageModel = "/home/pi/model/age_net.caffemodel"
+1059            genderProto = "/home/pi/model/gender_deploy.prototxt"
+1060            genderModel = "/home/pi/model/gender_net.caffemodel"
+1061            self.ageNet = cv2.dnn.readNet(ageModel, ageProto)
+1062            self.genderNet = cv2.dnn.readNet(genderModel, genderProto)
+1063            self.faceNet = cv2.dnn.readNet(faceModel, faceProto)
+1064            self.agesexmark = True
+1065
+1066        image = cv2.flip(image, 1)
+1067        frameFace, bboxes = getFaceBox(self.faceNet, image)
+1068        gender = ''
+1069        age = ''
+1070        for bbox in bboxes:
+1071            face = image[max(0, bbox[1] - padding):min(bbox[3] + padding, image.shape[0] - 1),
+1072                   max(0, bbox[0] - padding):min(bbox[2] + padding, image.shape[1] - 1)]
+1073            blob = cv2.dnn.blobFromImage(face, 1.0, (227, 227), MODEL_MEAN_VALUES, swapRB=False)
+1074            self.genderNet.setInput(blob)
+1075            genderPreds = self.genderNet.forward()
+1076            gender = genderList[genderPreds[0].argmax()]
+1077            self.ageNet.setInput(blob)
+1078            agePreds = self.ageNet.forward()
+1079            age = ageList[agePreds[0].argmax()]
+1080            label = "{},{}".format(gender, age)
+1081            cv2.putText(frameFace, label, (bbox[0], bbox[1] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 255, 255), 2,
+1082                        cv2.LINE_AA)
+1083            ret = (gender, age, (bbox[0], bbox[1]))
+1084        b, g, r = cv2.split(frameFace)
+1085        frameFace = cv2.merge((r, g, b))
+1086        imgok = Image.fromarray(frameFace)
+1087        self.display.ShowImage(imgok)
+1088        if ret == '':
+1089            return None
+1090        else:
+1091            return ret
+1092
+1093    def rectangle(self, frame, z, colors, size):
+1094        """
+1095        Draws a rectangle on a given frame.
+1096
+1097        Parameters:
+1098            frame (numpy.ndarray): The image frame to draw on.
+1099            z (tuple): A tuple of four integers (x, y, w, h) representing the top-left corner, width, and height of the rectangle.
+1100            colors (str): The color of the rectangle in hexadecimal format (e.g., "#FF0000" for red).
+1101            size (int): The thickness of the rectangle's outline.
+1102
+1103        Returns:
+1104            numpy.ndarray: The frame with the rectangle drawn on it.
+1105        """
+1106        frame = cv2.rectangle(frame, (int(z[0]), int(z[1])), (int(z[0] + z[2]), int(z[1] + z[3])), color(colors), size)
+1107        return frame
+1108
+1109    def circle(self, frame, xy, rad, colors, tk):
+1110        """
+1111        Draws a circle on a given frame.
+1112
+1113        Parameters:
+1114            frame (numpy.ndarray): The image frame to draw on.
+1115            xy (tuple): A tuple of two integers (x, y) representing the center coordinates of the circle.
+1116            rad (int): The radius of the circle.
+1117            colors (str): The color of the circle in hexadecimal format.
+1118            tk (int): The thickness of the circle's outline. Use -1 to fill the circle.
+1119
+1120        Returns:
+1121            numpy.ndarray: The frame with the circle drawn on it.
+1122        """
+1123        frame = cv2.circle(frame, xy, rad, color(colors), tk)
+1124        return frame
+1125
+1126    def text(self, frame, text, xy, font_size, colors, size):
+1127        """
+1128        Draws text on a given frame.
+1129
+1130        Parameters:
+1131            frame (numpy.ndarray): The image frame to draw on.
+1132            text (str): The text to be drawn.
+1133            xy (tuple): A tuple of two integers (x, y) representing the top-left corner of the text.
+1134            font_size (float): The font size of the text.
+1135            colors (str): The color of the text in hexadecimal format.
+1136            size (int): The thickness of the text.
+1137
+1138        Returns:
+1139            numpy.ndarray: The frame with the text drawn on it.
+1140        """
+1141        frame = cv2.putText(frame, text, xy, cv2.FONT_HERSHEY_SIMPLEX, font_size, color(colors), size)
+1142        return frame
+1143
+1144    def SpeechRecognition(self, seconds=3):
+1145        """
+1146        Performs speech recognition using the Baidu ASR API.
+1147
+1148        Parameters:
+1149            seconds (int, optional): The duration of the audio recording in seconds. Defaults to 3.
+1150
+1151        Returns:
+1152            str: The recognized text.
+1153        """
+1154        self.xgoAudioRecord(filename="recog", seconds=seconds)
+1155        from urllib.request import urlopen
+1156        from urllib.request import Request
+1157        from urllib.error import URLError
+1158        from urllib.parse import urlencode
+1159        timer = time.perf_counter
+1160        AUDIO_FILE = 'recog.wav'
+1161        FORMAT = AUDIO_FILE[-3:]
+1162        CUID = '123456PYTHON'
+1163        RATE = 16000
+1164        DEV_PID = 1537
+1165        ASR_URL = 'http://vop.baidu.com/server_api'
+1166        SCOPE = 'audio_voice_assistant_get'
+1167
+1168        token = self.fetch_token()
+1169
+1170        speech_data = []
+1171        path = "/home/pi/xgoMusic/"
+1172        with open(path + AUDIO_FILE, 'rb') as speech_file:
+1173            speech_data = speech_file.read()
+1174
+1175        length = len(speech_data)
+1176        if length == 0:
+1177            raise DemoError('file %s length read 0 bytes' % AUDIO_FILE)
+1178        speech = base64.b64encode(speech_data)
+1179        speech = str(speech, 'utf-8')
+1180        params = {'dev_pid': DEV_PID,
+1181                  'format': FORMAT,
+1182                  'rate': RATE,
+1183                  'token': token,
+1184                  'cuid': CUID,
+1185                  'channel': 1,
+1186                  'speech': speech,
+1187                  'len': length
+1188                  }
+1189        post_data = json.dumps(params, sort_keys=False)
+1190        req = Request(ASR_URL, post_data.encode('utf-8'))
+1191        req.add_header('Content-Type', 'application/json')
+1192        try:
+1193            begin = timer()
+1194            f = urlopen(req)
+1195            result_str = f.read()
+1196            print("Request time cost %f" % (timer() - begin))
+1197        except URLError as err:
+1198            print('asr http response http code : ' + str(err.code))
+1199            result_str = err.read()
+1200        try:
+1201            result_str = str(result_str, 'utf-8')
+1202            re = json.loads(result_str)
+1203            text = re['result'][0]
+1204        except:
+1205            text = 'error!'
+1206        return text
+1207
+1208    def SpeechSynthesis(self, texts):
+1209        """
+1210        Performs speech synthesis (text-to-speech) using the Baidu TTS API.
+1211
+1212        Parameters:
+1213            texts (str): The text to be synthesized.
+1214        """
+1215        from urllib.request import urlopen
+1216        from urllib.request import Request
+1217        from urllib.error import URLError
+1218        from urllib.parse import urlencode
+1219        from urllib.parse import quote_plus
+1220
+1221        TEXT = texts
+1222        PER = 0
+1223        SPD = 5
+1224        PIT = 5
+1225        VOL = 5
+1226        AUE = 6
+1227        FORMATS = {3: "mp3", 4: "pcm", 5: "pcm", 6: "wav"}
+1228        FORMAT = FORMATS[AUE]
+1229        CUID = "123456PYTHON"
+1230        TTS_URL = 'http://tsn.baidu.com/text2audio'
+1231
+1232        SCOPE = 'audio_tts_post'
+1233
+1234        token = self.fetch_token()
+1235        tex = quote_plus(TEXT)
+1236        print(tex)
+1237        params = {'tok': token, 'tex': tex, 'per': PER, 'spd': SPD, 'pit': PIT, 'vol': VOL, 'aue': AUE, 'cuid': CUID,
+1238                  'lan': 'zh', 'ctp': 1}
+1239
+1240        data = urlencode(params)
+1241        print('test on Web Browser' + TTS_URL + '?' + data)
+1242
+1243        req = Request(TTS_URL, data.encode('utf-8'))
+1244        has_error = False
+1245        try:
+1246            f = urlopen(req)
+1247            result_str = f.read()
+1248
+1249            headers = dict((name.lower(), value) for name, value in f.headers.items())
+1250
+1251            has_error = ('content-type' not in headers.keys() or headers['content-type'].find('audio/') < 0)
+1252        except URLError as err:
+1253            print('asr http response http code : ' + str(err.code))
+1254            result_str = err.read()
+1255            has_error = True
+1256
+1257        path = "/home/pi/xgoMusic/"
+1258        save_file = "error.txt" if has_error else 'result.' + FORMAT
+1259        with open(path + save_file, 'wb') as of:
+1260            of.write(result_str)
+1261
+1262        if has_error:
+1263            result_str = str(result_str, 'utf-8')
+1264            print("tts api  error:" + result_str)
+1265
+1266        print("result saved as :" + save_file)
+1267
+1268        self.xgoSpeaker("result.wav")
+1269
+1270    def cv2AddChineseText(self, img, text, position, textColor=(0, 255, 0), textSize=30):
+1271        """
+1272        Adds Chinese text to an image using PIL, as OpenCV doesn't support Chinese characters directly.
+1273
+1274        Parameters:
+1275            img (numpy.ndarray): The image to add text to.
+1276            text (str): The Chinese text to add.
+1277            position (tuple): The (x, y) coordinates of the top-left corner of the text.
+1278            textColor (tuple, optional): The RGB color of the text. Defaults to (0, 255, 0) (green).
+1279            textSize (int, optional): The font size. Defaults to 30.
+1280
+1281        Returns:
+1282            numpy.ndarray: The image with the Chinese text added.
+1283        """
+1284        if (isinstance(img, np.ndarray)):
+1285            img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
+1286        draw = ImageDraw.Draw(img)
+1287        fontStyle = ImageFont.truetype(
+1288            "/home/pi/model/msyh.ttc", textSize, encoding="utf-8")
+1289        draw.text(position, text, textColor, font=fontStyle)
+1290        return cv2.cvtColor(np.asarray(img), cv2.COLOR_RGB2BGR)
+1291
+1292    def QRRecognition(self, target="camera"):
+1293        """
+1294        Performs QR code recognition on an image or video frame and displays the results on the LCD.
+1295
+1296        Parameters:
+1297            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1298
+1299        Returns:
+1300            list: A list of decoded QR code data strings.
+1301        """
+1302        import pyzbar.pyzbar as pyzbar
+1303        if target == "camera":
+1304            self.open_camera()
+1305            success, img = self.cap.read()
+1306        else:
+1307            path = "/home/pi/xgoPictures/"
+1308            img = np.array(Image.open(path + target))
+1309
+1310        barcodes = pyzbar.decode(img)
+1311        result = []
+1312        for barcode in barcodes:
+1313            barcodeData = barcode.data.decode("utf-8")
+1314            barcodeType = barcode.type
+1315            result.append(barcodeData)
+1316            text = "{} ({})".format(barcodeData, barcodeType)
+1317            img = self.cv2AddChineseText(img, text, (10, 30), (0, 255, 0), 30)
+1318        try:
+1319            re = result[0]
+1320        except:
+1321            result = []
+1322        b, g, r = cv2.split(img)
+1323        img = cv2.merge((r, g, b))
+1324        imgok = Image.fromarray(img)
+1325        self.display.ShowImage(imgok)
+1326        return result
+1327
+1328    def ColorRecognition(self, target="camera", mode='R'):
+1329        """
+1330        Performs color recognition on an image or video frame, identifies the largest contour of the specified color, and displays the results on the LCD.
+1331
+1332        Parameters:
+1333            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1334            mode (str, optional): The color to recognize ('R' for red, 'G' for green, 'B' for blue, 'Y' for yellow). Defaults to 'R'.
+1335
+1336        Returns:
+1337            tuple: A tuple containing the center coordinates (x, y) and radius of the largest contour of the specified color.
+1338        """
+1339        color_x = 0
+1340        color_y = 0
+1341        color_radius = 0
+1342
+1343        if mode == 'R':  # red
+1344            color_lower = np.array([0, 43, 46])
+1345            color_upper = np.array([10, 255, 255])
+1346        elif mode == 'G':  # green
+1347            color_lower = np.array([35, 43, 46])
+1348            color_upper = np.array([77, 255, 255])
+1349        elif mode == 'B':  # blue
+1350            color_lower = np.array([100, 43, 46])
+1351            color_upper = np.array([124, 255, 255])
+1352        elif mode == 'Y':  # yellow
+1353            color_lower = np.array([26, 43, 46])
+1354            color_upper = np.array([34, 255, 255])
+1355        if target == "camera":
+1356            self.open_camera()
+1357            success, frame = self.cap.read()
+1358        else:
+1359            path = "/home/pi/xgoPictures/"
+1360            frame = np.array(Image.open(path + target))
+1361        frame_ = cv2.GaussianBlur(frame, (5, 5), 0)
+1362        hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
+1363        mask = cv2.inRange(hsv, color_lower, color_upper)
+1364        mask = cv2.erode(mask, None, iterations=2)
+1365        mask = cv2.dilate(mask, None, iterations=2)
+1366        mask = cv2.GaussianBlur(mask, (3, 3), 0)
+1367        cnts = cv2.findContours(mask.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)[-2]
+1368
+1369        if len(cnts) > 0:
+1370            cnt = max(cnts, key=cv2.contourArea)
+1371            (color_x, color_y), color_radius = cv2.minEnclosingCircle(cnt)
+1372            cv2.circle(frame, (int(color_x), int(color_y)), int(color_radius), (255, 0, 255), 2)
+1373        cv2.putText(frame, "X:%d, Y%d" % (int(color_x), int(color_y)), (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.8,
+1374                    (255, 255, 0), 3)
+1375
+1376        b, g, r = cv2.split(frame)
+1377        img = cv2.merge((r, g, b))
+1378        imgok = Image.fromarray(img)
+1379        self.display.ShowImage(imgok)
+1380
+1381        return ((color_x, color_y), color_radius)
+1382
+1383    def cap_color_mask(self, position=None, scale=25, h_error=20, s_limit=[90, 255], v_limit=[90, 230]):
+1384        """
+1385        Captures a color mask from the camera feed based on a specified region and displays it on the LCD.
+1386
+1387        Parameters:
+1388            position (list, optional): The top-left corner coordinates (x, y) of the region to sample for color. Defaults to [160, 100].
+1389            scale (int, optional): The width and height of the square region to sample. Defaults to 25.
+1390            h_error (int, optional): The tolerance for hue variation. Defaults to 20.
+1391            s_limit (list, optional): The lower and upper limits for saturation. Defaults to [90, 255].
+1392            v_limit (list, optional): The lower and upper limits for value (brightness). Defaults to [90, 230].
+1393
+1394        Returns:
+1395            list: A list containing two lists, representing the lower and upper bounds of the captured color mask in HSV format.
+1396        """
+1397        if position is None:
+1398            position = [160, 100]
+1399        count = 0
+1400        self.open_camera()
+1401        while True:
+1402            if self.xgoButton("c"):
+1403                break
+1404            success, frame = self.cap.read()
+1405            b, g, r = cv2.split(frame)
+1406            frame_bgr = cv2.merge((r, g, b))
+1407            hsv = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2HSV)
+1408            h, s, v = cv2.split(hsv)
+1409            color = np.mean(h[position[1]:position[1] + scale, position[0]:position[0] + scale])
+1410            if self.xgoButton("b") and count == 0:
+1411                count += 1
+1412                color = np.mean(h[position[1]:position[1] + scale, position[0]:position[0] + scale])
+1413                color_lower = [max(color - h_error, 0), s_limit[0], v_limit[0]]
+1414                color_upper = [min(color + h_error, 255), s_limit[1], v_limit[1]]
+1415                return [color_lower, color_upper]
+1416
+1417            if count == 0:
+1418                cv2.rectangle(frame, (position[0], position[1]), (position[0] + scale, position[1] + scale),
+1419                              (255, 255, 255), 2)
+1420                cv2.putText(frame, 'press button B', (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
+1421            b, g, r = cv2.split(frame)
+1422            img = cv2.merge((r, g, b))
+1423            imgok = Image.fromarray(img)
+1424            self.display.ShowImage(imgok)
+1425
+1426    def filter_img(self, frame, color):
+1427        """
+1428        Applies a color mask to an image frame, isolating the specified color.
+1429
+1430        Parameters:
+1431            frame (numpy.ndarray): The input image frame.
+1432            color (list or str): The color to filter. Can be a list of two lists representing the lower and upper bounds of the color mask in HSV format, or a string representing a predefined color ('red', 'green', 'blue', 'yellow').
+1433
+1434        Returns:
+1435            numpy.ndarray: The image frame with the color mask applied.
+1436        """
+1437        b, g, r = cv2.split(frame)
+1438        frame_bgr = cv2.merge((r, g, b))
+1439        hsv = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2HSV)
+1440        if isinstance(color, list):
+1441            color_lower = np.array(color[0])
+1442            color_upper = np.array(color[1])
+1443        else:
+1444            color_upper, color_lower = get_color_mask(color)
+1445        mask = cv2.inRange(hsv, color_lower, color_upper)
+1446        img_mask = cv2.bitwise_and(frame, frame, mask=mask)
+1447        return img_mask
+1448
+1449    def BallRecognition(self, color_mask, target="camera", p1=36, p2=15, minR=6, maxR=35):
+1450        """
+1451        Detects and tracks a ball of a specific color in an image or video frame using Hough Circle Transform.
+1452
+1453        Parameters:
+1454            color_mask (list): A list of two lists, representing the lower and upper bounds of the ball's color in HSV format.
+1455            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1456            p1 (int, optional): The higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller). Defaults to 36.
+1457            p2 (int, optional): The accumulator threshold for the circle centers at the detection stage. Defaults to 15.
+1458            minR (int, optional): The minimum circle radius. Defaults to 6.
+1459            maxR (int, optional): The maximum circle radius. Defaults to 35.
+1460
+1461        Returns:
+1462            tuple: A tuple containing the x-coordinate, y-coordinate, and radius of the detected ball.
+1463        """
+1464        x = y = ra = 0
+1465        if target == "camera":
+1466            self.open_camera()
+1467            success, image = self.cap.read()
+1468        else:
+1469            path = "/home/pi/xgoPictures/"
+1470            image = np.array(Image.open(path + target))
+1471
+1472        frame_mask = self.filter_img(image, color_mask)
+1473
+1474        img = cv2.medianBlur(frame_mask, 5)
+1475        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+1476
+1477        circles = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, 20, param1=p1, param2=p2, minRadius=minR, maxRadius=maxR)
+1478        b, g, r = cv2.split(image)
+1479        image = cv2.merge((r, g, b))
+1480        if circles is not None and len(circles[0]) == 1:
+1481            param = circles[0][0]
+1482            x, y, ra = int(param[0]), int(param[1]), int(param[2])
+1483            cv2.circle(image, (x, y), ra, (255, 255, 255), 2)
+1484            cv2.circle(image, (x, y), 2, (255, 255, 255), 2)
+1485        imgok = Image.fromarray(image)
+1486        self.display.ShowImage(imgok)
+1487        return x, y, ra
+1488
+1489class DemoError(Exception):
+1490    """
+1491    A custom exception class for errors related to the Baidu AI API.
+1492    """
+1493    pass
+1494
+1495class hands():
+1496    """
+1497    A class for hand detection and landmark estimation using MediaPipe.
+1498    """
+1499    def __init__(self, model_complexity, max_num_hands, min_detection_confidence, min_tracking_confidence):
+1500        """
+1501        Initializes the hands object.
+1502
+1503        Parameters:
+1504            model_complexity (int): Complexity of the hand landmark model: 0 or 1.
+1505            max_num_hands (int): Maximum number of hands to detect.
+1506            min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for hand detection to be considered successful.
+1507            min_tracking_confidence (float): Minimum confidence value ([0.0, 1.0]) for the hand landmarks to be considered tracked successfully.
+1508        """
+1509        import mediapipe as mp
+1510        self.model_complexity = model_complexity
+1511        self.max_num_hands = max_num_hands
+1512        self.min_detection_confidence = min_detection_confidence
+1513        self.min_tracking_confidence = min_tracking_confidence
+1514        self.mp_hands = mp.solutions.hands
+1515        self.hands = self.mp_hands.Hands(
+1516            max_num_hands=self.max_num_hands,
+1517            min_detection_confidence=self.min_detection_confidence,
+1518            min_tracking_confidence=self.min_tracking_confidence,
+1519        )
+1520
+1521    def run(self, cv_img):
+1522        """
+1523        Processes an image and returns hand landmarks and other related information.
+1524
+1525        Parameters:
+1526            cv_img (numpy.ndarray): The input image.
+1527
+1528        Returns:
+1529            list: A list of dictionaries, where each dictionary contains information about a detected hand, including center coordinates, bounding rectangle, landmark coordinates, hand angles, and right/left classification.
+1530        """
+1531        import copy
+1532        image = cv_img
+1533        debug_image = copy.deepcopy(image)
+1534        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+1535        results = self.hands.process(image)
+1536        hf = []
+1537        if results.multi_hand_landmarks is not None:
+1538            for hand_landmarks, handedness in zip(results.multi_hand_landmarks,
+1539                                                  results.multi_handedness):
+1540                # Calculate the center of the palm
+1541                cx, cy = self.calc_palm_moment(debug_image, hand_landmarks)
+1542                # Calculate the bounding rectangle of the hand
+1543                rect = self.calc_bounding_rect(debug_image, hand_landmarks)
+1544                # Get individual landmarks
+1545                dlandmark = self.dlandmarks(debug_image, hand_landmarks, handedness)
+1546
+1547                hf.append({'center': (cx, cy), 'rect': rect, 'dlandmark': dlandmark[0],
+1548                           'hand_angle': self.hand_angle(dlandmark[0]), 'right_left': dlandmark[1]})
+1549        return hf
+1550
+1551    def calc_palm_moment(self, image, landmarks):
+1552        """
+1553        Calculates the moment (center) of the palm.
+1554
+1555        Parameters:
+1556            image (numpy.ndarray): The input image.
+1557            landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.
+1558
+1559        Returns:
+1560            tuple: The (x, y) coordinates of the palm's center.
+1561        """
+1562        image_width, image_height = image.shape[1], image.shape[0]
+1563        palm_array = np.empty((0, 2), int)
+1564        for index, landmark in enumerate(landmarks.landmark):
+1565            landmark_x = min(int(landmark.x * image_width), image_width - 1)
+1566            landmark_y = min(int(landmark.y * image_height), image_height - 1)
+1567            landmark_point = [np.array((landmark_x, landmark_y))]
+1568            if index == 0:  # Wrist 1
+1569                palm_array = np.append(palm_array, landmark_point, axis=0)
+1570            if index == 1:  # Wrist 2
+1571                palm_array = np.append(palm_array, landmark_point, axis=0)
+1572            if index == 5:  # Index finger: base
+1573                palm_array = np.append(palm_array, landmark_point, axis=0)
+1574            if index == 9:  # Middle finger: base
+1575                palm_array = np.append(palm_array, landmark_point, axis=0)
+1576            if index == 13:  # Ring finger: base
+1577                palm_array = np.append(palm_array, landmark_point, axis=0)
+1578            if index == 17:  # Pinky finger: base
+1579                palm_array = np.append(palm_array, landmark_point, axis=0)
+1580        M = cv2.moments(palm_array)
+1581        cx, cy = 0, 0
+1582        if M['m00'] != 0:
+1583            cx = int(M['m10'] / M['m00'])
+1584            cy = int(M['m01'] / M['m00'])
+1585        return cx, cy
+1586
+1587    def calc_bounding_rect(self, image, landmarks):
+1588        """
+1589        Calculates the bounding rectangle of the hand.
+1590
+1591        Parameters:
+1592            image (numpy.ndarray): The input image.
+1593            landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.
+1594
+1595        Returns:
+1596            list: A list [x, y, w, h] representing the bounding rectangle.
+1597        """
+1598        image_width, image_height = image.shape[1], image.shape[0]
+1599        landmark_array = np.empty((0, 2), int)
+1600        for _, landmark in enumerate(landmarks.landmark):
+1601            landmark_x = min(int(landmark.x * image_width), image_width - 1)
+1602            landmark_y = min(int(landmark.y * image_height), image_height - 1)
+1603            landmark_point = [np.array((landmark_x, landmark_y))]
+1604            landmark_array = np.append(landmark_array, landmark_point, axis=0)
+1605        x, y, w, h = cv2.boundingRect(landmark_array)
+1606        return [x, y, w, h]
+1607
+1608    def dlandmarks(self, image, landmarks, handedness):
+1609        """
+1610        Extracts and returns the coordinates of hand landmarks.
+1611
+1612        Parameters:
+1613            image (numpy.ndarray): The input image.
+1614            landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.
+1615            handedness (mediapipe.framework.formats.classification_pb2.ClassificationList): Handedness information.
+1616
+1617        Returns:
+1618            tuple: A tuple containing a list of landmark coordinates and the handedness label ('Right' or 'Left').
+1619        """
+1620        image_width, image_height = image.shape[1], image.shape[0]
+1621        landmark_point = []
+1622        for index, landmark in enumerate(landmarks.landmark):
+1623            if landmark.visibility < 0 or landmark.presence < 0:
+1624                continue
+1625            landmark_x = min(int(landmark.x * image_width), image_width - 1)
+1626            landmark_y = min(int(landmark.y * image_height), image_height - 1)
+1627            landmark_point.append((landmark_x, landmark_y))
+1628        return landmark_point, handedness.classification[0].label[0]
+1629
+1630    def vector_2d_angle(self, v1, v2):
+1631        """
+1632        Calculates the angle between two 2D vectors.
+1633
+1634        Parameters:
+1635            v1 (tuple): The first vector (x, y).
+1636            v2 (tuple): The second vector (x, y).
+1637
+1638        Returns:
+1639            float: The angle between the two vectors in degrees.
+1640        """
+1641        v1_x = v1[0]
+1642        v1_y = v1[1]
+1643        v2_x = v2[0]
+1644        v2_y = v2[1]
+1645        try:
+1646            angle_ = math.degrees(math.acos((v1_x * v2_x + v1_y * v2_y) / (((v1_x ** 2 + v1_y ** 2) ** 0.5) * ((v2_x ** 2 + v2_y ** 2) ** 0.5))))
+1647        except:
+1648            angle_ = 180
+1649        return angle_
+1650
+1651    def hand_angle(self, hand_):
+1652        """
+1653        Calculates the angles of the fingers.
+1654
+1655        Parameters:
+1656            hand_ (list): A list of hand landmark coordinates.
+1657
+1658        Returns:
+1659            list: A list of finger angles (thumb, index, middle, ring, pinky).
+1660        """
+1661        angle_list = []
+1662        # thumb Thumb angle
+1663        angle_ = self.vector_2d_angle(
+1664            ((int(hand_[0][0]) - int(hand_[2][0])), (int(hand_[0][1]) - int(hand_[2][1]))),
+1665            ((int(hand_[3][0]) - int(hand_[4][0])), (int(hand_[3][1]) - int(hand_[4][1])))
+1666        )
+1667        angle_list.append(angle_)
+1668        # index Index finger angle
+1669        angle_ = self.vector_2d_angle(
+1670            ((int(hand_[0][0]) - int(hand_[6][0])), (int(hand_[0][1]) - int(hand_[6][1]))),
+1671            ((int(hand_[7][0]) - int(hand_[8][0])), (int(hand_[7][1]) - int(hand_[8][1])))
+1672        )
+1673        angle_list.append(angle_)
+1674        # middle Middle finger angle
+1675        angle_ = self.vector_2d_angle(
+1676            ((int(hand_[0][0]) - int(hand_[10][0])), (int(hand_[0][1]) - int(hand_[10][1]))),
+1677            ((int(hand_[11][0]) - int(hand_[12][0])), (int(hand_[11][1]) - int(hand_[12][1])))
+1678        )
+1679        angle_list.append(angle_)
+1680        # ring Ring finger angle
+1681        angle_ = self.vector_2d_angle(
+1682            ((int(hand_[0][0]) - int(hand_[14][0])), (int(hand_[0][1]) - int(hand_[14][1]))),
+1683            ((int(hand_[15][0]) - int(hand_[16][0])), (int(hand_[15][1]) - int(hand_[16][1])))
+1684        )
+1685        angle_list.append(angle_)
+1686        # pink Pinky finger angle
+1687        angle_ = self.vector_2d_angle(
+1688            ((int(hand_[0][0]) - int(hand_[18][0])), (int(hand_[0][1]) - int(hand_[18][1]))),
+1689            ((int(hand_[19][0]) - int(hand_[20][0])), (int(hand_[19][1]) - int(hand_[20][1])))
+1690        )
+1691        angle_list.append(angle_)
+1692        return angle_list
+1693
+1694class yoloXgo():
+1695    """
+1696    A class for object detection using YOLO (You Only Look Once) models with ONNX Runtime.
+1697    """
+1698    def __init__(self, model, classes, inputwh, thresh):
+1699        """
+1700        Initializes the yoloXgo object.
+1701
+1702        Parameters:
+1703            model (str): The path to the ONNX model file.
+1704            classes (list): A list of class names.
+1705            inputwh (list): A list [width, height] representing the input size of the model.
+1706            thresh (float): The confidence threshold for object detection.
+1707        """
+1708        import onnxruntime
+1709        self.session = onnxruntime.InferenceSession(model)
+1710        self.input_width = inputwh[0]
+1711        self.input_height = inputwh[1]
+1712        self.thresh = thresh
+1713        self.classes = classes
+1714
+1715    def sigmoid(self, x):
+1716        """
+1717        Computes the sigmoid function.
+1718
+1719        Parameters:
+1720            x (float or numpy.ndarray): The input value.
+1721
+1722        Returns:
+1723            float or numpy.ndarray: The sigmoid of the input.
+1724        """
+1725        return 1. / (1 + np.exp(-x))
+1726
+1727    # tanh function
+1728    def tanh(self, x):
+1729        """
+1730        Computes the hyperbolic tangent function.
+1731
+1732        Parameters:
+1733            x (float or numpy.ndarray): The input value.
+1734
+1735        Returns:
+1736            float or numpy.ndarray: The hyperbolic tangent of the input.
+1737        """
+1738        return 2. / (1 + np.exp(-2 * x)) - 1
+1739
+1740    # Data preprocessing
+1741    def preprocess(self, src_img, size):
+1742        """
+1743        Preprocesses the input image for the YOLO model.
+1744
+1745        Parameters:
+1746            src_img (numpy.ndarray): The input image.
+1747            size (list): A list [width, height] representing the target size.
+1748
+1749        Returns:
+1750            numpy.ndarray: The preprocessed image data.
+1751        """
+1752        output = cv2.resize(src_img, (size[0], size[1]), interpolation=cv2.INTER_AREA)
+1753        output = output.transpose(2, 0, 1)
+1754        output = output.reshape((1, 3, size[1], size[0])) / 255
+1755        return output.astype('float32')
+1756
+1757        # nms algorithm
+1758
+1759    def nms(self, dets, thresh=0.45):
+1760        """
+1761        Performs Non-Maximum Suppression (NMS) to filter out overlapping bounding boxes.
+1762
+1763        Parameters:
+1764            dets (numpy.ndarray): An array of bounding boxes with shape (N, 6), where N is the number of boxes, and each box is represented as [x1, y1, x2, y2, score, class_index].
+1765            thresh (float, optional): The IoU (Intersection over Union) threshold for suppression. Defaults to 0.45.
+1766
+1767        Returns:
+1768            list: A list of filtered bounding boxes, each represented as [x1, y1, x2, y2, score, class_index].
+1769        """
+1770        # dets:N*M,N is the number of bbox, the first 4 digits of M are the corresponding (x1, y1, x2, y2), and the 5th digit is the corresponding score
+1771        # #thresh:0.3,0.5....
+1772        x1 = dets[:, 0]
+1773        y1 = dets[:, 1]
+1774        x2 = dets[:, 2]
+1775        y2 = dets[:, 3]
+1776        scores = dets[:, 4]
+1777        areas = (x2 - x1 + 1) * (y2 - y1 + 1)  # Calculate the area of each bbox
+1778        order = scores.argsort()[::-1]  # Sort scores in descending order
+1779        keep = []  # Used to store the bboxx subscripts that are finally retained
+1780
+1781        while order.size > 0:
+1782            i = order[0]  # Unconditionally keep the bbox with the highest confidence in each iteration
+1783            keep.append(i)
+1784
+1785            # Calculate the intersection area between the bbox with the highest confidence and the other remaining bboxes
+1786            xx1 = np.maximum(x1[i], x1[order[1:]])
+1787            yy1 = np.maximum(y1[i], y1[order[1:]])
+1788            xx2 = np.minimum(x2[i], x2[order[1:]])
+1789            yy2 = np.minimum(y2[i], y2[order[1:]])
+1790
+1791            # Calculate the area of the intersection area between the high-confidence bbox and the other remaining bboxes
+1792            w = np.maximum(0.0, xx2 - xx1 + 1)
+1793            h = np.maximum(0.0, yy2 - yy1 + 1)
+1794            inter = w * h
+1795
+1796            # Calculate the ratio of the area of the intersection area to the area of both (the bbox with high confidence and other bboxes)
+1797            ovr = inter / (areas[i] + areas[order[1:]] - inter)
+1798
+1799            # Keep the bbox whose ovr is less than thresh and enter the next iteration.
+1800            inds = np.where(ovr <= thresh)[0]
+1801
+1802            # Because the index in ovr does not include order[0], it needs to be moved one bit backward
+1803            order = order[inds + 1]
+1804
+1805        output = []
+1806        for i in keep:
+1807            output.append(dets[i].tolist())
+1808
+1809        return output
+1810
+1811    def run(self, img, ):
+1812        """
+1813        Runs object detection on an image using the YOLO model.
+1814
+1815        Parameters:
+1816            img (numpy.ndarray): The input image.
+1817
+1818        Returns:
+1819            list or bool: A list of dictionaries, where each dictionary represents a detected object and contains the class name, confidence score, and bounding box coordinates. Returns False if no objects are detected.
+1820        """
+1821        pred = []
+1822
+1823        # Original width and height of the input image
+1824        H, W, _ = img.shape
+1825
+1826        # Data preprocessing: resize, 1/255
+1827        data = self.preprocess(img, [self.input_width, self.input_height])
+1828
+1829        # Model inference
+1830        input_name = self.session.get_inputs()[0].name
+1831        feature_map = self.session.run([], {input_name: data})[0][0]
+1832
+1833        # Output feature map transpose: CHW, HWC
+1834        feature_map = feature_map.transpose(1, 2, 0)
+1835        # The width and height of the output feature map
+1836        feature_map_height = feature_map.shape[0]
+1837        feature_map_width = feature_map.shape[1]
+1838
+1839        # Feature map post-processing
+1840        for h in range(feature_map_height):
+1841            for w in range(feature_map_width):
+1842                data = feature_map[h][w]
+1843
+1844                # Resolve detection frame confidence
+1845                obj_score, cls_score = data[0], data[5:].max()
+1846                score = (obj_score ** 0.6) * (cls_score ** 0.4)
+1847
+1848                # Threshold screening
+1849                if score > self.thresh:
+1850                    # Detection frame category
+1851                    cls_index = np.argmax(data[5:])
+1852                    # Detection frame center point offset
+1853                    x_offset, y_offset = self.tanh(data[1]), self.tanh(data[2])
+1854                    # Normalized width and height of the detection frame
+1855                    box_width, box_height = self.sigmoid(data[3]), self.sigmoid(data[4])
+1856                    # The center point after normalization of the detection frame
+1857                    box_cx = (w + x_offset) / feature_map_width
+1858                    box_cy = (h + y_offset) / feature_map_height
+1859
+1860                    # cx,cy,w,h => x1, y1, x2, y2
+1861                    x1, y1 = box_cx - 0.5 * box_width, box_cy - 0.5 * box_height
+1862                    x2, y2 = box_cx + 0.5 * box_width, box_cy + 0.5 * box_height
+1863                    x1, y1, x2, y2 = int(x1 * W), int(y1 * H), int(x2 * W), int(y2 * H)
+1864
+1865                    pred.append([x1, y1, x2, y2, score, cls_index])
+1866        datas = np.array(pred)
+1867        data = []
+1868        if len(datas) > 0:
+1869            boxes = self.nms(datas)
+1870            for b in boxes:
+1871                obj_score, cls_index = b[4], int(b[5])
+1872                x1, y1, x2, y2 = int(b[0]), int(b[1]), int(b[2]), int(b[3])
+1873                s = {'classes': self.classes[cls_index], 'score': '%.2f' % obj_score, 'xywh': [x1, y1, x2 - x1, y2 - y1], }
+1874                data.append(s)
+1875            return data
+1876        else:
+1877            return False
+1878
+1879class face_detection():
+1880    """
+1881    A class for face detection using MediaPipe.
+1882    """
+1883    def __init__(self, min_detection_confidence):
+1884        """
+1885        Initializes the face_detection object.
+1886
+1887        Parameters:
+1888            min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for face detection to be considered successful.
+1889        """
+1890        import mediapipe as mp
+1891        self.model_selection = 0
+1892        self.min_detection_confidence = min_detection_confidence
+1893        self.mp_face_detection = mp.solutions.face_detection
+1894        self.face_detection = self.mp_face_detection.FaceDetection(
+1895            min_detection_confidence=self.min_detection_confidence,
+1896        )
+1897
+1898    def run(self, cv_img):
+1899        """
+1900        Performs face detection on an image.
+1901
+1902        Parameters:
+1903            cv_img (numpy.ndarray): The input image.
+1904
+1905        Returns:
+1906            list: A list of dictionaries, where each dictionary contains information about a detected face, including bounding box coordinates and landmark coordinates.
+1907        """
+1908        image = cv_img
+1909        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+1910        results = self.face_detection.process(cv_img)
+1911        face = []
+1912        if results.detections is not None:
+1913            for detection in results.detections:
+1914                data = self.draw_detection(image, detection)
+1915                face.append(data)
+1916        return face
+1917
+1918    def draw_detection(self, image, detection):
+1919        """
+1920        Extracts face detection information and returns it as a dictionary.
+1921
+1922        Parameters:
+1923            image (numpy.ndarray): The input image.
+1924            detection (mediapipe.framework.formats.detection_pb2.Detection): Face detection result.
+1925
+1926        Returns:
+1927            dict: A dictionary containing face detection information, including label ID, confidence score, bounding box coordinates, and landmark coordinates.
+1928        """
+1929        image_width, image_height = image.shape[1], image.shape[0]
+1930        bbox = detection.location_data.relative_bounding_box
+1931        bbox.xmin = int(bbox.xmin * image_width)
+1932        bbox.ymin = int(bbox.ymin * image_height)
+1933        bbox.width = int(bbox.width * image_width)
+1934        bbox.height = int(bbox.height * image_height)
+1935
+1936        # Position: right eye
+1937        keypoint0 = detection.location_data.relative_keypoints[0]
+1938        keypoint0.x = int(keypoint0.x * image_width)
+1939        keypoint0.y = int(keypoint0.y * image_height)
+1940
+1941        # Position: left eye
+1942        keypoint1 = detection.location_data.relative_keypoints[1]
+1943        keypoint1.x = int(keypoint1.x * image_width)
+1944        keypoint1.y = int(keypoint1.y * image_height)
+1945
+1946        # Position: nose
+1947        keypoint2 = detection.location_data.relative_keypoints[2]
+1948        keypoint2.x = int(keypoint2.x * image_width)
+1949        keypoint2.y = int(keypoint2.y * image_height)
+1950
+1951        # Position: mouth
+1952        keypoint3 = detection.location_data.relative_keypoints[3]
+1953        keypoint3.x = int(keypoint3.x * image_width)
+1954        keypoint3.y = int(keypoint3.y * image_height)
+1955
+1956        # Position: right ear
+1957        keypoint4 = detection.location_data.relative_keypoints[4]
+1958        keypoint4.x = int(keypoint4.x * image_width)
+1959        keypoint4.y = int(keypoint4.y * image_height)
+1960
+1961        # Position: left ear
+1962        keypoint5 = detection.location_data.relative_keypoints[5]
+1963        keypoint5.x = int(keypoint5.x * image_width)
+1964        keypoint5.y = int(keypoint5.y * image_height)
+1965
+1966        data = {'id': detection.label_id[0],
+1967                'score': round(detection.score[0], 3),
+1968                'rect': [int(bbox.xmin), int(bbox.ymin), int(bbox.width), int(bbox.height)],
+1969                'right_eye': (int(keypoint0.x), int(keypoint0.y)),
+1970                'left_eye': (int(keypoint1.x), int(keypoint1.y)),
+1971                'nose': (int(keypoint2.x), int(keypoint2.y)),
+1972                'mouth': (int(keypoint3.x), int(keypoint3.y)),
+1973                'right_ear': (int(keypoint4.x), int(keypoint4.y)),
+1974                'left_ear': (int(keypoint5.x), int(keypoint5.y)),
+1975                }
+1976        return data
+
+ + +
+
+
+ camera_still = +False + + +
+ + +

Face detection

+
+ + +
+
+ +
+ + def + getFaceBox(net, frame, conf_threshold=0.7): + + + +
+ +
31def getFaceBox(net, frame, conf_threshold=0.7):
+32    """
+33    Detects faces in a given frame using a pre-trained deep neural network.
+34
+35    Parameters:
+36        net (cv2.dnn.Net): The pre-trained face detection model.
+37        frame (numpy.ndarray): The input image frame.
+38        conf_threshold (float, optional): The minimum confidence threshold for a detection to be considered a face. Defaults to 0.7.
+39
+40    Returns:
+41        tuple: A tuple containing the frame with detected faces and a list of bounding boxes.
+42            - frameOpencvDnn (numpy.ndarray): The frame with bounding boxes drawn around detected faces.
+43            - bboxes (list): A list of bounding boxes, where each bounding box is represented as [x1, y1, x2, y2].
+44    """
+45    frameOpencvDnn = frame.copy()
+46    frameHeight = frameOpencvDnn.shape[0]
+47    frameWidth = frameOpencvDnn.shape[1]
+48    blob = cv2.dnn.blobFromImage(frameOpencvDnn, 1.0, (300, 300), [104, 117, 123], True, False)
+49    net.setInput(blob)
+50    detections = net.forward()
+51    bboxes = []
+52    for i in range(detections.shape[2]):
+53        confidence = detections[0, 0, i, 2]
+54        if confidence > conf_threshold:
+55            x1 = int(detections[0, 0, i, 3] * frameWidth)
+56            y1 = int(detections[0, 0, i, 4] * frameHeight)
+57            x2 = int(detections[0, 0, i, 5] * frameWidth)
+58            y2 = int(detections[0, 0, i, 6] * frameHeight)
+59            bboxes.append([x1, y1, x2, y2])
+60            cv2.rectangle(frameOpencvDnn, (x1, y1), (x2, y2), (0, 255, 0), int(round(frameHeight / 150)), 8)
+61    return frameOpencvDnn, bboxes
+
+ + +

Detects faces in a given frame using a pre-trained deep neural network.

+ +

Parameters: + net (cv2.dnn.Net): The pre-trained face detection model. + frame (numpy.ndarray): The input image frame. + conf_threshold (float, optional): The minimum confidence threshold for a detection to be considered a face. Defaults to 0.7.

+ +

Returns: + tuple: A tuple containing the frame with detected faces and a list of bounding boxes. + - frameOpencvDnn (numpy.ndarray): The frame with bounding boxes drawn around detected faces. + - bboxes (list): A list of bounding boxes, where each bounding box is represented as [x1, y1, x2, y2].

+
+ + +
+
+ +
+ + def + hand_pos(angle): + + + +
+ +
 66def hand_pos(angle):
+ 67    """
+ 68    Recognizes hand gestures based on finger angles.
+ 69
+ 70    Parameters:
+ 71        angle (list): A list of 5 finger angles (thumb, index, middle, ring, pinky).
+ 72
+ 73    Returns:
+ 74        str or None: The recognized hand gesture ('Good', 'Ok', 'Rock', 'Stone', '1', '3', '4', '5', '2') or None if no gesture is recognized.
+ 75    """
+ 76    pos = None
+ 77    # Thumb angle
+ 78    f1 = angle[0]
+ 79    # Index finger angle
+ 80    f2 = angle[1]
+ 81    # Middle finger angle
+ 82    f3 = angle[2]
+ 83    # Ring finger angle
+ 84    f4 = angle[3]
+ 85    # Pinky finger angle
+ 86    f5 = angle[4]
+ 87    if f1 < 50 and (f2 >= 50 and (f3 >= 50 and (f4 >= 50 and f5 >= 50))):
+ 88        pos = 'Good'
+ 89    elif f1 < 50 and (f2 >= 50 and (f3 < 50 and (f4 < 50 and f5 < 50))):
+ 90        pos = 'Ok'
+ 91    elif f1 < 50 and (f2 < 50 and (f3 >= 50 and (f4 >= 50 and f5 < 50))):
+ 92        pos = 'Rock'
+ 93    elif f1 >= 50 and (f2 >= 50 and (f3 >= 50 and (f4 >= 50 and f5 >= 50))):
+ 94        pos = 'Stone'
+ 95    elif f1 >= 50 and (f2 < 50 and (f3 >= 50 and (f4 >= 50 and f5 >= 50))):
+ 96        pos = '1'
+ 97    elif f1 >= 50 and (f2 < 50 and (f3 < 50 and (f4 < 50 and f5 >= 50))):
+ 98        pos = '3'
+ 99    elif f1 >= 50 and (f2 < 50 and (f3 < 50 and (f4 < 50 and f5 < 50))):
+100        pos = '4'
+101    elif f1 < 50 and (f2 < 50 and (f3 < 50 and (f4 < 50 and f5 < 50))):
+102        pos = '5'
+103    elif f1 >= 50 and (f2 < 50 and (f3 < 50 and (f4 >= 50 and f5 >= 50))):
+104        pos = '2'
+105    return pos
+
+ + +

Recognizes hand gestures based on finger angles.

+ +

Parameters: + angle (list): A list of 5 finger angles (thumb, index, middle, ring, pinky).

+ +

Returns: + str or None: The recognized hand gesture ('Good', 'Ok', 'Rock', 'Stone', '1', '3', '4', '5', '2') or None if no gesture is recognized.

+
+ + +
+
+ +
+ + def + color(value): + + + +
+ +
107def color(value):
+108    """
+109    Converts a color value between hexadecimal and RGB tuple formats.
+110
+111    Parameters:
+112        value (str or tuple): The color value to convert. 
+113            - If a string, it should be a hexadecimal color code (e.g., '#FF0000').
+114            - If a tuple, it should be an RGB tuple (e.g., (255, 0, 0)).
+115
+116    Returns:
+117        str or tuple: The converted color value.
+118            - If the input is a tuple, the output is a hexadecimal color string.
+119            - If the input is a string, the output is an RGB tuple.
+120    """
+121    digit = list(map(str, range(10))) + list("ABCDEF")
+122    value = value.upper()
+123    if isinstance(value, tuple):
+124        string = '#'
+125        for i in value:
+126            a1 = i // 16
+127            a2 = i % 16
+128            string += digit[a1] + digit[a2]
+129        return string
+130    elif isinstance(value, str):
+131        a1 = digit.index(value[1]) * 16 + digit.index(value[2])
+132        a2 = digit.index(value[3]) * 16 + digit.index(value[4])
+133        a3 = digit.index(value[5]) * 16 + digit.index(value[6])
+134        return (a3, a2, a1)
+
+ + +

Converts a color value between hexadecimal and RGB tuple formats.

+ +

Parameters: + value (str or tuple): The color value to convert. + - If a string, it should be a hexadecimal color code (e.g., '#FF0000'). + - If a tuple, it should be an RGB tuple (e.g., (255, 0, 0)).

+ +

Returns: + str or tuple: The converted color value. + - If the input is a tuple, the output is a hexadecimal color string. + - If the input is a string, the output is an RGB tuple.

+
+ + +
+
+ +
+ + class + XGOEDU: + + + +
+ +
 136class XGOEDU():
+ 137    """
+ 138    A class for controlling and interacting with the XGO robot's educational features, including the LCD display, camera, and various AI functions.
+ 139    """
+ 140    def __init__(self):
+ 141        """
+ 142        Initializes the XGOEDU object, setting up the LCD display, GPIO pins, and various attributes.
+ 143        """
+ 144        self.display = LCD_2inch.LCD_2inch()
+ 145        self.display.Init()
+ 146        self.display.clear()
+ 147        self.splash = Image.new("RGB", (320, 240), "black")
+ 148        self.display.ShowImage(self.splash)
+ 149        self.draw = ImageDraw.Draw(self.splash)
+ 150        self.font = ImageFont.truetype("/home/pi/model/msyh.ttc", 15)
+ 151        self.key1 = 17
+ 152        self.key2 = 22
+ 153        self.key3 = 23
+ 154        self.key4 = 24
+ 155        self.cap = None
+ 156        self.hand = None
+ 157        self.yolo = None
+ 158        self.face = None
+ 159        self.face_classifier = None
+ 160        self.classifier = None
+ 161        self.agesexmark = None
+ 162        self.camera_still = False
+ 163        GPIO.setup(self.key1, GPIO.IN, GPIO.PUD_UP)
+ 164        GPIO.setup(self.key2, GPIO.IN, GPIO.PUD_UP)
+ 165        GPIO.setup(self.key3, GPIO.IN, GPIO.PUD_UP)
+ 166        GPIO.setup(self.key4, GPIO.IN, GPIO.PUD_UP)
+ 167
+ 168    def open_camera(self):
+ 169        """
+ 170        Opens the camera if it's not already open.
+ 171        """
+ 172        if self.cap == None:
+ 173            self.cap = cv2.VideoCapture(0)
+ 174            self.cap.set(3, 320)
+ 175            self.cap.set(4, 240)
+ 176
+ 177    def fetch_token(self):
+ 178        """
+ 179        Fetches an access token from the Baidu AI platform.
+ 180
+ 181        Returns:
+ 182            str: The access token.
+ 183
+ 184        Raises:
+ 185            DemoError: If the API key or secret key is incorrect, or if the scope is not correct.
+ 186        """
+ 187        from urllib.request import urlopen
+ 188        from urllib.request import Request
+ 189        from urllib.error import URLError
+ 190        from urllib.parse import urlencode
+ 191        API_KEY = 'Q4ZgU8bfnhA8HQFnNucBO2ut'
+ 192        SECRET_KEY = 'MqFrVgdwoM8ZuGIp0NIFF7qfYti4mjP6'
+ 193        TOKEN_URL = 'http://aip.baidubce.com/oauth/2.0/token'
+ 194        params = {'grant_type': 'client_credentials',
+ 195                  'client_id': API_KEY,
+ 196                  'client_secret': SECRET_KEY}
+ 197        post_data = urlencode(params)
+ 198        post_data = post_data.encode('utf-8')
+ 199        req = Request(TOKEN_URL, post_data)
+ 200        try:
+ 201            f = urlopen(req)
+ 202            result_str = f.read()
+ 203        except URLError as err:
+ 204            print('token http response http code : ' + str(err.code))
+ 205            result_str = err.read()
+ 206        result_str = result_str.decode()
+ 207
+ 208        # print(result_str)
+ 209        result = json.loads(result_str)
+ 210        # print(result)
+ 211        SCOPE = False
+ 212        if ('access_token' in result.keys() and 'scope' in result.keys()):
+ 213            # print(SCOPE)
+ 214            if SCOPE and (not SCOPE in result['scope'].split(' ')):  # SCOPE = False ignore check
+ 215                raise DemoError('scope is not correct')
+ 216            # print('SUCCESS WITH TOKEN: %s  EXPIRES IN SECONDS: %s' % (result['access_token'], result['expires_in']))
+ 217            return result['access_token']
+ 218        else:
+ 219            raise DemoError('MAYBE API_KEY or SECRET_KEY not correct: access_token or scope not found in token response')
+ 220
+ 221    # draw a straight line
+ 222    '''
+ 223    x1, y1 are the initial point coordinates, x2, y2 are the end point coordinates
+ 224    '''
+ 225    def lcd_line(self, x1, y1, x2, y2, color="WHITE", width=2):
+ 226        """
+ 227        Draws a straight line on the LCD display.
+ 228
+ 229        Parameters:
+ 230            x1 (int): The x-coordinate of the starting point.
+ 231            y1 (int): The y-coordinate of the starting point.
+ 232            x2 (int): The x-coordinate of the ending point.
+ 233            y2 (int): The y-coordinate of the ending point.
+ 234            color (str, optional): The color of the line. Defaults to "WHITE".
+ 235            width (int, optional): The width of the line. Defaults to 2.
+ 236        """
+ 237        self.draw.line([(x1, y1), (x2, y2)], fill=color, width=width)
+ 238        self.display.ShowImage(self.splash)
+ 239
+ 240    # draw circle
+ 241    '''
+ 242    x1, y1, x2, y2 are two points defining the given border, angle0 is the initial angle, angle1 is the end angle
+ 243    '''
+ 244    def lcd_circle(self, x1, y1, x2, y2, angle0, angle1, color="WHITE", width=2):
+ 245        """
+ 246        Draws a circle or an arc on the LCD display.
+ 247
+ 248        Parameters:
+ 249            x1 (int): The x-coordinate of the top-left corner of the bounding box.
+ 250            y1 (int): The y-coordinate of the top-left corner of the bounding box.
+ 251            x2 (int): The x-coordinate of the bottom-right corner of the bounding box.
+ 252            y2 (int): The y-coordinate of the bottom-right corner of the bounding box.
+ 253            angle0 (int): The starting angle (in degrees).
+ 254            angle1 (int): The ending angle (in degrees).
+ 255            color (str, optional): The color of the circle/arc. Defaults to "WHITE".
+ 256            width (int, optional): The width of the circle/arc. Defaults to 2.
+ 257        """
+ 258        self.draw.arc((x1, y1, x2, y2), angle0, angle1, fill=color, width=width)
+ 259        self.display.ShowImage(self.splash)
+ 260
+ 261    # draw a circle: draw a circle based on the circle point and radius
+ 262    '''
+ 263    center_x, center_y coordinates of the center point of the circle
+ 264    radius circle radius length mm
+ 265    
+ 266    '''
+ 267    def lcd_round(self, center_x, center_y, radius, color, width=2):
+ 268        """
+ 269        Draws a circle on the LCD display using the center point and radius.
+ 270
+ 271        Parameters:
+ 272            center_x (int): The x-coordinate of the center of the circle.
+ 273            center_y (int): The y-coordinate of the center of the circle.
+ 274            radius (int): The radius of the circle.
+ 275            color (str): The color of the circle.
+ 276            width (int, optional): The width of the circle's outline. Defaults to 2.
+ 277        """
+ 278        # Calculate the bounding box for the circle
+ 279        x1 = center_x - radius
+ 280        y1 = center_y - radius
+ 281        x2 = center_x + radius
+ 282        y2 = center_y + radius
+ 283
+ 284        # Call lcd_circle() function to draw the circle
+ 285        self.lcd_circle(x1, y1, x2, y2, 0, 360, color=color, width=width)
+ 286
+ 287    # draw rectangle
+ 288    '''
+ 289    x1, y1 are the initial point coordinates, x2, y2 are the diagonal end point coordinates
+ 290    '''
+ 291    def lcd_rectangle(self, x1, y1, x2, y2, fill=None, outline="WHITE", width=2):
+ 292        """
+ 293        Draws a rectangle on the LCD display.
+ 294
+ 295        Parameters:
+ 296            x1 (int): The x-coordinate of the top-left corner.
+ 297            y1 (int): The y-coordinate of the top-left corner.
+ 298            x2 (int): The x-coordinate of the bottom-right corner.
+ 299            y2 (int): The y-coordinate of the bottom-right corner.
+ 300            fill (str, optional): The fill color of the rectangle. Defaults to None.
+ 301            outline (str, optional): The outline color of the rectangle. Defaults to "WHITE".
+ 302            width (int, optional): The width of the rectangle's outline. Defaults to 2.
+ 303        """
+ 304        self.draw.rectangle((x1, y1, x2, y2), fill=fill, outline=outline, width=width)
+ 305        self.display.ShowImage(self.splash)
+ 306
+ 307    # clear the screen
+ 308    def lcd_clear(self):
+ 309        """
+ 310        Clears the LCD display.
+ 311        """
+ 312        self.splash = Image.new("RGB", (320, 240), "black")
+ 313        self.draw = ImageDraw.Draw(self.splash)
+ 314        self.display.ShowImage(self.splash)
+ 315
+ 316    # show picture
+ 317    '''
+ 318    The size of the picture is 320*240, jpg format
+ 319    '''
+ 320    def lcd_picture(self, filename, x=0, y=0):
+ 321        """
+ 322        Displays an image on the LCD display.
+ 323
+ 324        Parameters:
+ 325            filename (str): The name of the image file (must be in the /home/pi/xgoPictures/ directory).
+ 326            x (int, optional): The x-coordinate of the top-left corner where the image will be displayed. Defaults to 0.
+ 327            y (int, optional): The y-coordinate of the top-left corner where the image will be displayed. Defaults to 0.
+ 328        """
+ 329        path = "/home/pi/xgoPictures/"
+ 330        image = Image.open(path + filename)
+ 331        self.splash.paste(image, (x, y))
+ 332        self.display.ShowImage(self.splash)
+ 333
+ 334    # display text
+ 335    '''
+ 336    x1, y1 are the initial point coordinates, content is the content
+ 337    '''
+ 338    def lcd_text(self, x, y, content, color="WHITE", fontsize=15):
+ 339        """
+ 340        Displays text on the LCD display.
+ 341
+ 342        Parameters:
+ 343            x (int): The x-coordinate of the top-left corner of the text.
+ 344            y (int): The y-coordinate of the top-left corner of the text.
+ 345            content (str): The text to display.
+ 346            color (str, optional): The color of the text. Defaults to "WHITE".
+ 347            fontsize (int, optional): The font size of the text. Defaults to 15.
+ 348        """
+ 349        if fontsize != 15:
+ 350            self.font = ImageFont.truetype("/home/pi/model/msyh.ttc", fontsize)
+ 351        self.draw.text((x, y), content, fill=color, font=self.font)
+ 352        self.display.ShowImage(self.splash)
+ 353
+ 354    # streaming display all text
+ 355    '''
+ 356    x1, y1 are the initial point coordinates, content is the content
+ 357    Automatically wrap when encountering a carriage return character, wrap when encountering the edge, and automatically clear the screen when a page is full, 2, 2 continue to display
+ 358    '''
+ 359    def display_text_on_screen(self, content, color, start_x=2, start_y=2, font_size=20, screen_width=320,
+ 360                                screen_height=240):
+ 361        """
+ 362        Displays text on the screen with automatic wrapping and page breaks.
+ 363
+ 364        Parameters:
+ 365            content (str): The text content to display.
+ 366            color (str): The color of the text.
+ 367            start_x (int, optional): The x-coordinate of the starting position. Defaults to 2.
+ 368            start_y (int, optional): The y-coordinate of the starting position. Defaults to 2.
+ 369            font_size (int, optional): The font size. Defaults to 20.
+ 370            screen_width (int, optional): The width of the screen. Defaults to 320.
+ 371            screen_height (int, optional): The height of the screen. Defaults to 240.
+ 372        """
+ 373        # Calculate the number of characters that can be displayed per line and the number of lines
+ 374        char_width = font_size + 1  # // 2
+ 375        chars_per_line = screen_width // char_width
+ 376        lines = screen_height // char_width
+ 377
+ 378        # Split the content into a list of individual characters
+ 379        chars = list(content)
+ 380
+ 381        # Handle newline characters
+ 382        line_break_indices = [i for i, char in enumerate(chars) if char == '\n']
+ 383
+ 384        # Calculate the total number of lines and pages
+ 385        total_lines = len(chars) // chars_per_line + 1
+ 386        total_pages = (total_lines - 1 + len(line_break_indices)) // lines + 1
+ 387
+ 388        # Clear the screen
+ 389        self.display.clear()
+ 390
+ 391        # Display the text line by line
+ 392        current_page = 1
+ 393        current_line = 1
+ 394        current_char = 0
+ 395
+ 396        while current_page <= total_pages or current_char < len(chars):
+ 397            self.display.clear()
+ 398            # Calculate the number of lines to display on the current page
+ 399            if current_page < total_pages or current_char < len(chars):
+ 400                lines_to_display = lines
+ 401            else:
+ 402                lines_to_display = (total_lines - 1) % lines + 1
+ 403
+ 404            current_line = 1
+ 405            # Display the content of the current page
+ 406            for line in range(lines_to_display):
+ 407                current_x = start_x
+ 408                current_y = start_y + current_line * char_width  # font_size
+ 409                current_line += 1
+ 410                if current_line >= lines:
+ 411                    break
+ 412
+ 413                # Show the text of the current line
+ 414                for _ in range(chars_per_line):
+ 415                    # Check if all characters have been displayed
+ 416                    if current_char >= len(chars):
+ 417                        break
+ 418
+ 419                    char = chars[current_char]
+ 420                    if char == '\n':
+ 421                        current_x = start_x
+ 422                        current_y = start_y + current_line * char_width  # font_size
+ 423                        current_line += 1
+ 424
+ 425                        self.lcd_text(current_x, current_y, char, color, font_size)
+ 426                        current_char += 1
+ 427                        break  # continue
+ 428
+ 429                    self.lcd_text(current_x, current_y, char, color, font_size)
+ 430                    current_x += char_width
+ 431                    current_char += 1
+ 432
+ 433                # Check if all characters have been displayed
+ 434                if current_char >= len(chars):
+ 435                    break
+ 436
+ 437            # Update current page and current line
+ 438            current_page += 1
+ 439            current_line += lines_to_display
+ 440
+ 441            # Wait for display time or manually trigger page turning
+ 442            # Here you can add appropriate delay code or a mechanism to trigger page turning as needed
+ 443
+ 444        # If the content exceeds one screen, clear the screen
+ 445        # if total_lines > lines:
+ 446        if current_page < total_pages:
+ 447            self.display.clear()
+ 448
+ 449    # key_value
+ 450    '''
+ 451    a upper left button
+ 452    b upper right button
+ 453    c lower left button
+ 454    d lower right button
+ 455    Return value 0 not pressed, 1 pressed
+ 456    '''
+ 457    def xgoButton(self, button):
+ 458        """
+ 459        Checks the state of a button.
+ 460
+ 461        Parameters:
+ 462            button (str): The button to check ('a', 'b', 'c', or 'd').
+ 463
+ 464        Returns:
+ 465            bool: True if the button is pressed, False otherwise.
+ 466        """
+ 467        if button == "a":
+ 468            last_state_a = GPIO.input(self.key1)
+ 469            time.sleep(0.02)
+ 470            return (not last_state_a)
+ 471        elif button == "b":
+ 472            last_state_b = GPIO.input(self.key2)
+ 473            time.sleep(0.02)
+ 474            return (not last_state_b)
+ 475        elif button == "c":
+ 476            last_state_c = GPIO.input(self.key3)
+ 477            time.sleep(0.02)
+ 478            return (not last_state_c)
+ 479        elif button == "d":
+ 480            last_state_d = GPIO.input(self.key4)
+ 481            time.sleep(0.02)
+ 482            return (not last_state_d)
+ 483
+ 484    # speaker
+ 485    '''
+ 486    filename file name string
+ 487    '''
+ 488    def xgoSpeaker(self, filename):
+ 489        """
+ 490        Plays an audio file using mplayer.
+ 491
+ 492        Parameters:
+ 493            filename (str): The name of the audio file (must be in the /home/pi/xgoMusic/ directory).
+ 494        """
+ 495        path = "/home/pi/xgoMusic/"
+ 496        os.system("mplayer" + " " + path + filename)
+ 497
+ 498    def xgoVideoAudio(self, filename):
+ 499        """
+ 500        Plays the audio track of a video file using mplayer.
+ 501
+ 502        Parameters:
+ 503            filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).
+ 504        """
+ 505        path = "/home/pi/xgoVideos/"
+ 506        time.sleep(0.2)  # Synchronize sound and picture speed, but the timeline may not be synchronized. Adjust here.
+ 507        cmd = "sudo mplayer " + path + filename + " -novideo"
+ 508        os.system(cmd)
+ 509
+ 510    def xgoVideo(self, filename):
+ 511        """
+ 512        Plays a video file on the LCD display while simultaneously playing its audio track in a separate thread.
+ 513
+ 514        Parameters:
+ 515            filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).
+ 516        """
+ 517        path = "/home/pi/xgoVideos/"
+ 518        x = threading.Thread(target=self.xgoVideoAudio, args=(filename,))
+ 519        x.start()
+ 520        global counter
+ 521        video = cv2.VideoCapture(path + filename)
+ 522        print(path + filename)
+ 523        fps = video.get(cv2.CAP_PROP_FPS)
+ 524        print(fps)
+ 525        init_time = time.time()
+ 526        counter = 0
+ 527        while True:
+ 528            grabbed, dst = video.read()
+ 529            try:
+ 530                b, g, r = cv2.split(dst)
+ 531                dst = cv2.merge((r, g, b))
+ 532            except:
+ 533                pass
+ 534            try:
+ 535                imgok = Image.fromarray(dst)
+ 536            except:
+ 537                break
+ 538            self.display.ShowImage(imgok)
+ 539            # Force frame rate. It is recommended that the frame rate should not exceed 20 frames, otherwise the display will not keep up, but 20 frames often have problems, so it is recommended to directly use 15 frames.
+ 540            counter += 1
+ 541            ctime = time.time() - init_time
+ 542            if ctime != 0:
+ 543                qtime = counter / fps - ctime
+ 544                # print(qtime)
+ 545                if qtime > 0:
+ 546                    time.sleep(qtime)
+ 547            if not grabbed:
+ 548                break
+ 549
+ 550    # audio_record
+ 551    '''
+ 552    filename file name string
+ 553    seconds recording time S string
+ 554    '''
+ 555    def xgoAudioRecord(self, filename="record", seconds=5):
+ 556        """
+ 557        Records audio for a specified duration and saves it as a WAV file.
+ 558
+ 559        Parameters:
+ 560            filename (str, optional): The name of the output audio file. Defaults to "record".
+ 561            seconds (int, optional): The recording duration in seconds. Defaults to 5.
+ 562        """
+ 563        path = "/home/pi/xgoMusic/"
+ 564        command1 = "sudo arecord -d"
+ 565        command2 = "-f S32_LE -r 8000 -c 1 -t wav"
+ 566        cmd = command1 + " " + str(seconds) + " " + command2 + " " + path + filename + ".wav"
+ 567        print(cmd)
+ 568        os.system(cmd)
+ 569
+ 570    def xgoCamera(self, switch):
+ 571        """
+ 572        Turns the camera on or off and displays the camera feed on the LCD.
+ 573
+ 574        Parameters:
+ 575            switch (bool): True to turn the camera on, False to turn it off.
+ 576        """
+ 577        global camera_still
+ 578        if switch:
+ 579            self.open_camera()
+ 580            self.camera_still = True
+ 581            t = threading.Thread(target=self.camera_mode)
+ 582            t.start()
+ 583        else:
+ 584            self.camera_still = False
+ 585            time.sleep(0.5)
+ 586            splash = Image.new("RGB", (320, 240), "black")
+ 587            self.display.ShowImage(splash)
+ 588
+ 589    def camera_mode(self):
+ 590        """
+ 591        Continuously captures and displays the camera feed on the LCD until camera_still is set to False.
+ 592        """
+ 593        self.camera_still = True
+ 594        while 1:
+ 595            success, image = self.cap.read()
+ 596            b, g, r = cv2.split(image)
+ 597            image = cv2.merge((r, g, b))
+ 598            image = cv2.flip(image, 1)
+ 599            imgok = Image.fromarray(image)
+ 600            self.display.ShowImage(imgok)
+ 601            if not self.camera_still:
+ 602                break
+ 603
+ 604    def xgoVideoRecord(self, filename="record", seconds=5):
+ 605        """
+ 606        Records a video for a specified duration, displays it on the LCD, and saves it as an MP4 file.
+ 607
+ 608        Parameters:
+ 609            filename (str, optional): The name of the output video file. Defaults to "record".
+ 610            seconds (int, optional): The recording duration in seconds. Defaults to 5.
+ 611        """
+ 612        path = "/home/pi/xgoVideos/"
+ 613        self.camera_still = False
+ 614        time.sleep(0.6)
+ 615        self.open_camera()
+ 616        FPS = 15
+ 617        fourcc = cv2.VideoWriter_fourcc(*'mp4v')
+ 618        width = int(self.cap.get(cv2.CAP_PROP_FRAME_WIDTH))
+ 619        height = int(self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
+ 620        videoWrite = cv2.VideoWriter(path + filename + '.mp4', fourcc, FPS, (width, height))
+ 621        starttime = time.time()
+ 622        while 1:
+ 623            print('recording...')
+ 624            ret, image = self.cap.read()
+ 625            if not ret:
+ 626                break
+ 627            videoWrite.write(image)
+ 628            b, g, r = cv2.split(image)
+ 629            image = cv2.merge((r, g, b))
+ 630            image = cv2.flip(image, 1)
+ 631            imgok = Image.fromarray(image)
+ 632            self.display.ShowImage(imgok)
+ 633            if time.time() - starttime > seconds:
+ 634                break
+ 635        print('recording done')
+ 636        self.xgoCamera(True)
+ 637        videoWrite.release()
+ 638
+ 639    def xgoTakePhoto(self, filename="photo"):
+ 640        """
+ 641        Takes a photo, displays it on the LCD, and saves it as a JPG file.
+ 642
+ 643        Parameters:
+ 644            filename (str, optional): The name of the output image file. Defaults to "photo".
+ 645        """
+ 646        path = "/home/pi/xgoPictures/"
+ 647        self.camera_still = False
+ 648        time.sleep(0.6)
+ 649        self.open_camera()
+ 650        success, image = self.cap.read()
+ 651        cv2.imwrite(path + filename + '.jpg', image)
+ 652        if not success:
+ 653            print("Ignoring empty camera frame")
+ 654        b, g, r = cv2.split(image)
+ 655        image = cv2.merge((r, g, b))
+ 656        image = cv2.flip(image, 1)
+ 657        imgok = Image.fromarray(image)
+ 658        self.display.ShowImage(imgok)
+ 659        print('photo writed!')
+ 660        time.sleep(0.7)
+ 661        self.xgoCamera(True)
+ 662
+ 663    '''
+ 664    Turn on the camera, take a photo with the A button, record a video with the B button, and exit with the C button
+ 665    '''
+ 666    def camera(self, filename="camera"):
+ 667        """
+ 668        Activates the camera and allows the user to take photos, record videos, or exit using the A, B, and C buttons, respectively.
+ 669
+ 670        Parameters:
+ 671            filename (str, optional): The base filename for photos and videos. Defaults to "camera".
+ 672        """
+ 673        font = ImageFont.truetype("/home/pi/model/msyh.ttc", 20)
+ 674        self.open_camera()
+ 675        while True:
+ 676            success, image = self.cap.read()
+ 677            # cv2.imwrite('/home/pi/xgoEdu/camera/file.jpg',image)
+ 678            if not success:
+ 679                print("Ignoring empty camera frame")
+ 680                continue
+ 681            # cv2.imshow('frame',image)
+ 682            b, g, r = cv2.split(image)
+ 683            image = cv2.merge((r, g, b))
+ 684            image = cv2.flip(image, 1)
+ 685            imgok = Image.fromarray(image)
+ 686            self.display.ShowImage(imgok)
+ 687            if cv2.waitKey(5) & 0xFF == 27:
+ 688                XGOEDU.lcd_clear(self)
+ 689                time.sleep(0.5)
+ 690                break
+ 691            if XGOEDU.xgoButton(self, "a"):
+ 692                draw = ImageDraw.Draw(imgok)
+ 693                cv2.imwrite(filename + '.jpg', image)
+ 694                print('photo writed!')
+ 695                draw.text((5, 5), filename + '.jpg saved!', fill=(255, 0, 0), font=font)
+ 696                self.display.ShowImage(imgok)
+ 697                time.sleep(1)
+ 698            if XGOEDU.xgoButton(self, "b"):
+ 699                FPS = 15
+ 700                fourcc = cv2.VideoWriter_fourcc(*'mp4v')
+ 701                width = int(self.cap.get(cv2.CAP_PROP_FRAME_WIDTH))
+ 702                height = int(self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
+ 703                videoWrite = cv2.VideoWriter(filename + '.mp4', fourcc, FPS, (width, height))
+ 704                while 1:
+ 705                    ret, image = self.cap.read()
+ 706                    if not ret:
+ 707                        break
+ 708                    videoWrite.write(image)
+ 709                    b, g, r = cv2.split(image)
+ 710                    image = cv2.merge((r, g, b))
+ 711                    image = cv2.flip(image, 1)
+ 712                    imgok = Image.fromarray(image)
+ 713                    draw = ImageDraw.Draw(imgok)
+ 714                    draw.text((5, 5), 'recording', fill=(255, 0, 0), font=font)
+ 715                    self.display.ShowImage(imgok)
+ 716                    if cv2.waitKey(33) & 0xFF == ord('q'):
+ 717                        break
+ 718                    if XGOEDU.xgoButton(self, "b"):
+ 719                        break
+ 720                time.sleep(1)
+ 721                videoWrite.release()
+ 722            if XGOEDU.xgoButton(self, "c"):
+ 723                XGOEDU.lcd_clear(self)
+ 724                time.sleep(0.5)
+ 725                break
+ 726
+ 727    '''
+ 728    Skeletal recognition
+ 729    '''
+ 730    def posenetRecognition(self, target="camera"):
+ 731        """
+ 732        Performs skeletal (pose) recognition on an image or video frame and displays the results on the LCD.
+ 733
+ 734        Parameters:
+ 735            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 736
+ 737        Returns:
+ 738            list or None: A list of angles between key body joints if successful, or None if no pose is detected.
+ 739        """
+ 740        import mediapipe as mp
+ 741        mp_pose = mp.solutions.pose
+ 742        ges = ''
+ 743        mp_drawing = mp.solutions.drawing_utils
+ 744        mp_drawing_styles = mp.solutions.drawing_styles
+ 745        mp_holistic = mp.solutions.holistic
+ 746        joint_list = [[24, 26, 28], [23, 25, 27], [14, 12, 24], [13, 11, 23]]  # leg&arm
+ 747        if target == "camera":
+ 748            self.open_camera()
+ 749            success, image = self.cap.read()
+ 750        else:
+ 751            image = np.array(Image.open(target))
+ 752
+ 753        with mp_pose.Pose(
+ 754                min_detection_confidence=0.5,
+ 755                min_tracking_confidence=0.5) as pose:
+ 756
+ 757            image.flags.writeable = False
+ 758            image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+ 759            results = pose.process(image)
+ 760
+ 761            # Draw the pose annotation on the image.
+ 762            image.flags.writeable = True
+ 763            image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
+ 764            mp_drawing.draw_landmarks(
+ 765                image,
+ 766                results.pose_landmarks,
+ 767                mp_pose.POSE_CONNECTIONS,
+ 768                landmark_drawing_spec=mp_drawing_styles.get_default_pose_landmarks_style())
+ 769            # Flip the image horizontally for a selfie-view display.
+ 770
+ 771            if results.pose_landmarks:
+ 772                RHL = results.pose_landmarks
+ 773                angellist = []
+ 774                for joint in joint_list:
+ 775                    a = np.array([RHL.landmark[joint[0]].x, RHL.landmark[joint[0]].y])
+ 776                    b = np.array([RHL.landmark[joint[1]].x, RHL.landmark[joint[1]].y])
+ 777                    c = np.array([RHL.landmark[joint[2]].x, RHL.landmark[joint[2]].y])
+ 778                    radians_fingers = np.arctan2(c[1] - b[1], c[0] - b[0]) - np.arctan2(a[1] - b[1], a[0] - b[0])
+ 779                    angle = np.abs(radians_fingers * 180.0 / np.pi)
+ 780                    if angle > 180.0:
+ 781                        angle = 360 - angle
+ 782                    # cv2.putText(image, str(round(angle, 2)), tuple(np.multiply(b, [640, 480]).astype(int)),cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA)
+ 783                    angellist.append(angle)
+ 784            else:
+ 785                angellist = []
+ 786            print(angellist)
+ 787            b, g, r = cv2.split(image)
+ 788            image = cv2.merge((r, g, b))
+ 789            image = cv2.flip(image, 1)
+ 790            try:
+ 791                ges = str(int(angellist[0])) + '|' + str(int(angellist[1])) + '|' + str(int(angellist[2])) + '|' + str(
+ 792                    int(angellist[3]))
+ 793            except:
+ 794                ges = ' '
+ 795            cv2.putText(image, ges, (10, 220), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA)
+ 796            imgok = Image.fromarray(image)
+ 797            self.display.ShowImage(imgok)
+ 798
+ 799        # datas = self.hand.run(image)
+ 800        # b,g,r = cv2.split(image)
+ 801        # image = cv2.merge((r,g,b))
+ 802        # #image = cv2.flip(image,1)
+ 803        # for data in datas:
+ 804        #     rect = data['rect']
+ 805        #     right_left = data['right_left']
+ 806        #     center = data['center']
+ 807        #     dlandmark = data['dlandmark']
+ 808        #     hand_angle = data['hand_angle']
+ 809        #     XGOEDU.rectangle(self,image,rect,"#33cc00",2)
+ 810        #     #XGOEDU.text(self,image,right_left,center,2,"#cc0000",5)
+ 811        #     if right_left == 'L':
+ 812        #         XGOEDU.text(self,image,hand_pos(hand_angle),(180,80),1.5,"#33cc00",2)
+ 813        #     elif right_left == 'R':
+ 814        #         XGOEDU.text(self,image,hand_pos(hand_angle),(50,80),1.5,"#ff0000",2)
+ 815        #     ges = hand_pos(hand_angle)
+ 816        #     for i in dlandmark:
+ 817        #         XGOEDU.circle(self,image,i,3,"#ff9900",-1)
+ 818        # imgok = Image.fromarray(image)
+ 819        # self.display.ShowImage(imgok)
+ 820        if angellist == []:
+ 821            return None
+ 822        else:
+ 823            return angellist
+ 824
+ 825    '''
+ 826    Gesture recognition
+ 827    '''
+ 828    def gestureRecognition(self, target="camera"):
+ 829        """
+ 830        Performs hand gesture recognition on an image or video frame and displays the results on the LCD.
+ 831
+ 832        Parameters:
+ 833            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 834
+ 835        Returns:
+ 836            tuple or None: A tuple containing the recognized gesture (str) and the center coordinates of the hand if successful, or None if no gesture is recognized.
+ 837        """
+ 838        ges = ''
+ 839        if self.hand == None:
+ 840            self.hand = hands(0, 2, 0.6, 0.5)
+ 841        if target == "camera":
+ 842            self.open_camera()
+ 843            success, image = self.cap.read()
+ 844        else:
+ 845            image = np.array(Image.open(target))
+ 846        image = cv2.flip(image, 1)
+ 847        datas = self.hand.run(image)
+ 848        b, g, r = cv2.split(image)
+ 849        image = cv2.merge((r, g, b))
+ 850        for data in datas:
+ 851            rect = data['rect']
+ 852            right_left = data['right_left']
+ 853            center = data['center']
+ 854            dlandmark = data['dlandmark']
+ 855            hand_angle = data['hand_angle']
+ 856            XGOEDU.rectangle(self, image, rect, "#33cc00", 2)
+ 857            # XGOEDU.text(self,image,right_left,center,2,"#cc0000",5)
+ 858            if right_left == 'L':
+ 859                XGOEDU.text(self, image, hand_pos(hand_angle), (180, 80), 1.5, "#33cc00", 2)
+ 860            elif right_left == 'R':
+ 861                XGOEDU.text(self, image, hand_pos(hand_angle), (50, 80), 1.5, "#ff0000", 2)
+ 862            ges = hand_pos(hand_angle)
+ 863            for i in dlandmark:
+ 864                XGOEDU.circle(self, image, i, 3, "#ff9900", -1)
+ 865        imgok = Image.fromarray(image)
+ 866        self.display.ShowImage(imgok)
+ 867        if ges == '':
+ 868            return None
+ 869        else:
+ 870            return (ges, center)
+ 871
+ 872    '''
+ 873    yolo
+ 874    '''
+ 875    def yoloFast(self, target="camera"):
+ 876        """
+ 877        Performs object detection using YOLO on an image or video frame and displays the results on the LCD.
+ 878
+ 879        Parameters:
+ 880            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 881
+ 882        Returns:
+ 883            tuple or None: A tuple containing the detected class (str) and the bounding box coordinates if successful, or None if no object is detected.
+ 884        """
+ 885        ret = ''
+ 886        self.open_camera()
+ 887        if self.yolo == None:
+ 888            self.yolo = yoloXgo('/home/pi/model/Model.onnx',
+ 889                                ['person', 'bicycle', 'car', 'motorbike', 'aeroplane', 'bus', 'train', 'truck', 'boat',
+ 890                                 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat',
+ 891                                 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack',
+ 892                                 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball',
+ 893                                 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket',
+ 894                                 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
+ 895                                 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair',
+ 896                                 'sofa', 'pottedplant', 'bed', 'diningtable', 'toilet', 'tvmonitor', 'laptop', 'mouse',
+ 897                                 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink',
+ 898                                 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier',
+ 899                                 'toothbrush'],
+ 900                                [352, 352], 0.66)
+ 901        if target == "camera":
+ 902            self.open_camera()
+ 903            success, image = self.cap.read()
+ 904        else:
+ 905            image = np.array(Image.open(target))
+ 906        datas = self.yolo.run(image)
+ 907        b, g, r = cv2.split(image)
+ 908        image = cv2.merge((r, g, b))
+ 909        image = cv2.flip(image, 1)
+ 910        if datas:
+ 911            for data in datas:
+ 912                XGOEDU.rectangle(self, image, data['xywh'], "#33cc00", 2)
+ 913                xy = (data['xywh'][0], data['xywh'][1])
+ 914                XGOEDU.text(self, image, data['classes'], xy, 1, "#ff0000", 2)
+ 915                value_yolo = data['classes']
+ 916                ret = (value_yolo, xy)
+ 917        imgok = Image.fromarray(image)
+ 918        self.display.ShowImage(imgok)
+ 919        if ret == '':
+ 920            return None
+ 921        else:
+ 922            return ret
+ 923
+ 924    '''
+ 925    Face detection (coordinate points)
+ 926    '''
+ 927    def face_detect(self, target="camera"):
+ 928        """
+ 929        Performs face detection (including facial landmarks) on an image or video frame and displays the results on the LCD.
+ 930
+ 931        Parameters:
+ 932            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 933
+ 934        Returns:
+ 935            list or None: A list of bounding box coordinates [x, y, w, h] of detected faces if successful, or None if no face is detected.
+ 936        """
+ 937        ret = ''
+ 938        if self.face == None:
+ 939            self.face = face_detection(0.7)
+ 940        if target == "camera":
+ 941            self.open_camera()
+ 942            success, image = self.cap.read()
+ 943        else:
+ 944            image = np.array(Image.open(target))
+ 945        b, g, r = cv2.split(image)
+ 946        image = cv2.merge((r, g, b))
+ 947        image = cv2.flip(image, 1)
+ 948        datas = self.face.run(image)
+ 949        for data in datas:
+ 950            lefteye = str(data['left_eye'])
+ 951            righteye = str(data['right_eye'])
+ 952            nose = str(data['nose'])
+ 953            mouth = str(data['mouth'])
+ 954            leftear = str(data['left_ear'])
+ 955            rightear = str(data['right_ear'])
+ 956            cv2.putText(image, 'lefteye', (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2)
+ 957            cv2.putText(image, lefteye, (100, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2)
+ 958            cv2.putText(image, 'righteye', (10, 50), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)
+ 959            cv2.putText(image, righteye, (100, 50), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)
+ 960            cv2.putText(image, 'nose', (10, 70), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
+ 961            cv2.putText(image, nose, (100, 70), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
+ 962            cv2.putText(image, 'leftear', (10, 90), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 0), 2)
+ 963            cv2.putText(image, leftear, (100, 90), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 0), 2)
+ 964            cv2.putText(image, 'rightear', (10, 110), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (200, 0, 200), 2)
+ 965            cv2.putText(image, rightear, (100, 110), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (200, 0, 200), 2)
+ 966            XGOEDU.rectangle(self, image, data['rect'], "#33cc00", 2)
+ 967            ret = data['rect']
+ 968        imgok = Image.fromarray(image)
+ 969        self.display.ShowImage(imgok)
+ 970        if ret == '':
+ 971            return None
+ 972        else:
+ 973            return ret
+ 974
+ 975    '''
+ 976    Emotion recognition
+ 977    '''
+ 978    def emotion(self, target="camera"):
+ 979        """
+ 980        Performs emotion recognition on an image or video frame and displays the results on the LCD.
+ 981
+ 982        Parameters:
+ 983            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 984
+ 985        Returns:
+ 986            tuple or None: A tuple containing the detected emotion (str) and the bounding box coordinates (x, y) of the face if successful, or None if no face or emotion is detected.
+ 987        """
+ 988        ret = ''
+ 989        if self.classifier == None:
+ 990            from keras.models import load_model
+ 991            self.face_classifier = cv2.CascadeClassifier('/home/pi/model/haarcascade_frontalface_default.xml')
+ 992            self.classifier = load_model('/home/pi/model/EmotionDetectionModel.h5')
+ 993        class_labels = ['Angry', 'Happy', 'Neutral', 'Sad', 'Surprise']
+ 994        if target == "camera":
+ 995            self.open_camera()
+ 996            success, image = self.cap.read()
+ 997        else:
+ 998            image = np.array(Image.open(target))
+ 999        labels = []
+1000        gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
+1001        faces = self.face_classifier.detectMultiScale(gray, 1.3, 5)
+1002        label = ''
+1003        for (x, y, w, h) in faces:
+1004            cv2.rectangle(image, (x, y), (x + w, y + h), (255, 0, 0), 2)
+1005            roi_gray = gray[y:y + h, x:x + w]
+1006            roi_gray = cv2.resize(roi_gray, (48, 48), interpolation=cv2.INTER_AREA)
+1007            if np.sum([roi_gray]) != 0:
+1008                from tensorflow.keras.utils import img_to_array
+1009                roi = roi_gray.astype('float') / 255.0
+1010                roi = img_to_array(roi)
+1011                roi = np.expand_dims(roi, axis=0)
+1012
+1013                preds = self.classifier.predict(roi)[0]
+1014                label = class_labels[preds.argmax()]
+1015                ret = (label, (x, y))
+1016            else:
+1017                pass
+1018        b, g, r = cv2.split(image)
+1019        image = cv2.merge((r, g, b))
+1020        image = cv2.flip(image, 1)
+1021        try:
+1022            cv2.putText(image, label, label_position, cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 3)
+1023        except:
+1024            pass
+1025        imgok = Image.fromarray(image)
+1026        self.display.ShowImage(imgok)
+1027        if ret == '':
+1028            return None
+1029        else:
+1030            return ret
+1031
+1032    '''
+1033    Age and gender detection
+1034    '''
+1035    def agesex(self, target="camera"):
+1036        """
+1037        Performs age and gender detection on an image or video frame and displays the results on the LCD.
+1038
+1039        Parameters:
+1040            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1041
+1042        Returns:
+1043            tuple or None: A tuple containing the detected gender (str), age (str), and the bounding box coordinates (x, y) of the face if successful, or None if no face, gender, or age is detected.
+1044        """
+1045        ret = ''
+1046        MODEL_MEAN_VALUES = (78.4263377603, 87.7689143744, 114.895847746)
+1047        ageList = ['(0-2)', '(4-6)', '(8-12)', '(15-20)', '(25-32)', '(38-43)', '(48-53)', '(60-100)']
+1048        genderList = ['Male', 'Female']
+1049        padding = 20
+1050        if target == "camera":
+1051            self.open_camera()
+1052            success, image = self.cap.read()
+1053        else:
+1054            image = np.array(Image.open(target))
+1055        if self.agesexmark == None:
+1056            faceProto = "/home/pi/model/opencv_face_detector.pbtxt"
+1057            faceModel = "/home/pi/model/opencv_face_detector_uint8.pb"
+1058            ageProto = "/home/pi/model/age_deploy.prototxt"
+1059            ageModel = "/home/pi/model/age_net.caffemodel"
+1060            genderProto = "/home/pi/model/gender_deploy.prototxt"
+1061            genderModel = "/home/pi/model/gender_net.caffemodel"
+1062            self.ageNet = cv2.dnn.readNet(ageModel, ageProto)
+1063            self.genderNet = cv2.dnn.readNet(genderModel, genderProto)
+1064            self.faceNet = cv2.dnn.readNet(faceModel, faceProto)
+1065            self.agesexmark = True
+1066
+1067        image = cv2.flip(image, 1)
+1068        frameFace, bboxes = getFaceBox(self.faceNet, image)
+1069        gender = ''
+1070        age = ''
+1071        for bbox in bboxes:
+1072            face = image[max(0, bbox[1] - padding):min(bbox[3] + padding, image.shape[0] - 1),
+1073                   max(0, bbox[0] - padding):min(bbox[2] + padding, image.shape[1] - 1)]
+1074            blob = cv2.dnn.blobFromImage(face, 1.0, (227, 227), MODEL_MEAN_VALUES, swapRB=False)
+1075            self.genderNet.setInput(blob)
+1076            genderPreds = self.genderNet.forward()
+1077            gender = genderList[genderPreds[0].argmax()]
+1078            self.ageNet.setInput(blob)
+1079            agePreds = self.ageNet.forward()
+1080            age = ageList[agePreds[0].argmax()]
+1081            label = "{},{}".format(gender, age)
+1082            cv2.putText(frameFace, label, (bbox[0], bbox[1] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 255, 255), 2,
+1083                        cv2.LINE_AA)
+1084            ret = (gender, age, (bbox[0], bbox[1]))
+1085        b, g, r = cv2.split(frameFace)
+1086        frameFace = cv2.merge((r, g, b))
+1087        imgok = Image.fromarray(frameFace)
+1088        self.display.ShowImage(imgok)
+1089        if ret == '':
+1090            return None
+1091        else:
+1092            return ret
+1093
+1094    def rectangle(self, frame, z, colors, size):
+1095        """
+1096        Draws a rectangle on a given frame.
+1097
+1098        Parameters:
+1099            frame (numpy.ndarray): The image frame to draw on.
+1100            z (tuple): A tuple of four integers (x, y, w, h) representing the top-left corner, width, and height of the rectangle.
+1101            colors (str): The color of the rectangle in hexadecimal format (e.g., "#FF0000" for red).
+1102            size (int): The thickness of the rectangle's outline.
+1103
+1104        Returns:
+1105            numpy.ndarray: The frame with the rectangle drawn on it.
+1106        """
+1107        frame = cv2.rectangle(frame, (int(z[0]), int(z[1])), (int(z[0] + z[2]), int(z[1] + z[3])), color(colors), size)
+1108        return frame
+1109
+1110    def circle(self, frame, xy, rad, colors, tk):
+1111        """
+1112        Draws a circle on a given frame.
+1113
+1114        Parameters:
+1115            frame (numpy.ndarray): The image frame to draw on.
+1116            xy (tuple): A tuple of two integers (x, y) representing the center coordinates of the circle.
+1117            rad (int): The radius of the circle.
+1118            colors (str): The color of the circle in hexadecimal format.
+1119            tk (int): The thickness of the circle's outline. Use -1 to fill the circle.
+1120
+1121        Returns:
+1122            numpy.ndarray: The frame with the circle drawn on it.
+1123        """
+1124        frame = cv2.circle(frame, xy, rad, color(colors), tk)
+1125        return frame
+1126
+1127    def text(self, frame, text, xy, font_size, colors, size):
+1128        """
+1129        Draws text on a given frame.
+1130
+1131        Parameters:
+1132            frame (numpy.ndarray): The image frame to draw on.
+1133            text (str): The text to be drawn.
+1134            xy (tuple): A tuple of two integers (x, y) representing the top-left corner of the text.
+1135            font_size (float): The font size of the text.
+1136            colors (str): The color of the text in hexadecimal format.
+1137            size (int): The thickness of the text.
+1138
+1139        Returns:
+1140            numpy.ndarray: The frame with the text drawn on it.
+1141        """
+1142        frame = cv2.putText(frame, text, xy, cv2.FONT_HERSHEY_SIMPLEX, font_size, color(colors), size)
+1143        return frame
+1144
+1145    def SpeechRecognition(self, seconds=3):
+1146        """
+1147        Performs speech recognition using the Baidu ASR API.
+1148
+1149        Parameters:
+1150            seconds (int, optional): The duration of the audio recording in seconds. Defaults to 3.
+1151
+1152        Returns:
+1153            str: The recognized text.
+1154        """
+1155        self.xgoAudioRecord(filename="recog", seconds=seconds)
+1156        from urllib.request import urlopen
+1157        from urllib.request import Request
+1158        from urllib.error import URLError
+1159        from urllib.parse import urlencode
+1160        timer = time.perf_counter
+1161        AUDIO_FILE = 'recog.wav'
+1162        FORMAT = AUDIO_FILE[-3:]
+1163        CUID = '123456PYTHON'
+1164        RATE = 16000
+1165        DEV_PID = 1537
+1166        ASR_URL = 'http://vop.baidu.com/server_api'
+1167        SCOPE = 'audio_voice_assistant_get'
+1168
+1169        token = self.fetch_token()
+1170
+1171        speech_data = []
+1172        path = "/home/pi/xgoMusic/"
+1173        with open(path + AUDIO_FILE, 'rb') as speech_file:
+1174            speech_data = speech_file.read()
+1175
+1176        length = len(speech_data)
+1177        if length == 0:
+1178            raise DemoError('file %s length read 0 bytes' % AUDIO_FILE)
+1179        speech = base64.b64encode(speech_data)
+1180        speech = str(speech, 'utf-8')
+1181        params = {'dev_pid': DEV_PID,
+1182                  'format': FORMAT,
+1183                  'rate': RATE,
+1184                  'token': token,
+1185                  'cuid': CUID,
+1186                  'channel': 1,
+1187                  'speech': speech,
+1188                  'len': length
+1189                  }
+1190        post_data = json.dumps(params, sort_keys=False)
+1191        req = Request(ASR_URL, post_data.encode('utf-8'))
+1192        req.add_header('Content-Type', 'application/json')
+1193        try:
+1194            begin = timer()
+1195            f = urlopen(req)
+1196            result_str = f.read()
+1197            print("Request time cost %f" % (timer() - begin))
+1198        except URLError as err:
+1199            print('asr http response http code : ' + str(err.code))
+1200            result_str = err.read()
+1201        try:
+1202            result_str = str(result_str, 'utf-8')
+1203            re = json.loads(result_str)
+1204            text = re['result'][0]
+1205        except:
+1206            text = 'error!'
+1207        return text
+1208
+1209    def SpeechSynthesis(self, texts):
+1210        """
+1211        Performs speech synthesis (text-to-speech) using the Baidu TTS API.
+1212
+1213        Parameters:
+1214            texts (str): The text to be synthesized.
+1215        """
+1216        from urllib.request import urlopen
+1217        from urllib.request import Request
+1218        from urllib.error import URLError
+1219        from urllib.parse import urlencode
+1220        from urllib.parse import quote_plus
+1221
+1222        TEXT = texts
+1223        PER = 0
+1224        SPD = 5
+1225        PIT = 5
+1226        VOL = 5
+1227        AUE = 6
+1228        FORMATS = {3: "mp3", 4: "pcm", 5: "pcm", 6: "wav"}
+1229        FORMAT = FORMATS[AUE]
+1230        CUID = "123456PYTHON"
+1231        TTS_URL = 'http://tsn.baidu.com/text2audio'
+1232
+1233        SCOPE = 'audio_tts_post'
+1234
+1235        token = self.fetch_token()
+1236        tex = quote_plus(TEXT)
+1237        print(tex)
+1238        params = {'tok': token, 'tex': tex, 'per': PER, 'spd': SPD, 'pit': PIT, 'vol': VOL, 'aue': AUE, 'cuid': CUID,
+1239                  'lan': 'zh', 'ctp': 1}
+1240
+1241        data = urlencode(params)
+1242        print('test on Web Browser' + TTS_URL + '?' + data)
+1243
+1244        req = Request(TTS_URL, data.encode('utf-8'))
+1245        has_error = False
+1246        try:
+1247            f = urlopen(req)
+1248            result_str = f.read()
+1249
+1250            headers = dict((name.lower(), value) for name, value in f.headers.items())
+1251
+1252            has_error = ('content-type' not in headers.keys() or headers['content-type'].find('audio/') < 0)
+1253        except URLError as err:
+1254            print('asr http response http code : ' + str(err.code))
+1255            result_str = err.read()
+1256            has_error = True
+1257
+1258        path = "/home/pi/xgoMusic/"
+1259        save_file = "error.txt" if has_error else 'result.' + FORMAT
+1260        with open(path + save_file, 'wb') as of:
+1261            of.write(result_str)
+1262
+1263        if has_error:
+1264            result_str = str(result_str, 'utf-8')
+1265            print("tts api  error:" + result_str)
+1266
+1267        print("result saved as :" + save_file)
+1268
+1269        self.xgoSpeaker("result.wav")
+1270
+1271    def cv2AddChineseText(self, img, text, position, textColor=(0, 255, 0), textSize=30):
+1272        """
+1273        Adds Chinese text to an image using PIL, as OpenCV doesn't support Chinese characters directly.
+1274
+1275        Parameters:
+1276            img (numpy.ndarray): The image to add text to.
+1277            text (str): The Chinese text to add.
+1278            position (tuple): The (x, y) coordinates of the top-left corner of the text.
+1279            textColor (tuple, optional): The RGB color of the text. Defaults to (0, 255, 0) (green).
+1280            textSize (int, optional): The font size. Defaults to 30.
+1281
+1282        Returns:
+1283            numpy.ndarray: The image with the Chinese text added.
+1284        """
+1285        if (isinstance(img, np.ndarray)):
+1286            img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
+1287        draw = ImageDraw.Draw(img)
+1288        fontStyle = ImageFont.truetype(
+1289            "/home/pi/model/msyh.ttc", textSize, encoding="utf-8")
+1290        draw.text(position, text, textColor, font=fontStyle)
+1291        return cv2.cvtColor(np.asarray(img), cv2.COLOR_RGB2BGR)
+1292
+1293    def QRRecognition(self, target="camera"):
+1294        """
+1295        Performs QR code recognition on an image or video frame and displays the results on the LCD.
+1296
+1297        Parameters:
+1298            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1299
+1300        Returns:
+1301            list: A list of decoded QR code data strings.
+1302        """
+1303        import pyzbar.pyzbar as pyzbar
+1304        if target == "camera":
+1305            self.open_camera()
+1306            success, img = self.cap.read()
+1307        else:
+1308            path = "/home/pi/xgoPictures/"
+1309            img = np.array(Image.open(path + target))
+1310
+1311        barcodes = pyzbar.decode(img)
+1312        result = []
+1313        for barcode in barcodes:
+1314            barcodeData = barcode.data.decode("utf-8")
+1315            barcodeType = barcode.type
+1316            result.append(barcodeData)
+1317            text = "{} ({})".format(barcodeData, barcodeType)
+1318            img = self.cv2AddChineseText(img, text, (10, 30), (0, 255, 0), 30)
+1319        try:
+1320            re = result[0]
+1321        except:
+1322            result = []
+1323        b, g, r = cv2.split(img)
+1324        img = cv2.merge((r, g, b))
+1325        imgok = Image.fromarray(img)
+1326        self.display.ShowImage(imgok)
+1327        return result
+1328
+1329    def ColorRecognition(self, target="camera", mode='R'):
+1330        """
+1331        Performs color recognition on an image or video frame, identifies the largest contour of the specified color, and displays the results on the LCD.
+1332
+1333        Parameters:
+1334            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1335            mode (str, optional): The color to recognize ('R' for red, 'G' for green, 'B' for blue, 'Y' for yellow). Defaults to 'R'.
+1336
+1337        Returns:
+1338            tuple: A tuple containing the center coordinates (x, y) and radius of the largest contour of the specified color.
+1339        """
+1340        color_x = 0
+1341        color_y = 0
+1342        color_radius = 0
+1343
+1344        if mode == 'R':  # red
+1345            color_lower = np.array([0, 43, 46])
+1346            color_upper = np.array([10, 255, 255])
+1347        elif mode == 'G':  # green
+1348            color_lower = np.array([35, 43, 46])
+1349            color_upper = np.array([77, 255, 255])
+1350        elif mode == 'B':  # blue
+1351            color_lower = np.array([100, 43, 46])
+1352            color_upper = np.array([124, 255, 255])
+1353        elif mode == 'Y':  # yellow
+1354            color_lower = np.array([26, 43, 46])
+1355            color_upper = np.array([34, 255, 255])
+1356        if target == "camera":
+1357            self.open_camera()
+1358            success, frame = self.cap.read()
+1359        else:
+1360            path = "/home/pi/xgoPictures/"
+1361            frame = np.array(Image.open(path + target))
+1362        frame_ = cv2.GaussianBlur(frame, (5, 5), 0)
+1363        hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
+1364        mask = cv2.inRange(hsv, color_lower, color_upper)
+1365        mask = cv2.erode(mask, None, iterations=2)
+1366        mask = cv2.dilate(mask, None, iterations=2)
+1367        mask = cv2.GaussianBlur(mask, (3, 3), 0)
+1368        cnts = cv2.findContours(mask.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)[-2]
+1369
+1370        if len(cnts) > 0:
+1371            cnt = max(cnts, key=cv2.contourArea)
+1372            (color_x, color_y), color_radius = cv2.minEnclosingCircle(cnt)
+1373            cv2.circle(frame, (int(color_x), int(color_y)), int(color_radius), (255, 0, 255), 2)
+1374        cv2.putText(frame, "X:%d, Y%d" % (int(color_x), int(color_y)), (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.8,
+1375                    (255, 255, 0), 3)
+1376
+1377        b, g, r = cv2.split(frame)
+1378        img = cv2.merge((r, g, b))
+1379        imgok = Image.fromarray(img)
+1380        self.display.ShowImage(imgok)
+1381
+1382        return ((color_x, color_y), color_radius)
+1383
+1384    def cap_color_mask(self, position=None, scale=25, h_error=20, s_limit=[90, 255], v_limit=[90, 230]):
+1385        """
+1386        Captures a color mask from the camera feed based on a specified region and displays it on the LCD.
+1387
+1388        Parameters:
+1389            position (list, optional): The top-left corner coordinates (x, y) of the region to sample for color. Defaults to [160, 100].
+1390            scale (int, optional): The width and height of the square region to sample. Defaults to 25.
+1391            h_error (int, optional): The tolerance for hue variation. Defaults to 20.
+1392            s_limit (list, optional): The lower and upper limits for saturation. Defaults to [90, 255].
+1393            v_limit (list, optional): The lower and upper limits for value (brightness). Defaults to [90, 230].
+1394
+1395        Returns:
+1396            list: A list containing two lists, representing the lower and upper bounds of the captured color mask in HSV format.
+1397        """
+1398        if position is None:
+1399            position = [160, 100]
+1400        count = 0
+1401        self.open_camera()
+1402        while True:
+1403            if self.xgoButton("c"):
+1404                break
+1405            success, frame = self.cap.read()
+1406            b, g, r = cv2.split(frame)
+1407            frame_bgr = cv2.merge((r, g, b))
+1408            hsv = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2HSV)
+1409            h, s, v = cv2.split(hsv)
+1410            color = np.mean(h[position[1]:position[1] + scale, position[0]:position[0] + scale])
+1411            if self.xgoButton("b") and count == 0:
+1412                count += 1
+1413                color = np.mean(h[position[1]:position[1] + scale, position[0]:position[0] + scale])
+1414                color_lower = [max(color - h_error, 0), s_limit[0], v_limit[0]]
+1415                color_upper = [min(color + h_error, 255), s_limit[1], v_limit[1]]
+1416                return [color_lower, color_upper]
+1417
+1418            if count == 0:
+1419                cv2.rectangle(frame, (position[0], position[1]), (position[0] + scale, position[1] + scale),
+1420                              (255, 255, 255), 2)
+1421                cv2.putText(frame, 'press button B', (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
+1422            b, g, r = cv2.split(frame)
+1423            img = cv2.merge((r, g, b))
+1424            imgok = Image.fromarray(img)
+1425            self.display.ShowImage(imgok)
+1426
+1427    def filter_img(self, frame, color):
+1428        """
+1429        Applies a color mask to an image frame, isolating the specified color.
+1430
+1431        Parameters:
+1432            frame (numpy.ndarray): The input image frame.
+1433            color (list or str): The color to filter. Can be a list of two lists representing the lower and upper bounds of the color mask in HSV format, or a string representing a predefined color ('red', 'green', 'blue', 'yellow').
+1434
+1435        Returns:
+1436            numpy.ndarray: The image frame with the color mask applied.
+1437        """
+1438        b, g, r = cv2.split(frame)
+1439        frame_bgr = cv2.merge((r, g, b))
+1440        hsv = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2HSV)
+1441        if isinstance(color, list):
+1442            color_lower = np.array(color[0])
+1443            color_upper = np.array(color[1])
+1444        else:
+1445            color_upper, color_lower = get_color_mask(color)
+1446        mask = cv2.inRange(hsv, color_lower, color_upper)
+1447        img_mask = cv2.bitwise_and(frame, frame, mask=mask)
+1448        return img_mask
+1449
+1450    def BallRecognition(self, color_mask, target="camera", p1=36, p2=15, minR=6, maxR=35):
+1451        """
+1452        Detects and tracks a ball of a specific color in an image or video frame using Hough Circle Transform.
+1453
+1454        Parameters:
+1455            color_mask (list): A list of two lists, representing the lower and upper bounds of the ball's color in HSV format.
+1456            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1457            p1 (int, optional): The higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller). Defaults to 36.
+1458            p2 (int, optional): The accumulator threshold for the circle centers at the detection stage. Defaults to 15.
+1459            minR (int, optional): The minimum circle radius. Defaults to 6.
+1460            maxR (int, optional): The maximum circle radius. Defaults to 35.
+1461
+1462        Returns:
+1463            tuple: A tuple containing the x-coordinate, y-coordinate, and radius of the detected ball.
+1464        """
+1465        x = y = ra = 0
+1466        if target == "camera":
+1467            self.open_camera()
+1468            success, image = self.cap.read()
+1469        else:
+1470            path = "/home/pi/xgoPictures/"
+1471            image = np.array(Image.open(path + target))
+1472
+1473        frame_mask = self.filter_img(image, color_mask)
+1474
+1475        img = cv2.medianBlur(frame_mask, 5)
+1476        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+1477
+1478        circles = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, 20, param1=p1, param2=p2, minRadius=minR, maxRadius=maxR)
+1479        b, g, r = cv2.split(image)
+1480        image = cv2.merge((r, g, b))
+1481        if circles is not None and len(circles[0]) == 1:
+1482            param = circles[0][0]
+1483            x, y, ra = int(param[0]), int(param[1]), int(param[2])
+1484            cv2.circle(image, (x, y), ra, (255, 255, 255), 2)
+1485            cv2.circle(image, (x, y), 2, (255, 255, 255), 2)
+1486        imgok = Image.fromarray(image)
+1487        self.display.ShowImage(imgok)
+1488        return x, y, ra
+
+ + +

A class for controlling and interacting with the XGO robot's educational features, including the LCD display, camera, and various AI functions.

+
+ + +
+ +
+ + XGOEDU() + + + +
+ +
140    def __init__(self):
+141        """
+142        Initializes the XGOEDU object, setting up the LCD display, GPIO pins, and various attributes.
+143        """
+144        self.display = LCD_2inch.LCD_2inch()
+145        self.display.Init()
+146        self.display.clear()
+147        self.splash = Image.new("RGB", (320, 240), "black")
+148        self.display.ShowImage(self.splash)
+149        self.draw = ImageDraw.Draw(self.splash)
+150        self.font = ImageFont.truetype("/home/pi/model/msyh.ttc", 15)
+151        self.key1 = 17
+152        self.key2 = 22
+153        self.key3 = 23
+154        self.key4 = 24
+155        self.cap = None
+156        self.hand = None
+157        self.yolo = None
+158        self.face = None
+159        self.face_classifier = None
+160        self.classifier = None
+161        self.agesexmark = None
+162        self.camera_still = False
+163        GPIO.setup(self.key1, GPIO.IN, GPIO.PUD_UP)
+164        GPIO.setup(self.key2, GPIO.IN, GPIO.PUD_UP)
+165        GPIO.setup(self.key3, GPIO.IN, GPIO.PUD_UP)
+166        GPIO.setup(self.key4, GPIO.IN, GPIO.PUD_UP)
+
+ + +

Initializes the XGOEDU object, setting up the LCD display, GPIO pins, and various attributes.

+
+ + +
+
+
+ display + + +
+ + + + +
+
+
+ splash + + +
+ + + + +
+
+
+ draw + + +
+ + + + +
+
+
+ font + + +
+ + + + +
+
+
+ key1 + + +
+ + + + +
+
+
+ key2 + + +
+ + + + +
+
+
+ key3 + + +
+ + + + +
+
+
+ key4 + + +
+ + + + +
+
+
+ cap + + +
+ + + + +
+
+
+ hand + + +
+ + + + +
+
+
+ yolo + + +
+ + + + +
+
+
+ face + + +
+ + + + +
+
+
+ face_classifier + + +
+ + + + +
+
+
+ classifier + + +
+ + + + +
+
+
+ agesexmark + + +
+ + + + +
+
+
+ camera_still + + +
+ + + + +
+
+ +
+ + def + open_camera(self): + + + +
+ +
168    def open_camera(self):
+169        """
+170        Opens the camera if it's not already open.
+171        """
+172        if self.cap == None:
+173            self.cap = cv2.VideoCapture(0)
+174            self.cap.set(3, 320)
+175            self.cap.set(4, 240)
+
+ + +

Opens the camera if it's not already open.

+
+ + +
+
+ +
+ + def + fetch_token(self): + + + +
+ +
177    def fetch_token(self):
+178        """
+179        Fetches an access token from the Baidu AI platform.
+180
+181        Returns:
+182            str: The access token.
+183
+184        Raises:
+185            DemoError: If the API key or secret key is incorrect, or if the scope is not correct.
+186        """
+187        from urllib.request import urlopen
+188        from urllib.request import Request
+189        from urllib.error import URLError
+190        from urllib.parse import urlencode
+191        API_KEY = 'Q4ZgU8bfnhA8HQFnNucBO2ut'
+192        SECRET_KEY = 'MqFrVgdwoM8ZuGIp0NIFF7qfYti4mjP6'
+193        TOKEN_URL = 'http://aip.baidubce.com/oauth/2.0/token'
+194        params = {'grant_type': 'client_credentials',
+195                  'client_id': API_KEY,
+196                  'client_secret': SECRET_KEY}
+197        post_data = urlencode(params)
+198        post_data = post_data.encode('utf-8')
+199        req = Request(TOKEN_URL, post_data)
+200        try:
+201            f = urlopen(req)
+202            result_str = f.read()
+203        except URLError as err:
+204            print('token http response http code : ' + str(err.code))
+205            result_str = err.read()
+206        result_str = result_str.decode()
+207
+208        # print(result_str)
+209        result = json.loads(result_str)
+210        # print(result)
+211        SCOPE = False
+212        if ('access_token' in result.keys() and 'scope' in result.keys()):
+213            # print(SCOPE)
+214            if SCOPE and (not SCOPE in result['scope'].split(' ')):  # SCOPE = False ignore check
+215                raise DemoError('scope is not correct')
+216            # print('SUCCESS WITH TOKEN: %s  EXPIRES IN SECONDS: %s' % (result['access_token'], result['expires_in']))
+217            return result['access_token']
+218        else:
+219            raise DemoError('MAYBE API_KEY or SECRET_KEY not correct: access_token or scope not found in token response')
+
+ + +

Fetches an access token from the Baidu AI platform.

+ +

Returns: + str: The access token.

+ +

Raises: + DemoError: If the API key or secret key is incorrect, or if the scope is not correct.

+
+ + +
+
+ +
+ + def + lcd_line(self, x1, y1, x2, y2, color='WHITE', width=2): + + + +
+ +
225    def lcd_line(self, x1, y1, x2, y2, color="WHITE", width=2):
+226        """
+227        Draws a straight line on the LCD display.
+228
+229        Parameters:
+230            x1 (int): The x-coordinate of the starting point.
+231            y1 (int): The y-coordinate of the starting point.
+232            x2 (int): The x-coordinate of the ending point.
+233            y2 (int): The y-coordinate of the ending point.
+234            color (str, optional): The color of the line. Defaults to "WHITE".
+235            width (int, optional): The width of the line. Defaults to 2.
+236        """
+237        self.draw.line([(x1, y1), (x2, y2)], fill=color, width=width)
+238        self.display.ShowImage(self.splash)
+
+ + +

Draws a straight line on the LCD display.

+ +

Parameters: + x1 (int): The x-coordinate of the starting point. + y1 (int): The y-coordinate of the starting point. + x2 (int): The x-coordinate of the ending point. + y2 (int): The y-coordinate of the ending point. + color (str, optional): The color of the line. Defaults to "WHITE". + width (int, optional): The width of the line. Defaults to 2.

+
+ + +
+
+ +
+ + def + lcd_circle(self, x1, y1, x2, y2, angle0, angle1, color='WHITE', width=2): + + + +
+ +
244    def lcd_circle(self, x1, y1, x2, y2, angle0, angle1, color="WHITE", width=2):
+245        """
+246        Draws a circle or an arc on the LCD display.
+247
+248        Parameters:
+249            x1 (int): The x-coordinate of the top-left corner of the bounding box.
+250            y1 (int): The y-coordinate of the top-left corner of the bounding box.
+251            x2 (int): The x-coordinate of the bottom-right corner of the bounding box.
+252            y2 (int): The y-coordinate of the bottom-right corner of the bounding box.
+253            angle0 (int): The starting angle (in degrees).
+254            angle1 (int): The ending angle (in degrees).
+255            color (str, optional): The color of the circle/arc. Defaults to "WHITE".
+256            width (int, optional): The width of the circle/arc. Defaults to 2.
+257        """
+258        self.draw.arc((x1, y1, x2, y2), angle0, angle1, fill=color, width=width)
+259        self.display.ShowImage(self.splash)
+
+ + +

Draws a circle or an arc on the LCD display.

+ +

Parameters: + x1 (int): The x-coordinate of the top-left corner of the bounding box. + y1 (int): The y-coordinate of the top-left corner of the bounding box. + x2 (int): The x-coordinate of the bottom-right corner of the bounding box. + y2 (int): The y-coordinate of the bottom-right corner of the bounding box. + angle0 (int): The starting angle (in degrees). + angle1 (int): The ending angle (in degrees). + color (str, optional): The color of the circle/arc. Defaults to "WHITE". + width (int, optional): The width of the circle/arc. Defaults to 2.

+
+ + +
+
+ +
+ + def + lcd_round(self, center_x, center_y, radius, color, width=2): + + + +
+ +
267    def lcd_round(self, center_x, center_y, radius, color, width=2):
+268        """
+269        Draws a circle on the LCD display using the center point and radius.
+270
+271        Parameters:
+272            center_x (int): The x-coordinate of the center of the circle.
+273            center_y (int): The y-coordinate of the center of the circle.
+274            radius (int): The radius of the circle.
+275            color (str): The color of the circle.
+276            width (int, optional): The width of the circle's outline. Defaults to 2.
+277        """
+278        # Calculate the bounding box for the circle
+279        x1 = center_x - radius
+280        y1 = center_y - radius
+281        x2 = center_x + radius
+282        y2 = center_y + radius
+283
+284        # Call lcd_circle() function to draw the circle
+285        self.lcd_circle(x1, y1, x2, y2, 0, 360, color=color, width=width)
+
+ + +

Draws a circle on the LCD display using the center point and radius.

+ +

Parameters: + center_x (int): The x-coordinate of the center of the circle. + center_y (int): The y-coordinate of the center of the circle. + radius (int): The radius of the circle. + color (str): The color of the circle. + width (int, optional): The width of the circle's outline. Defaults to 2.

+
+ + +
+
+ +
+ + def + lcd_rectangle(self, x1, y1, x2, y2, fill=None, outline='WHITE', width=2): + + + +
+ +
291    def lcd_rectangle(self, x1, y1, x2, y2, fill=None, outline="WHITE", width=2):
+292        """
+293        Draws a rectangle on the LCD display.
+294
+295        Parameters:
+296            x1 (int): The x-coordinate of the top-left corner.
+297            y1 (int): The y-coordinate of the top-left corner.
+298            x2 (int): The x-coordinate of the bottom-right corner.
+299            y2 (int): The y-coordinate of the bottom-right corner.
+300            fill (str, optional): The fill color of the rectangle. Defaults to None.
+301            outline (str, optional): The outline color of the rectangle. Defaults to "WHITE".
+302            width (int, optional): The width of the rectangle's outline. Defaults to 2.
+303        """
+304        self.draw.rectangle((x1, y1, x2, y2), fill=fill, outline=outline, width=width)
+305        self.display.ShowImage(self.splash)
+
+ + +

Draws a rectangle on the LCD display.

+ +

Parameters: + x1 (int): The x-coordinate of the top-left corner. + y1 (int): The y-coordinate of the top-left corner. + x2 (int): The x-coordinate of the bottom-right corner. + y2 (int): The y-coordinate of the bottom-right corner. + fill (str, optional): The fill color of the rectangle. Defaults to None. + outline (str, optional): The outline color of the rectangle. Defaults to "WHITE". + width (int, optional): The width of the rectangle's outline. Defaults to 2.

+
+ + +
+
+ +
+ + def + lcd_clear(self): + + + +
+ +
308    def lcd_clear(self):
+309        """
+310        Clears the LCD display.
+311        """
+312        self.splash = Image.new("RGB", (320, 240), "black")
+313        self.draw = ImageDraw.Draw(self.splash)
+314        self.display.ShowImage(self.splash)
+
+ + +

Clears the LCD display.

+
+ + +
+
+ +
+ + def + lcd_picture(self, filename, x=0, y=0): + + + +
+ +
320    def lcd_picture(self, filename, x=0, y=0):
+321        """
+322        Displays an image on the LCD display.
+323
+324        Parameters:
+325            filename (str): The name of the image file (must be in the /home/pi/xgoPictures/ directory).
+326            x (int, optional): The x-coordinate of the top-left corner where the image will be displayed. Defaults to 0.
+327            y (int, optional): The y-coordinate of the top-left corner where the image will be displayed. Defaults to 0.
+328        """
+329        path = "/home/pi/xgoPictures/"
+330        image = Image.open(path + filename)
+331        self.splash.paste(image, (x, y))
+332        self.display.ShowImage(self.splash)
+
+ + +

Displays an image on the LCD display.

+ +

Parameters: + filename (str): The name of the image file (must be in the /home/pi/xgoPictures/ directory). + x (int, optional): The x-coordinate of the top-left corner where the image will be displayed. Defaults to 0. + y (int, optional): The y-coordinate of the top-left corner where the image will be displayed. Defaults to 0.

+
+ + +
+
+ +
+ + def + lcd_text(self, x, y, content, color='WHITE', fontsize=15): + + + +
+ +
338    def lcd_text(self, x, y, content, color="WHITE", fontsize=15):
+339        """
+340        Displays text on the LCD display.
+341
+342        Parameters:
+343            x (int): The x-coordinate of the top-left corner of the text.
+344            y (int): The y-coordinate of the top-left corner of the text.
+345            content (str): The text to display.
+346            color (str, optional): The color of the text. Defaults to "WHITE".
+347            fontsize (int, optional): The font size of the text. Defaults to 15.
+348        """
+349        if fontsize != 15:
+350            self.font = ImageFont.truetype("/home/pi/model/msyh.ttc", fontsize)
+351        self.draw.text((x, y), content, fill=color, font=self.font)
+352        self.display.ShowImage(self.splash)
+
+ + +

Displays text on the LCD display.

+ +

Parameters: + x (int): The x-coordinate of the top-left corner of the text. + y (int): The y-coordinate of the top-left corner of the text. + content (str): The text to display. + color (str, optional): The color of the text. Defaults to "WHITE". + fontsize (int, optional): The font size of the text. Defaults to 15.

+
+ + +
+
+ +
+ + def + display_text_on_screen( self, content, color, start_x=2, start_y=2, font_size=20, screen_width=320, screen_height=240): + + + +
+ +
359    def display_text_on_screen(self, content, color, start_x=2, start_y=2, font_size=20, screen_width=320,
+360                                screen_height=240):
+361        """
+362        Displays text on the screen with automatic wrapping and page breaks.
+363
+364        Parameters:
+365            content (str): The text content to display.
+366            color (str): The color of the text.
+367            start_x (int, optional): The x-coordinate of the starting position. Defaults to 2.
+368            start_y (int, optional): The y-coordinate of the starting position. Defaults to 2.
+369            font_size (int, optional): The font size. Defaults to 20.
+370            screen_width (int, optional): The width of the screen. Defaults to 320.
+371            screen_height (int, optional): The height of the screen. Defaults to 240.
+372        """
+373        # Calculate the number of characters that can be displayed per line and the number of lines
+374        char_width = font_size + 1  # // 2
+375        chars_per_line = screen_width // char_width
+376        lines = screen_height // char_width
+377
+378        # Split the content into a list of individual characters
+379        chars = list(content)
+380
+381        # Handle newline characters
+382        line_break_indices = [i for i, char in enumerate(chars) if char == '\n']
+383
+384        # Calculate the total number of lines and pages
+385        total_lines = len(chars) // chars_per_line + 1
+386        total_pages = (total_lines - 1 + len(line_break_indices)) // lines + 1
+387
+388        # Clear the screen
+389        self.display.clear()
+390
+391        # Display the text line by line
+392        current_page = 1
+393        current_line = 1
+394        current_char = 0
+395
+396        while current_page <= total_pages or current_char < len(chars):
+397            self.display.clear()
+398            # Calculate the number of lines to display on the current page
+399            if current_page < total_pages or current_char < len(chars):
+400                lines_to_display = lines
+401            else:
+402                lines_to_display = (total_lines - 1) % lines + 1
+403
+404            current_line = 1
+405            # Display the content of the current page
+406            for line in range(lines_to_display):
+407                current_x = start_x
+408                current_y = start_y + current_line * char_width  # font_size
+409                current_line += 1
+410                if current_line >= lines:
+411                    break
+412
+413                # Show the text of the current line
+414                for _ in range(chars_per_line):
+415                    # Check if all characters have been displayed
+416                    if current_char >= len(chars):
+417                        break
+418
+419                    char = chars[current_char]
+420                    if char == '\n':
+421                        current_x = start_x
+422                        current_y = start_y + current_line * char_width  # font_size
+423                        current_line += 1
+424
+425                        self.lcd_text(current_x, current_y, char, color, font_size)
+426                        current_char += 1
+427                        break  # continue
+428
+429                    self.lcd_text(current_x, current_y, char, color, font_size)
+430                    current_x += char_width
+431                    current_char += 1
+432
+433                # Check if all characters have been displayed
+434                if current_char >= len(chars):
+435                    break
+436
+437            # Update current page and current line
+438            current_page += 1
+439            current_line += lines_to_display
+440
+441            # Wait for display time or manually trigger page turning
+442            # Here you can add appropriate delay code or a mechanism to trigger page turning as needed
+443
+444        # If the content exceeds one screen, clear the screen
+445        # if total_lines > lines:
+446        if current_page < total_pages:
+447            self.display.clear()
+
+ + +

Displays text on the screen with automatic wrapping and page breaks.

+ +

Parameters: + content (str): The text content to display. + color (str): The color of the text. + start_x (int, optional): The x-coordinate of the starting position. Defaults to 2. + start_y (int, optional): The y-coordinate of the starting position. Defaults to 2. + font_size (int, optional): The font size. Defaults to 20. + screen_width (int, optional): The width of the screen. Defaults to 320. + screen_height (int, optional): The height of the screen. Defaults to 240.

+
+ + +
+
+ +
+ + def + xgoButton(self, button): + + + +
+ +
457    def xgoButton(self, button):
+458        """
+459        Checks the state of a button.
+460
+461        Parameters:
+462            button (str): The button to check ('a', 'b', 'c', or 'd').
+463
+464        Returns:
+465            bool: True if the button is pressed, False otherwise.
+466        """
+467        if button == "a":
+468            last_state_a = GPIO.input(self.key1)
+469            time.sleep(0.02)
+470            return (not last_state_a)
+471        elif button == "b":
+472            last_state_b = GPIO.input(self.key2)
+473            time.sleep(0.02)
+474            return (not last_state_b)
+475        elif button == "c":
+476            last_state_c = GPIO.input(self.key3)
+477            time.sleep(0.02)
+478            return (not last_state_c)
+479        elif button == "d":
+480            last_state_d = GPIO.input(self.key4)
+481            time.sleep(0.02)
+482            return (not last_state_d)
+
+ + +

Checks the state of a button.

+ +

Parameters: + button (str): The button to check ('a', 'b', 'c', or 'd').

+ +

Returns: + bool: True if the button is pressed, False otherwise.

+
+ + +
+
+ +
+ + def + xgoSpeaker(self, filename): + + + +
+ +
488    def xgoSpeaker(self, filename):
+489        """
+490        Plays an audio file using mplayer.
+491
+492        Parameters:
+493            filename (str): The name of the audio file (must be in the /home/pi/xgoMusic/ directory).
+494        """
+495        path = "/home/pi/xgoMusic/"
+496        os.system("mplayer" + " " + path + filename)
+
+ + +

Plays an audio file using mplayer.

+ +

Parameters: + filename (str): The name of the audio file (must be in the /home/pi/xgoMusic/ directory).

+
+ + +
+
+ +
+ + def + xgoVideoAudio(self, filename): + + + +
+ +
498    def xgoVideoAudio(self, filename):
+499        """
+500        Plays the audio track of a video file using mplayer.
+501
+502        Parameters:
+503            filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).
+504        """
+505        path = "/home/pi/xgoVideos/"
+506        time.sleep(0.2)  # Synchronize sound and picture speed, but the timeline may not be synchronized. Adjust here.
+507        cmd = "sudo mplayer " + path + filename + " -novideo"
+508        os.system(cmd)
+
+ + +

Plays the audio track of a video file using mplayer.

+ +

Parameters: + filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).

+
+ + +
+
+ +
+ + def + xgoVideo(self, filename): + + + +
+ +
510    def xgoVideo(self, filename):
+511        """
+512        Plays a video file on the LCD display while simultaneously playing its audio track in a separate thread.
+513
+514        Parameters:
+515            filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).
+516        """
+517        path = "/home/pi/xgoVideos/"
+518        x = threading.Thread(target=self.xgoVideoAudio, args=(filename,))
+519        x.start()
+520        global counter
+521        video = cv2.VideoCapture(path + filename)
+522        print(path + filename)
+523        fps = video.get(cv2.CAP_PROP_FPS)
+524        print(fps)
+525        init_time = time.time()
+526        counter = 0
+527        while True:
+528            grabbed, dst = video.read()
+529            try:
+530                b, g, r = cv2.split(dst)
+531                dst = cv2.merge((r, g, b))
+532            except:
+533                pass
+534            try:
+535                imgok = Image.fromarray(dst)
+536            except:
+537                break
+538            self.display.ShowImage(imgok)
+539            # Force frame rate. It is recommended that the frame rate should not exceed 20 frames, otherwise the display will not keep up, but 20 frames often have problems, so it is recommended to directly use 15 frames.
+540            counter += 1
+541            ctime = time.time() - init_time
+542            if ctime != 0:
+543                qtime = counter / fps - ctime
+544                # print(qtime)
+545                if qtime > 0:
+546                    time.sleep(qtime)
+547            if not grabbed:
+548                break
+
+ + +

Plays a video file on the LCD display while simultaneously playing its audio track in a separate thread.

+ +

Parameters: + filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory).

+
+ + +
+
+ +
+ + def + xgoAudioRecord(self, filename='record', seconds=5): + + + +
+ +
555    def xgoAudioRecord(self, filename="record", seconds=5):
+556        """
+557        Records audio for a specified duration and saves it as a WAV file.
+558
+559        Parameters:
+560            filename (str, optional): The name of the output audio file. Defaults to "record".
+561            seconds (int, optional): The recording duration in seconds. Defaults to 5.
+562        """
+563        path = "/home/pi/xgoMusic/"
+564        command1 = "sudo arecord -d"
+565        command2 = "-f S32_LE -r 8000 -c 1 -t wav"
+566        cmd = command1 + " " + str(seconds) + " " + command2 + " " + path + filename + ".wav"
+567        print(cmd)
+568        os.system(cmd)
+
+ + +

Records audio for a specified duration and saves it as a WAV file.

+ +

Parameters: + filename (str, optional): The name of the output audio file. Defaults to "record". + seconds (int, optional): The recording duration in seconds. Defaults to 5.

+
+ + +
+
+ +
+ + def + xgoCamera(self, switch): + + + +
+ +
570    def xgoCamera(self, switch):
+571        """
+572        Turns the camera on or off and displays the camera feed on the LCD.
+573
+574        Parameters:
+575            switch (bool): True to turn the camera on, False to turn it off.
+576        """
+577        global camera_still
+578        if switch:
+579            self.open_camera()
+580            self.camera_still = True
+581            t = threading.Thread(target=self.camera_mode)
+582            t.start()
+583        else:
+584            self.camera_still = False
+585            time.sleep(0.5)
+586            splash = Image.new("RGB", (320, 240), "black")
+587            self.display.ShowImage(splash)
+
+ + +

Turns the camera on or off and displays the camera feed on the LCD.

+ +

Parameters: + switch (bool): True to turn the camera on, False to turn it off.

+
+ + +
+
+ +
+ + def + camera_mode(self): + + + +
+ +
589    def camera_mode(self):
+590        """
+591        Continuously captures and displays the camera feed on the LCD until camera_still is set to False.
+592        """
+593        self.camera_still = True
+594        while 1:
+595            success, image = self.cap.read()
+596            b, g, r = cv2.split(image)
+597            image = cv2.merge((r, g, b))
+598            image = cv2.flip(image, 1)
+599            imgok = Image.fromarray(image)
+600            self.display.ShowImage(imgok)
+601            if not self.camera_still:
+602                break
+
+ + +

Continuously captures and displays the camera feed on the LCD until camera_still is set to False.

+
+ + +
+
+ +
+ + def + xgoVideoRecord(self, filename='record', seconds=5): + + + +
+ +
604    def xgoVideoRecord(self, filename="record", seconds=5):
+605        """
+606        Records a video for a specified duration, displays it on the LCD, and saves it as an MP4 file.
+607
+608        Parameters:
+609            filename (str, optional): The name of the output video file. Defaults to "record".
+610            seconds (int, optional): The recording duration in seconds. Defaults to 5.
+611        """
+612        path = "/home/pi/xgoVideos/"
+613        self.camera_still = False
+614        time.sleep(0.6)
+615        self.open_camera()
+616        FPS = 15
+617        fourcc = cv2.VideoWriter_fourcc(*'mp4v')
+618        width = int(self.cap.get(cv2.CAP_PROP_FRAME_WIDTH))
+619        height = int(self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
+620        videoWrite = cv2.VideoWriter(path + filename + '.mp4', fourcc, FPS, (width, height))
+621        starttime = time.time()
+622        while 1:
+623            print('recording...')
+624            ret, image = self.cap.read()
+625            if not ret:
+626                break
+627            videoWrite.write(image)
+628            b, g, r = cv2.split(image)
+629            image = cv2.merge((r, g, b))
+630            image = cv2.flip(image, 1)
+631            imgok = Image.fromarray(image)
+632            self.display.ShowImage(imgok)
+633            if time.time() - starttime > seconds:
+634                break
+635        print('recording done')
+636        self.xgoCamera(True)
+637        videoWrite.release()
+
+ + +

Records a video for a specified duration, displays it on the LCD, and saves it as an MP4 file.

+ +

Parameters: + filename (str, optional): The name of the output video file. Defaults to "record". + seconds (int, optional): The recording duration in seconds. Defaults to 5.

+
+ + +
+
+ +
+ + def + xgoTakePhoto(self, filename='photo'): + + + +
+ +
639    def xgoTakePhoto(self, filename="photo"):
+640        """
+641        Takes a photo, displays it on the LCD, and saves it as a JPG file.
+642
+643        Parameters:
+644            filename (str, optional): The name of the output image file. Defaults to "photo".
+645        """
+646        path = "/home/pi/xgoPictures/"
+647        self.camera_still = False
+648        time.sleep(0.6)
+649        self.open_camera()
+650        success, image = self.cap.read()
+651        cv2.imwrite(path + filename + '.jpg', image)
+652        if not success:
+653            print("Ignoring empty camera frame")
+654        b, g, r = cv2.split(image)
+655        image = cv2.merge((r, g, b))
+656        image = cv2.flip(image, 1)
+657        imgok = Image.fromarray(image)
+658        self.display.ShowImage(imgok)
+659        print('photo writed!')
+660        time.sleep(0.7)
+661        self.xgoCamera(True)
+
+ + +

Takes a photo, displays it on the LCD, and saves it as a JPG file.

+ +

Parameters: + filename (str, optional): The name of the output image file. Defaults to "photo".

+
+ + +
+
+ +
+ + def + camera(self, filename='camera'): + + + +
+ +
666    def camera(self, filename="camera"):
+667        """
+668        Activates the camera and allows the user to take photos, record videos, or exit using the A, B, and C buttons, respectively.
+669
+670        Parameters:
+671            filename (str, optional): The base filename for photos and videos. Defaults to "camera".
+672        """
+673        font = ImageFont.truetype("/home/pi/model/msyh.ttc", 20)
+674        self.open_camera()
+675        while True:
+676            success, image = self.cap.read()
+677            # cv2.imwrite('/home/pi/xgoEdu/camera/file.jpg',image)
+678            if not success:
+679                print("Ignoring empty camera frame")
+680                continue
+681            # cv2.imshow('frame',image)
+682            b, g, r = cv2.split(image)
+683            image = cv2.merge((r, g, b))
+684            image = cv2.flip(image, 1)
+685            imgok = Image.fromarray(image)
+686            self.display.ShowImage(imgok)
+687            if cv2.waitKey(5) & 0xFF == 27:
+688                XGOEDU.lcd_clear(self)
+689                time.sleep(0.5)
+690                break
+691            if XGOEDU.xgoButton(self, "a"):
+692                draw = ImageDraw.Draw(imgok)
+693                cv2.imwrite(filename + '.jpg', image)
+694                print('photo writed!')
+695                draw.text((5, 5), filename + '.jpg saved!', fill=(255, 0, 0), font=font)
+696                self.display.ShowImage(imgok)
+697                time.sleep(1)
+698            if XGOEDU.xgoButton(self, "b"):
+699                FPS = 15
+700                fourcc = cv2.VideoWriter_fourcc(*'mp4v')
+701                width = int(self.cap.get(cv2.CAP_PROP_FRAME_WIDTH))
+702                height = int(self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
+703                videoWrite = cv2.VideoWriter(filename + '.mp4', fourcc, FPS, (width, height))
+704                while 1:
+705                    ret, image = self.cap.read()
+706                    if not ret:
+707                        break
+708                    videoWrite.write(image)
+709                    b, g, r = cv2.split(image)
+710                    image = cv2.merge((r, g, b))
+711                    image = cv2.flip(image, 1)
+712                    imgok = Image.fromarray(image)
+713                    draw = ImageDraw.Draw(imgok)
+714                    draw.text((5, 5), 'recording', fill=(255, 0, 0), font=font)
+715                    self.display.ShowImage(imgok)
+716                    if cv2.waitKey(33) & 0xFF == ord('q'):
+717                        break
+718                    if XGOEDU.xgoButton(self, "b"):
+719                        break
+720                time.sleep(1)
+721                videoWrite.release()
+722            if XGOEDU.xgoButton(self, "c"):
+723                XGOEDU.lcd_clear(self)
+724                time.sleep(0.5)
+725                break
+
+ + +

Activates the camera and allows the user to take photos, record videos, or exit using the A, B, and C buttons, respectively.

+ +

Parameters: + filename (str, optional): The base filename for photos and videos. Defaults to "camera".

+
+ + +
+
+ +
+ + def + posenetRecognition(self, target='camera'): + + + +
+ +
730    def posenetRecognition(self, target="camera"):
+731        """
+732        Performs skeletal (pose) recognition on an image or video frame and displays the results on the LCD.
+733
+734        Parameters:
+735            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+736
+737        Returns:
+738            list or None: A list of angles between key body joints if successful, or None if no pose is detected.
+739        """
+740        import mediapipe as mp
+741        mp_pose = mp.solutions.pose
+742        ges = ''
+743        mp_drawing = mp.solutions.drawing_utils
+744        mp_drawing_styles = mp.solutions.drawing_styles
+745        mp_holistic = mp.solutions.holistic
+746        joint_list = [[24, 26, 28], [23, 25, 27], [14, 12, 24], [13, 11, 23]]  # leg&arm
+747        if target == "camera":
+748            self.open_camera()
+749            success, image = self.cap.read()
+750        else:
+751            image = np.array(Image.open(target))
+752
+753        with mp_pose.Pose(
+754                min_detection_confidence=0.5,
+755                min_tracking_confidence=0.5) as pose:
+756
+757            image.flags.writeable = False
+758            image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+759            results = pose.process(image)
+760
+761            # Draw the pose annotation on the image.
+762            image.flags.writeable = True
+763            image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
+764            mp_drawing.draw_landmarks(
+765                image,
+766                results.pose_landmarks,
+767                mp_pose.POSE_CONNECTIONS,
+768                landmark_drawing_spec=mp_drawing_styles.get_default_pose_landmarks_style())
+769            # Flip the image horizontally for a selfie-view display.
+770
+771            if results.pose_landmarks:
+772                RHL = results.pose_landmarks
+773                angellist = []
+774                for joint in joint_list:
+775                    a = np.array([RHL.landmark[joint[0]].x, RHL.landmark[joint[0]].y])
+776                    b = np.array([RHL.landmark[joint[1]].x, RHL.landmark[joint[1]].y])
+777                    c = np.array([RHL.landmark[joint[2]].x, RHL.landmark[joint[2]].y])
+778                    radians_fingers = np.arctan2(c[1] - b[1], c[0] - b[0]) - np.arctan2(a[1] - b[1], a[0] - b[0])
+779                    angle = np.abs(radians_fingers * 180.0 / np.pi)
+780                    if angle > 180.0:
+781                        angle = 360 - angle
+782                    # cv2.putText(image, str(round(angle, 2)), tuple(np.multiply(b, [640, 480]).astype(int)),cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA)
+783                    angellist.append(angle)
+784            else:
+785                angellist = []
+786            print(angellist)
+787            b, g, r = cv2.split(image)
+788            image = cv2.merge((r, g, b))
+789            image = cv2.flip(image, 1)
+790            try:
+791                ges = str(int(angellist[0])) + '|' + str(int(angellist[1])) + '|' + str(int(angellist[2])) + '|' + str(
+792                    int(angellist[3]))
+793            except:
+794                ges = ' '
+795            cv2.putText(image, ges, (10, 220), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA)
+796            imgok = Image.fromarray(image)
+797            self.display.ShowImage(imgok)
+798
+799        # datas = self.hand.run(image)
+800        # b,g,r = cv2.split(image)
+801        # image = cv2.merge((r,g,b))
+802        # #image = cv2.flip(image,1)
+803        # for data in datas:
+804        #     rect = data['rect']
+805        #     right_left = data['right_left']
+806        #     center = data['center']
+807        #     dlandmark = data['dlandmark']
+808        #     hand_angle = data['hand_angle']
+809        #     XGOEDU.rectangle(self,image,rect,"#33cc00",2)
+810        #     #XGOEDU.text(self,image,right_left,center,2,"#cc0000",5)
+811        #     if right_left == 'L':
+812        #         XGOEDU.text(self,image,hand_pos(hand_angle),(180,80),1.5,"#33cc00",2)
+813        #     elif right_left == 'R':
+814        #         XGOEDU.text(self,image,hand_pos(hand_angle),(50,80),1.5,"#ff0000",2)
+815        #     ges = hand_pos(hand_angle)
+816        #     for i in dlandmark:
+817        #         XGOEDU.circle(self,image,i,3,"#ff9900",-1)
+818        # imgok = Image.fromarray(image)
+819        # self.display.ShowImage(imgok)
+820        if angellist == []:
+821            return None
+822        else:
+823            return angellist
+
+ + +

Performs skeletal (pose) recognition on an image or video frame and displays the results on the LCD.

+ +

Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".

+ +

Returns: + list or None: A list of angles between key body joints if successful, or None if no pose is detected.

+
+ + +
+
+ +
+ + def + gestureRecognition(self, target='camera'): + + + +
+ +
828    def gestureRecognition(self, target="camera"):
+829        """
+830        Performs hand gesture recognition on an image or video frame and displays the results on the LCD.
+831
+832        Parameters:
+833            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+834
+835        Returns:
+836            tuple or None: A tuple containing the recognized gesture (str) and the center coordinates of the hand if successful, or None if no gesture is recognized.
+837        """
+838        ges = ''
+839        if self.hand == None:
+840            self.hand = hands(0, 2, 0.6, 0.5)
+841        if target == "camera":
+842            self.open_camera()
+843            success, image = self.cap.read()
+844        else:
+845            image = np.array(Image.open(target))
+846        image = cv2.flip(image, 1)
+847        datas = self.hand.run(image)
+848        b, g, r = cv2.split(image)
+849        image = cv2.merge((r, g, b))
+850        for data in datas:
+851            rect = data['rect']
+852            right_left = data['right_left']
+853            center = data['center']
+854            dlandmark = data['dlandmark']
+855            hand_angle = data['hand_angle']
+856            XGOEDU.rectangle(self, image, rect, "#33cc00", 2)
+857            # XGOEDU.text(self,image,right_left,center,2,"#cc0000",5)
+858            if right_left == 'L':
+859                XGOEDU.text(self, image, hand_pos(hand_angle), (180, 80), 1.5, "#33cc00", 2)
+860            elif right_left == 'R':
+861                XGOEDU.text(self, image, hand_pos(hand_angle), (50, 80), 1.5, "#ff0000", 2)
+862            ges = hand_pos(hand_angle)
+863            for i in dlandmark:
+864                XGOEDU.circle(self, image, i, 3, "#ff9900", -1)
+865        imgok = Image.fromarray(image)
+866        self.display.ShowImage(imgok)
+867        if ges == '':
+868            return None
+869        else:
+870            return (ges, center)
+
+ + +

Performs hand gesture recognition on an image or video frame and displays the results on the LCD.

+ +

Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".

+ +

Returns: + tuple or None: A tuple containing the recognized gesture (str) and the center coordinates of the hand if successful, or None if no gesture is recognized.

+
+ + +
+
+ +
+ + def + yoloFast(self, target='camera'): + + + +
+ +
875    def yoloFast(self, target="camera"):
+876        """
+877        Performs object detection using YOLO on an image or video frame and displays the results on the LCD.
+878
+879        Parameters:
+880            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+881
+882        Returns:
+883            tuple or None: A tuple containing the detected class (str) and the bounding box coordinates if successful, or None if no object is detected.
+884        """
+885        ret = ''
+886        self.open_camera()
+887        if self.yolo == None:
+888            self.yolo = yoloXgo('/home/pi/model/Model.onnx',
+889                                ['person', 'bicycle', 'car', 'motorbike', 'aeroplane', 'bus', 'train', 'truck', 'boat',
+890                                 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat',
+891                                 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack',
+892                                 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball',
+893                                 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket',
+894                                 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
+895                                 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair',
+896                                 'sofa', 'pottedplant', 'bed', 'diningtable', 'toilet', 'tvmonitor', 'laptop', 'mouse',
+897                                 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink',
+898                                 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier',
+899                                 'toothbrush'],
+900                                [352, 352], 0.66)
+901        if target == "camera":
+902            self.open_camera()
+903            success, image = self.cap.read()
+904        else:
+905            image = np.array(Image.open(target))
+906        datas = self.yolo.run(image)
+907        b, g, r = cv2.split(image)
+908        image = cv2.merge((r, g, b))
+909        image = cv2.flip(image, 1)
+910        if datas:
+911            for data in datas:
+912                XGOEDU.rectangle(self, image, data['xywh'], "#33cc00", 2)
+913                xy = (data['xywh'][0], data['xywh'][1])
+914                XGOEDU.text(self, image, data['classes'], xy, 1, "#ff0000", 2)
+915                value_yolo = data['classes']
+916                ret = (value_yolo, xy)
+917        imgok = Image.fromarray(image)
+918        self.display.ShowImage(imgok)
+919        if ret == '':
+920            return None
+921        else:
+922            return ret
+
+ + +

Performs object detection using YOLO on an image or video frame and displays the results on the LCD.

+ +

Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".

+ +

Returns: + tuple or None: A tuple containing the detected class (str) and the bounding box coordinates if successful, or None if no object is detected.

+
+ + +
+
+ +
+ + def + face_detect(self, target='camera'): + + + +
+ +
927    def face_detect(self, target="camera"):
+928        """
+929        Performs face detection (including facial landmarks) on an image or video frame and displays the results on the LCD.
+930
+931        Parameters:
+932            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+933
+934        Returns:
+935            list or None: A list of bounding box coordinates [x, y, w, h] of detected faces if successful, or None if no face is detected.
+936        """
+937        ret = ''
+938        if self.face == None:
+939            self.face = face_detection(0.7)
+940        if target == "camera":
+941            self.open_camera()
+942            success, image = self.cap.read()
+943        else:
+944            image = np.array(Image.open(target))
+945        b, g, r = cv2.split(image)
+946        image = cv2.merge((r, g, b))
+947        image = cv2.flip(image, 1)
+948        datas = self.face.run(image)
+949        for data in datas:
+950            lefteye = str(data['left_eye'])
+951            righteye = str(data['right_eye'])
+952            nose = str(data['nose'])
+953            mouth = str(data['mouth'])
+954            leftear = str(data['left_ear'])
+955            rightear = str(data['right_ear'])
+956            cv2.putText(image, 'lefteye', (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2)
+957            cv2.putText(image, lefteye, (100, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2)
+958            cv2.putText(image, 'righteye', (10, 50), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)
+959            cv2.putText(image, righteye, (100, 50), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)
+960            cv2.putText(image, 'nose', (10, 70), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
+961            cv2.putText(image, nose, (100, 70), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
+962            cv2.putText(image, 'leftear', (10, 90), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 0), 2)
+963            cv2.putText(image, leftear, (100, 90), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 0), 2)
+964            cv2.putText(image, 'rightear', (10, 110), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (200, 0, 200), 2)
+965            cv2.putText(image, rightear, (100, 110), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (200, 0, 200), 2)
+966            XGOEDU.rectangle(self, image, data['rect'], "#33cc00", 2)
+967            ret = data['rect']
+968        imgok = Image.fromarray(image)
+969        self.display.ShowImage(imgok)
+970        if ret == '':
+971            return None
+972        else:
+973            return ret
+
+ + +

Performs face detection (including facial landmarks) on an image or video frame and displays the results on the LCD.

+ +

Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".

+ +

Returns: + list or None: A list of bounding box coordinates [x, y, w, h] of detected faces if successful, or None if no face is detected.

+
+ + +
+
+ +
+ + def + emotion(self, target='camera'): + + + +
+ +
 978    def emotion(self, target="camera"):
+ 979        """
+ 980        Performs emotion recognition on an image or video frame and displays the results on the LCD.
+ 981
+ 982        Parameters:
+ 983            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+ 984
+ 985        Returns:
+ 986            tuple or None: A tuple containing the detected emotion (str) and the bounding box coordinates (x, y) of the face if successful, or None if no face or emotion is detected.
+ 987        """
+ 988        ret = ''
+ 989        if self.classifier == None:
+ 990            from keras.models import load_model
+ 991            self.face_classifier = cv2.CascadeClassifier('/home/pi/model/haarcascade_frontalface_default.xml')
+ 992            self.classifier = load_model('/home/pi/model/EmotionDetectionModel.h5')
+ 993        class_labels = ['Angry', 'Happy', 'Neutral', 'Sad', 'Surprise']
+ 994        if target == "camera":
+ 995            self.open_camera()
+ 996            success, image = self.cap.read()
+ 997        else:
+ 998            image = np.array(Image.open(target))
+ 999        labels = []
+1000        gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
+1001        faces = self.face_classifier.detectMultiScale(gray, 1.3, 5)
+1002        label = ''
+1003        for (x, y, w, h) in faces:
+1004            cv2.rectangle(image, (x, y), (x + w, y + h), (255, 0, 0), 2)
+1005            roi_gray = gray[y:y + h, x:x + w]
+1006            roi_gray = cv2.resize(roi_gray, (48, 48), interpolation=cv2.INTER_AREA)
+1007            if np.sum([roi_gray]) != 0:
+1008                from tensorflow.keras.utils import img_to_array
+1009                roi = roi_gray.astype('float') / 255.0
+1010                roi = img_to_array(roi)
+1011                roi = np.expand_dims(roi, axis=0)
+1012
+1013                preds = self.classifier.predict(roi)[0]
+1014                label = class_labels[preds.argmax()]
+1015                ret = (label, (x, y))
+1016            else:
+1017                pass
+1018        b, g, r = cv2.split(image)
+1019        image = cv2.merge((r, g, b))
+1020        image = cv2.flip(image, 1)
+1021        try:
+1022            cv2.putText(image, label, label_position, cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 3)
+1023        except:
+1024            pass
+1025        imgok = Image.fromarray(image)
+1026        self.display.ShowImage(imgok)
+1027        if ret == '':
+1028            return None
+1029        else:
+1030            return ret
+
+ + +

Performs emotion recognition on an image or video frame and displays the results on the LCD.

+ +

Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".

+ +

Returns: + tuple or None: A tuple containing the detected emotion (str) and the bounding box coordinates (x, y) of the face if successful, or None if no face or emotion is detected.

+
+ + +
+
+ +
+ + def + agesex(self, target='camera'): + + + +
+ +
1035    def agesex(self, target="camera"):
+1036        """
+1037        Performs age and gender detection on an image or video frame and displays the results on the LCD.
+1038
+1039        Parameters:
+1040            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1041
+1042        Returns:
+1043            tuple or None: A tuple containing the detected gender (str), age (str), and the bounding box coordinates (x, y) of the face if successful, or None if no face, gender, or age is detected.
+1044        """
+1045        ret = ''
+1046        MODEL_MEAN_VALUES = (78.4263377603, 87.7689143744, 114.895847746)
+1047        ageList = ['(0-2)', '(4-6)', '(8-12)', '(15-20)', '(25-32)', '(38-43)', '(48-53)', '(60-100)']
+1048        genderList = ['Male', 'Female']
+1049        padding = 20
+1050        if target == "camera":
+1051            self.open_camera()
+1052            success, image = self.cap.read()
+1053        else:
+1054            image = np.array(Image.open(target))
+1055        if self.agesexmark == None:
+1056            faceProto = "/home/pi/model/opencv_face_detector.pbtxt"
+1057            faceModel = "/home/pi/model/opencv_face_detector_uint8.pb"
+1058            ageProto = "/home/pi/model/age_deploy.prototxt"
+1059            ageModel = "/home/pi/model/age_net.caffemodel"
+1060            genderProto = "/home/pi/model/gender_deploy.prototxt"
+1061            genderModel = "/home/pi/model/gender_net.caffemodel"
+1062            self.ageNet = cv2.dnn.readNet(ageModel, ageProto)
+1063            self.genderNet = cv2.dnn.readNet(genderModel, genderProto)
+1064            self.faceNet = cv2.dnn.readNet(faceModel, faceProto)
+1065            self.agesexmark = True
+1066
+1067        image = cv2.flip(image, 1)
+1068        frameFace, bboxes = getFaceBox(self.faceNet, image)
+1069        gender = ''
+1070        age = ''
+1071        for bbox in bboxes:
+1072            face = image[max(0, bbox[1] - padding):min(bbox[3] + padding, image.shape[0] - 1),
+1073                   max(0, bbox[0] - padding):min(bbox[2] + padding, image.shape[1] - 1)]
+1074            blob = cv2.dnn.blobFromImage(face, 1.0, (227, 227), MODEL_MEAN_VALUES, swapRB=False)
+1075            self.genderNet.setInput(blob)
+1076            genderPreds = self.genderNet.forward()
+1077            gender = genderList[genderPreds[0].argmax()]
+1078            self.ageNet.setInput(blob)
+1079            agePreds = self.ageNet.forward()
+1080            age = ageList[agePreds[0].argmax()]
+1081            label = "{},{}".format(gender, age)
+1082            cv2.putText(frameFace, label, (bbox[0], bbox[1] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 255, 255), 2,
+1083                        cv2.LINE_AA)
+1084            ret = (gender, age, (bbox[0], bbox[1]))
+1085        b, g, r = cv2.split(frameFace)
+1086        frameFace = cv2.merge((r, g, b))
+1087        imgok = Image.fromarray(frameFace)
+1088        self.display.ShowImage(imgok)
+1089        if ret == '':
+1090            return None
+1091        else:
+1092            return ret
+
+ + +

Performs age and gender detection on an image or video frame and displays the results on the LCD.

+ +

Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".

+ +

Returns: + tuple or None: A tuple containing the detected gender (str), age (str), and the bounding box coordinates (x, y) of the face if successful, or None if no face, gender, or age is detected.

+
+ + +
+
+ +
+ + def + rectangle(self, frame, z, colors, size): + + + +
+ +
1094    def rectangle(self, frame, z, colors, size):
+1095        """
+1096        Draws a rectangle on a given frame.
+1097
+1098        Parameters:
+1099            frame (numpy.ndarray): The image frame to draw on.
+1100            z (tuple): A tuple of four integers (x, y, w, h) representing the top-left corner, width, and height of the rectangle.
+1101            colors (str): The color of the rectangle in hexadecimal format (e.g., "#FF0000" for red).
+1102            size (int): The thickness of the rectangle's outline.
+1103
+1104        Returns:
+1105            numpy.ndarray: The frame with the rectangle drawn on it.
+1106        """
+1107        frame = cv2.rectangle(frame, (int(z[0]), int(z[1])), (int(z[0] + z[2]), int(z[1] + z[3])), color(colors), size)
+1108        return frame
+
+ + +

Draws a rectangle on a given frame.

+ +

Parameters: + frame (numpy.ndarray): The image frame to draw on. + z (tuple): A tuple of four integers (x, y, w, h) representing the top-left corner, width, and height of the rectangle. + colors (str): The color of the rectangle in hexadecimal format (e.g., "#FF0000" for red). + size (int): The thickness of the rectangle's outline.

+ +

Returns: + numpy.ndarray: The frame with the rectangle drawn on it.

+
+ + +
+
+ +
+ + def + circle(self, frame, xy, rad, colors, tk): + + + +
+ +
1110    def circle(self, frame, xy, rad, colors, tk):
+1111        """
+1112        Draws a circle on a given frame.
+1113
+1114        Parameters:
+1115            frame (numpy.ndarray): The image frame to draw on.
+1116            xy (tuple): A tuple of two integers (x, y) representing the center coordinates of the circle.
+1117            rad (int): The radius of the circle.
+1118            colors (str): The color of the circle in hexadecimal format.
+1119            tk (int): The thickness of the circle's outline. Use -1 to fill the circle.
+1120
+1121        Returns:
+1122            numpy.ndarray: The frame with the circle drawn on it.
+1123        """
+1124        frame = cv2.circle(frame, xy, rad, color(colors), tk)
+1125        return frame
+
+ + +

Draws a circle on a given frame.

+ +

Parameters: + frame (numpy.ndarray): The image frame to draw on. + xy (tuple): A tuple of two integers (x, y) representing the center coordinates of the circle. + rad (int): The radius of the circle. + colors (str): The color of the circle in hexadecimal format. + tk (int): The thickness of the circle's outline. Use -1 to fill the circle.

+ +

Returns: + numpy.ndarray: The frame with the circle drawn on it.

+
+ + +
+
+ +
+ + def + text(self, frame, text, xy, font_size, colors, size): + + + +
+ +
1127    def text(self, frame, text, xy, font_size, colors, size):
+1128        """
+1129        Draws text on a given frame.
+1130
+1131        Parameters:
+1132            frame (numpy.ndarray): The image frame to draw on.
+1133            text (str): The text to be drawn.
+1134            xy (tuple): A tuple of two integers (x, y) representing the top-left corner of the text.
+1135            font_size (float): The font size of the text.
+1136            colors (str): The color of the text in hexadecimal format.
+1137            size (int): The thickness of the text.
+1138
+1139        Returns:
+1140            numpy.ndarray: The frame with the text drawn on it.
+1141        """
+1142        frame = cv2.putText(frame, text, xy, cv2.FONT_HERSHEY_SIMPLEX, font_size, color(colors), size)
+1143        return frame
+
+ + +

Draws text on a given frame.

+ +

Parameters: + frame (numpy.ndarray): The image frame to draw on. + text (str): The text to be drawn. + xy (tuple): A tuple of two integers (x, y) representing the top-left corner of the text. + font_size (float): The font size of the text. + colors (str): The color of the text in hexadecimal format. + size (int): The thickness of the text.

+ +

Returns: + numpy.ndarray: The frame with the text drawn on it.

+
+ + +
+
+ +
+ + def + SpeechRecognition(self, seconds=3): + + + +
+ +
1145    def SpeechRecognition(self, seconds=3):
+1146        """
+1147        Performs speech recognition using the Baidu ASR API.
+1148
+1149        Parameters:
+1150            seconds (int, optional): The duration of the audio recording in seconds. Defaults to 3.
+1151
+1152        Returns:
+1153            str: The recognized text.
+1154        """
+1155        self.xgoAudioRecord(filename="recog", seconds=seconds)
+1156        from urllib.request import urlopen
+1157        from urllib.request import Request
+1158        from urllib.error import URLError
+1159        from urllib.parse import urlencode
+1160        timer = time.perf_counter
+1161        AUDIO_FILE = 'recog.wav'
+1162        FORMAT = AUDIO_FILE[-3:]
+1163        CUID = '123456PYTHON'
+1164        RATE = 16000
+1165        DEV_PID = 1537
+1166        ASR_URL = 'http://vop.baidu.com/server_api'
+1167        SCOPE = 'audio_voice_assistant_get'
+1168
+1169        token = self.fetch_token()
+1170
+1171        speech_data = []
+1172        path = "/home/pi/xgoMusic/"
+1173        with open(path + AUDIO_FILE, 'rb') as speech_file:
+1174            speech_data = speech_file.read()
+1175
+1176        length = len(speech_data)
+1177        if length == 0:
+1178            raise DemoError('file %s length read 0 bytes' % AUDIO_FILE)
+1179        speech = base64.b64encode(speech_data)
+1180        speech = str(speech, 'utf-8')
+1181        params = {'dev_pid': DEV_PID,
+1182                  'format': FORMAT,
+1183                  'rate': RATE,
+1184                  'token': token,
+1185                  'cuid': CUID,
+1186                  'channel': 1,
+1187                  'speech': speech,
+1188                  'len': length
+1189                  }
+1190        post_data = json.dumps(params, sort_keys=False)
+1191        req = Request(ASR_URL, post_data.encode('utf-8'))
+1192        req.add_header('Content-Type', 'application/json')
+1193        try:
+1194            begin = timer()
+1195            f = urlopen(req)
+1196            result_str = f.read()
+1197            print("Request time cost %f" % (timer() - begin))
+1198        except URLError as err:
+1199            print('asr http response http code : ' + str(err.code))
+1200            result_str = err.read()
+1201        try:
+1202            result_str = str(result_str, 'utf-8')
+1203            re = json.loads(result_str)
+1204            text = re['result'][0]
+1205        except:
+1206            text = 'error!'
+1207        return text
+
+ + +

Performs speech recognition using the Baidu ASR API.

+ +

Parameters: + seconds (int, optional): The duration of the audio recording in seconds. Defaults to 3.

+ +

Returns: + str: The recognized text.

+
+ + +
+
+ +
+ + def + SpeechSynthesis(self, texts): + + + +
+ +
1209    def SpeechSynthesis(self, texts):
+1210        """
+1211        Performs speech synthesis (text-to-speech) using the Baidu TTS API.
+1212
+1213        Parameters:
+1214            texts (str): The text to be synthesized.
+1215        """
+1216        from urllib.request import urlopen
+1217        from urllib.request import Request
+1218        from urllib.error import URLError
+1219        from urllib.parse import urlencode
+1220        from urllib.parse import quote_plus
+1221
+1222        TEXT = texts
+1223        PER = 0
+1224        SPD = 5
+1225        PIT = 5
+1226        VOL = 5
+1227        AUE = 6
+1228        FORMATS = {3: "mp3", 4: "pcm", 5: "pcm", 6: "wav"}
+1229        FORMAT = FORMATS[AUE]
+1230        CUID = "123456PYTHON"
+1231        TTS_URL = 'http://tsn.baidu.com/text2audio'
+1232
+1233        SCOPE = 'audio_tts_post'
+1234
+1235        token = self.fetch_token()
+1236        tex = quote_plus(TEXT)
+1237        print(tex)
+1238        params = {'tok': token, 'tex': tex, 'per': PER, 'spd': SPD, 'pit': PIT, 'vol': VOL, 'aue': AUE, 'cuid': CUID,
+1239                  'lan': 'zh', 'ctp': 1}
+1240
+1241        data = urlencode(params)
+1242        print('test on Web Browser' + TTS_URL + '?' + data)
+1243
+1244        req = Request(TTS_URL, data.encode('utf-8'))
+1245        has_error = False
+1246        try:
+1247            f = urlopen(req)
+1248            result_str = f.read()
+1249
+1250            headers = dict((name.lower(), value) for name, value in f.headers.items())
+1251
+1252            has_error = ('content-type' not in headers.keys() or headers['content-type'].find('audio/') < 0)
+1253        except URLError as err:
+1254            print('asr http response http code : ' + str(err.code))
+1255            result_str = err.read()
+1256            has_error = True
+1257
+1258        path = "/home/pi/xgoMusic/"
+1259        save_file = "error.txt" if has_error else 'result.' + FORMAT
+1260        with open(path + save_file, 'wb') as of:
+1261            of.write(result_str)
+1262
+1263        if has_error:
+1264            result_str = str(result_str, 'utf-8')
+1265            print("tts api  error:" + result_str)
+1266
+1267        print("result saved as :" + save_file)
+1268
+1269        self.xgoSpeaker("result.wav")
+
+ + +

Performs speech synthesis (text-to-speech) using the Baidu TTS API.

+ +

Parameters: + texts (str): The text to be synthesized.

+
+ + +
+
+ +
+ + def + cv2AddChineseText(self, img, text, position, textColor=(0, 255, 0), textSize=30): + + + +
+ +
1271    def cv2AddChineseText(self, img, text, position, textColor=(0, 255, 0), textSize=30):
+1272        """
+1273        Adds Chinese text to an image using PIL, as OpenCV doesn't support Chinese characters directly.
+1274
+1275        Parameters:
+1276            img (numpy.ndarray): The image to add text to.
+1277            text (str): The Chinese text to add.
+1278            position (tuple): The (x, y) coordinates of the top-left corner of the text.
+1279            textColor (tuple, optional): The RGB color of the text. Defaults to (0, 255, 0) (green).
+1280            textSize (int, optional): The font size. Defaults to 30.
+1281
+1282        Returns:
+1283            numpy.ndarray: The image with the Chinese text added.
+1284        """
+1285        if (isinstance(img, np.ndarray)):
+1286            img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
+1287        draw = ImageDraw.Draw(img)
+1288        fontStyle = ImageFont.truetype(
+1289            "/home/pi/model/msyh.ttc", textSize, encoding="utf-8")
+1290        draw.text(position, text, textColor, font=fontStyle)
+1291        return cv2.cvtColor(np.asarray(img), cv2.COLOR_RGB2BGR)
+
+ + +

Adds Chinese text to an image using PIL, as OpenCV doesn't support Chinese characters directly.

+ +

Parameters: + img (numpy.ndarray): The image to add text to. + text (str): The Chinese text to add. + position (tuple): The (x, y) coordinates of the top-left corner of the text. + textColor (tuple, optional): The RGB color of the text. Defaults to (0, 255, 0) (green). + textSize (int, optional): The font size. Defaults to 30.

+ +

Returns: + numpy.ndarray: The image with the Chinese text added.

+
+ + +
+
+ +
+ + def + QRRecognition(self, target='camera'): + + + +
+ +
1293    def QRRecognition(self, target="camera"):
+1294        """
+1295        Performs QR code recognition on an image or video frame and displays the results on the LCD.
+1296
+1297        Parameters:
+1298            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1299
+1300        Returns:
+1301            list: A list of decoded QR code data strings.
+1302        """
+1303        import pyzbar.pyzbar as pyzbar
+1304        if target == "camera":
+1305            self.open_camera()
+1306            success, img = self.cap.read()
+1307        else:
+1308            path = "/home/pi/xgoPictures/"
+1309            img = np.array(Image.open(path + target))
+1310
+1311        barcodes = pyzbar.decode(img)
+1312        result = []
+1313        for barcode in barcodes:
+1314            barcodeData = barcode.data.decode("utf-8")
+1315            barcodeType = barcode.type
+1316            result.append(barcodeData)
+1317            text = "{} ({})".format(barcodeData, barcodeType)
+1318            img = self.cv2AddChineseText(img, text, (10, 30), (0, 255, 0), 30)
+1319        try:
+1320            re = result[0]
+1321        except:
+1322            result = []
+1323        b, g, r = cv2.split(img)
+1324        img = cv2.merge((r, g, b))
+1325        imgok = Image.fromarray(img)
+1326        self.display.ShowImage(imgok)
+1327        return result
+
+ + +

Performs QR code recognition on an image or video frame and displays the results on the LCD.

+ +

Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".

+ +

Returns: + list: A list of decoded QR code data strings.

+
+ + +
+
+ +
+ + def + ColorRecognition(self, target='camera', mode='R'): + + + +
+ +
1329    def ColorRecognition(self, target="camera", mode='R'):
+1330        """
+1331        Performs color recognition on an image or video frame, identifies the largest contour of the specified color, and displays the results on the LCD.
+1332
+1333        Parameters:
+1334            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1335            mode (str, optional): The color to recognize ('R' for red, 'G' for green, 'B' for blue, 'Y' for yellow). Defaults to 'R'.
+1336
+1337        Returns:
+1338            tuple: A tuple containing the center coordinates (x, y) and radius of the largest contour of the specified color.
+1339        """
+1340        color_x = 0
+1341        color_y = 0
+1342        color_radius = 0
+1343
+1344        if mode == 'R':  # red
+1345            color_lower = np.array([0, 43, 46])
+1346            color_upper = np.array([10, 255, 255])
+1347        elif mode == 'G':  # green
+1348            color_lower = np.array([35, 43, 46])
+1349            color_upper = np.array([77, 255, 255])
+1350        elif mode == 'B':  # blue
+1351            color_lower = np.array([100, 43, 46])
+1352            color_upper = np.array([124, 255, 255])
+1353        elif mode == 'Y':  # yellow
+1354            color_lower = np.array([26, 43, 46])
+1355            color_upper = np.array([34, 255, 255])
+1356        if target == "camera":
+1357            self.open_camera()
+1358            success, frame = self.cap.read()
+1359        else:
+1360            path = "/home/pi/xgoPictures/"
+1361            frame = np.array(Image.open(path + target))
+1362        frame_ = cv2.GaussianBlur(frame, (5, 5), 0)
+1363        hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
+1364        mask = cv2.inRange(hsv, color_lower, color_upper)
+1365        mask = cv2.erode(mask, None, iterations=2)
+1366        mask = cv2.dilate(mask, None, iterations=2)
+1367        mask = cv2.GaussianBlur(mask, (3, 3), 0)
+1368        cnts = cv2.findContours(mask.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)[-2]
+1369
+1370        if len(cnts) > 0:
+1371            cnt = max(cnts, key=cv2.contourArea)
+1372            (color_x, color_y), color_radius = cv2.minEnclosingCircle(cnt)
+1373            cv2.circle(frame, (int(color_x), int(color_y)), int(color_radius), (255, 0, 255), 2)
+1374        cv2.putText(frame, "X:%d, Y%d" % (int(color_x), int(color_y)), (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.8,
+1375                    (255, 255, 0), 3)
+1376
+1377        b, g, r = cv2.split(frame)
+1378        img = cv2.merge((r, g, b))
+1379        imgok = Image.fromarray(img)
+1380        self.display.ShowImage(imgok)
+1381
+1382        return ((color_x, color_y), color_radius)
+
+ + +

Performs color recognition on an image or video frame, identifies the largest contour of the specified color, and displays the results on the LCD.

+ +

Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + mode (str, optional): The color to recognize ('R' for red, 'G' for green, 'B' for blue, 'Y' for yellow). Defaults to 'R'.

+ +

Returns: + tuple: A tuple containing the center coordinates (x, y) and radius of the largest contour of the specified color.

+
+ + +
+
+ +
+ + def + cap_color_mask( self, position=None, scale=25, h_error=20, s_limit=[90, 255], v_limit=[90, 230]): + + + +
+ +
1384    def cap_color_mask(self, position=None, scale=25, h_error=20, s_limit=[90, 255], v_limit=[90, 230]):
+1385        """
+1386        Captures a color mask from the camera feed based on a specified region and displays it on the LCD.
+1387
+1388        Parameters:
+1389            position (list, optional): The top-left corner coordinates (x, y) of the region to sample for color. Defaults to [160, 100].
+1390            scale (int, optional): The width and height of the square region to sample. Defaults to 25.
+1391            h_error (int, optional): The tolerance for hue variation. Defaults to 20.
+1392            s_limit (list, optional): The lower and upper limits for saturation. Defaults to [90, 255].
+1393            v_limit (list, optional): The lower and upper limits for value (brightness). Defaults to [90, 230].
+1394
+1395        Returns:
+1396            list: A list containing two lists, representing the lower and upper bounds of the captured color mask in HSV format.
+1397        """
+1398        if position is None:
+1399            position = [160, 100]
+1400        count = 0
+1401        self.open_camera()
+1402        while True:
+1403            if self.xgoButton("c"):
+1404                break
+1405            success, frame = self.cap.read()
+1406            b, g, r = cv2.split(frame)
+1407            frame_bgr = cv2.merge((r, g, b))
+1408            hsv = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2HSV)
+1409            h, s, v = cv2.split(hsv)
+1410            color = np.mean(h[position[1]:position[1] + scale, position[0]:position[0] + scale])
+1411            if self.xgoButton("b") and count == 0:
+1412                count += 1
+1413                color = np.mean(h[position[1]:position[1] + scale, position[0]:position[0] + scale])
+1414                color_lower = [max(color - h_error, 0), s_limit[0], v_limit[0]]
+1415                color_upper = [min(color + h_error, 255), s_limit[1], v_limit[1]]
+1416                return [color_lower, color_upper]
+1417
+1418            if count == 0:
+1419                cv2.rectangle(frame, (position[0], position[1]), (position[0] + scale, position[1] + scale),
+1420                              (255, 255, 255), 2)
+1421                cv2.putText(frame, 'press button B', (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2)
+1422            b, g, r = cv2.split(frame)
+1423            img = cv2.merge((r, g, b))
+1424            imgok = Image.fromarray(img)
+1425            self.display.ShowImage(imgok)
+
+ + +

Captures a color mask from the camera feed based on a specified region and displays it on the LCD.

+ +

Parameters: + position (list, optional): The top-left corner coordinates (x, y) of the region to sample for color. Defaults to [160, 100]. + scale (int, optional): The width and height of the square region to sample. Defaults to 25. + h_error (int, optional): The tolerance for hue variation. Defaults to 20. + s_limit (list, optional): The lower and upper limits for saturation. Defaults to [90, 255]. + v_limit (list, optional): The lower and upper limits for value (brightness). Defaults to [90, 230].

+ +

Returns: + list: A list containing two lists, representing the lower and upper bounds of the captured color mask in HSV format.

+
+ + +
+
+ +
+ + def + filter_img(self, frame, color): + + + +
+ +
1427    def filter_img(self, frame, color):
+1428        """
+1429        Applies a color mask to an image frame, isolating the specified color.
+1430
+1431        Parameters:
+1432            frame (numpy.ndarray): The input image frame.
+1433            color (list or str): The color to filter. Can be a list of two lists representing the lower and upper bounds of the color mask in HSV format, or a string representing a predefined color ('red', 'green', 'blue', 'yellow').
+1434
+1435        Returns:
+1436            numpy.ndarray: The image frame with the color mask applied.
+1437        """
+1438        b, g, r = cv2.split(frame)
+1439        frame_bgr = cv2.merge((r, g, b))
+1440        hsv = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2HSV)
+1441        if isinstance(color, list):
+1442            color_lower = np.array(color[0])
+1443            color_upper = np.array(color[1])
+1444        else:
+1445            color_upper, color_lower = get_color_mask(color)
+1446        mask = cv2.inRange(hsv, color_lower, color_upper)
+1447        img_mask = cv2.bitwise_and(frame, frame, mask=mask)
+1448        return img_mask
+
+ + +

Applies a color mask to an image frame, isolating the specified color.

+ +

Parameters: + frame (numpy.ndarray): The input image frame. + color (list or str): The color to filter. Can be a list of two lists representing the lower and upper bounds of the color mask in HSV format, or a string representing a predefined color ('red', 'green', 'blue', 'yellow').

+ +

Returns: + numpy.ndarray: The image frame with the color mask applied.

+
+ + +
+
+ +
+ + def + BallRecognition(self, color_mask, target='camera', p1=36, p2=15, minR=6, maxR=35): + + + +
+ +
1450    def BallRecognition(self, color_mask, target="camera", p1=36, p2=15, minR=6, maxR=35):
+1451        """
+1452        Detects and tracks a ball of a specific color in an image or video frame using Hough Circle Transform.
+1453
+1454        Parameters:
+1455            color_mask (list): A list of two lists, representing the lower and upper bounds of the ball's color in HSV format.
+1456            target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera".
+1457            p1 (int, optional): The higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller). Defaults to 36.
+1458            p2 (int, optional): The accumulator threshold for the circle centers at the detection stage. Defaults to 15.
+1459            minR (int, optional): The minimum circle radius. Defaults to 6.
+1460            maxR (int, optional): The maximum circle radius. Defaults to 35.
+1461
+1462        Returns:
+1463            tuple: A tuple containing the x-coordinate, y-coordinate, and radius of the detected ball.
+1464        """
+1465        x = y = ra = 0
+1466        if target == "camera":
+1467            self.open_camera()
+1468            success, image = self.cap.read()
+1469        else:
+1470            path = "/home/pi/xgoPictures/"
+1471            image = np.array(Image.open(path + target))
+1472
+1473        frame_mask = self.filter_img(image, color_mask)
+1474
+1475        img = cv2.medianBlur(frame_mask, 5)
+1476        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+1477
+1478        circles = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, 20, param1=p1, param2=p2, minRadius=minR, maxRadius=maxR)
+1479        b, g, r = cv2.split(image)
+1480        image = cv2.merge((r, g, b))
+1481        if circles is not None and len(circles[0]) == 1:
+1482            param = circles[0][0]
+1483            x, y, ra = int(param[0]), int(param[1]), int(param[2])
+1484            cv2.circle(image, (x, y), ra, (255, 255, 255), 2)
+1485            cv2.circle(image, (x, y), 2, (255, 255, 255), 2)
+1486        imgok = Image.fromarray(image)
+1487        self.display.ShowImage(imgok)
+1488        return x, y, ra
+
+ + +

Detects and tracks a ball of a specific color in an image or video frame using Hough Circle Transform.

+ +

Parameters: + color_mask (list): A list of two lists, representing the lower and upper bounds of the ball's color in HSV format. + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + p1 (int, optional): The higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller). Defaults to 36. + p2 (int, optional): The accumulator threshold for the circle centers at the detection stage. Defaults to 15. + minR (int, optional): The minimum circle radius. Defaults to 6. + maxR (int, optional): The maximum circle radius. Defaults to 35.

+ +

Returns: + tuple: A tuple containing the x-coordinate, y-coordinate, and radius of the detected ball.

+
+ + +
+
+
+ +
+ + class + DemoError(builtins.Exception): + + + +
+ +
1490class DemoError(Exception):
+1491    """
+1492    A custom exception class for errors related to the Baidu AI API.
+1493    """
+1494    pass
+
+ + +

A custom exception class for errors related to the Baidu AI API.

+
+ + +
+
+ +
+ + class + hands: + + + +
+ +
1496class hands():
+1497    """
+1498    A class for hand detection and landmark estimation using MediaPipe.
+1499    """
+1500    def __init__(self, model_complexity, max_num_hands, min_detection_confidence, min_tracking_confidence):
+1501        """
+1502        Initializes the hands object.
+1503
+1504        Parameters:
+1505            model_complexity (int): Complexity of the hand landmark model: 0 or 1.
+1506            max_num_hands (int): Maximum number of hands to detect.
+1507            min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for hand detection to be considered successful.
+1508            min_tracking_confidence (float): Minimum confidence value ([0.0, 1.0]) for the hand landmarks to be considered tracked successfully.
+1509        """
+1510        import mediapipe as mp
+1511        self.model_complexity = model_complexity
+1512        self.max_num_hands = max_num_hands
+1513        self.min_detection_confidence = min_detection_confidence
+1514        self.min_tracking_confidence = min_tracking_confidence
+1515        self.mp_hands = mp.solutions.hands
+1516        self.hands = self.mp_hands.Hands(
+1517            max_num_hands=self.max_num_hands,
+1518            min_detection_confidence=self.min_detection_confidence,
+1519            min_tracking_confidence=self.min_tracking_confidence,
+1520        )
+1521
+1522    def run(self, cv_img):
+1523        """
+1524        Processes an image and returns hand landmarks and other related information.
+1525
+1526        Parameters:
+1527            cv_img (numpy.ndarray): The input image.
+1528
+1529        Returns:
+1530            list: A list of dictionaries, where each dictionary contains information about a detected hand, including center coordinates, bounding rectangle, landmark coordinates, hand angles, and right/left classification.
+1531        """
+1532        import copy
+1533        image = cv_img
+1534        debug_image = copy.deepcopy(image)
+1535        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+1536        results = self.hands.process(image)
+1537        hf = []
+1538        if results.multi_hand_landmarks is not None:
+1539            for hand_landmarks, handedness in zip(results.multi_hand_landmarks,
+1540                                                  results.multi_handedness):
+1541                # Calculate the center of the palm
+1542                cx, cy = self.calc_palm_moment(debug_image, hand_landmarks)
+1543                # Calculate the bounding rectangle of the hand
+1544                rect = self.calc_bounding_rect(debug_image, hand_landmarks)
+1545                # Get individual landmarks
+1546                dlandmark = self.dlandmarks(debug_image, hand_landmarks, handedness)
+1547
+1548                hf.append({'center': (cx, cy), 'rect': rect, 'dlandmark': dlandmark[0],
+1549                           'hand_angle': self.hand_angle(dlandmark[0]), 'right_left': dlandmark[1]})
+1550        return hf
+1551
+1552    def calc_palm_moment(self, image, landmarks):
+1553        """
+1554        Calculates the moment (center) of the palm.
+1555
+1556        Parameters:
+1557            image (numpy.ndarray): The input image.
+1558            landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.
+1559
+1560        Returns:
+1561            tuple: The (x, y) coordinates of the palm's center.
+1562        """
+1563        image_width, image_height = image.shape[1], image.shape[0]
+1564        palm_array = np.empty((0, 2), int)
+1565        for index, landmark in enumerate(landmarks.landmark):
+1566            landmark_x = min(int(landmark.x * image_width), image_width - 1)
+1567            landmark_y = min(int(landmark.y * image_height), image_height - 1)
+1568            landmark_point = [np.array((landmark_x, landmark_y))]
+1569            if index == 0:  # Wrist 1
+1570                palm_array = np.append(palm_array, landmark_point, axis=0)
+1571            if index == 1:  # Wrist 2
+1572                palm_array = np.append(palm_array, landmark_point, axis=0)
+1573            if index == 5:  # Index finger: base
+1574                palm_array = np.append(palm_array, landmark_point, axis=0)
+1575            if index == 9:  # Middle finger: base
+1576                palm_array = np.append(palm_array, landmark_point, axis=0)
+1577            if index == 13:  # Ring finger: base
+1578                palm_array = np.append(palm_array, landmark_point, axis=0)
+1579            if index == 17:  # Pinky finger: base
+1580                palm_array = np.append(palm_array, landmark_point, axis=0)
+1581        M = cv2.moments(palm_array)
+1582        cx, cy = 0, 0
+1583        if M['m00'] != 0:
+1584            cx = int(M['m10'] / M['m00'])
+1585            cy = int(M['m01'] / M['m00'])
+1586        return cx, cy
+1587
+1588    def calc_bounding_rect(self, image, landmarks):
+1589        """
+1590        Calculates the bounding rectangle of the hand.
+1591
+1592        Parameters:
+1593            image (numpy.ndarray): The input image.
+1594            landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.
+1595
+1596        Returns:
+1597            list: A list [x, y, w, h] representing the bounding rectangle.
+1598        """
+1599        image_width, image_height = image.shape[1], image.shape[0]
+1600        landmark_array = np.empty((0, 2), int)
+1601        for _, landmark in enumerate(landmarks.landmark):
+1602            landmark_x = min(int(landmark.x * image_width), image_width - 1)
+1603            landmark_y = min(int(landmark.y * image_height), image_height - 1)
+1604            landmark_point = [np.array((landmark_x, landmark_y))]
+1605            landmark_array = np.append(landmark_array, landmark_point, axis=0)
+1606        x, y, w, h = cv2.boundingRect(landmark_array)
+1607        return [x, y, w, h]
+1608
+1609    def dlandmarks(self, image, landmarks, handedness):
+1610        """
+1611        Extracts and returns the coordinates of hand landmarks.
+1612
+1613        Parameters:
+1614            image (numpy.ndarray): The input image.
+1615            landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.
+1616            handedness (mediapipe.framework.formats.classification_pb2.ClassificationList): Handedness information.
+1617
+1618        Returns:
+1619            tuple: A tuple containing a list of landmark coordinates and the handedness label ('Right' or 'Left').
+1620        """
+1621        image_width, image_height = image.shape[1], image.shape[0]
+1622        landmark_point = []
+1623        for index, landmark in enumerate(landmarks.landmark):
+1624            if landmark.visibility < 0 or landmark.presence < 0:
+1625                continue
+1626            landmark_x = min(int(landmark.x * image_width), image_width - 1)
+1627            landmark_y = min(int(landmark.y * image_height), image_height - 1)
+1628            landmark_point.append((landmark_x, landmark_y))
+1629        return landmark_point, handedness.classification[0].label[0]
+1630
+1631    def vector_2d_angle(self, v1, v2):
+1632        """
+1633        Calculates the angle between two 2D vectors.
+1634
+1635        Parameters:
+1636            v1 (tuple): The first vector (x, y).
+1637            v2 (tuple): The second vector (x, y).
+1638
+1639        Returns:
+1640            float: The angle between the two vectors in degrees.
+1641        """
+1642        v1_x = v1[0]
+1643        v1_y = v1[1]
+1644        v2_x = v2[0]
+1645        v2_y = v2[1]
+1646        try:
+1647            angle_ = math.degrees(math.acos((v1_x * v2_x + v1_y * v2_y) / (((v1_x ** 2 + v1_y ** 2) ** 0.5) * ((v2_x ** 2 + v2_y ** 2) ** 0.5))))
+1648        except:
+1649            angle_ = 180
+1650        return angle_
+1651
+1652    def hand_angle(self, hand_):
+1653        """
+1654        Calculates the angles of the fingers.
+1655
+1656        Parameters:
+1657            hand_ (list): A list of hand landmark coordinates.
+1658
+1659        Returns:
+1660            list: A list of finger angles (thumb, index, middle, ring, pinky).
+1661        """
+1662        angle_list = []
+1663        # thumb Thumb angle
+1664        angle_ = self.vector_2d_angle(
+1665            ((int(hand_[0][0]) - int(hand_[2][0])), (int(hand_[0][1]) - int(hand_[2][1]))),
+1666            ((int(hand_[3][0]) - int(hand_[4][0])), (int(hand_[3][1]) - int(hand_[4][1])))
+1667        )
+1668        angle_list.append(angle_)
+1669        # index Index finger angle
+1670        angle_ = self.vector_2d_angle(
+1671            ((int(hand_[0][0]) - int(hand_[6][0])), (int(hand_[0][1]) - int(hand_[6][1]))),
+1672            ((int(hand_[7][0]) - int(hand_[8][0])), (int(hand_[7][1]) - int(hand_[8][1])))
+1673        )
+1674        angle_list.append(angle_)
+1675        # middle Middle finger angle
+1676        angle_ = self.vector_2d_angle(
+1677            ((int(hand_[0][0]) - int(hand_[10][0])), (int(hand_[0][1]) - int(hand_[10][1]))),
+1678            ((int(hand_[11][0]) - int(hand_[12][0])), (int(hand_[11][1]) - int(hand_[12][1])))
+1679        )
+1680        angle_list.append(angle_)
+1681        # ring Ring finger angle
+1682        angle_ = self.vector_2d_angle(
+1683            ((int(hand_[0][0]) - int(hand_[14][0])), (int(hand_[0][1]) - int(hand_[14][1]))),
+1684            ((int(hand_[15][0]) - int(hand_[16][0])), (int(hand_[15][1]) - int(hand_[16][1])))
+1685        )
+1686        angle_list.append(angle_)
+1687        # pink Pinky finger angle
+1688        angle_ = self.vector_2d_angle(
+1689            ((int(hand_[0][0]) - int(hand_[18][0])), (int(hand_[0][1]) - int(hand_[18][1]))),
+1690            ((int(hand_[19][0]) - int(hand_[20][0])), (int(hand_[19][1]) - int(hand_[20][1])))
+1691        )
+1692        angle_list.append(angle_)
+1693        return angle_list
+
+ + +

A class for hand detection and landmark estimation using MediaPipe.

+
+ + +
+ +
+ + hands( model_complexity, max_num_hands, min_detection_confidence, min_tracking_confidence) + + + +
+ +
1500    def __init__(self, model_complexity, max_num_hands, min_detection_confidence, min_tracking_confidence):
+1501        """
+1502        Initializes the hands object.
+1503
+1504        Parameters:
+1505            model_complexity (int): Complexity of the hand landmark model: 0 or 1.
+1506            max_num_hands (int): Maximum number of hands to detect.
+1507            min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for hand detection to be considered successful.
+1508            min_tracking_confidence (float): Minimum confidence value ([0.0, 1.0]) for the hand landmarks to be considered tracked successfully.
+1509        """
+1510        import mediapipe as mp
+1511        self.model_complexity = model_complexity
+1512        self.max_num_hands = max_num_hands
+1513        self.min_detection_confidence = min_detection_confidence
+1514        self.min_tracking_confidence = min_tracking_confidence
+1515        self.mp_hands = mp.solutions.hands
+1516        self.hands = self.mp_hands.Hands(
+1517            max_num_hands=self.max_num_hands,
+1518            min_detection_confidence=self.min_detection_confidence,
+1519            min_tracking_confidence=self.min_tracking_confidence,
+1520        )
+
+ + +

Initializes the hands object.

+ +

Parameters: + model_complexity (int): Complexity of the hand landmark model: 0 or 1. + max_num_hands (int): Maximum number of hands to detect. + min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for hand detection to be considered successful. + min_tracking_confidence (float): Minimum confidence value ([0.0, 1.0]) for the hand landmarks to be considered tracked successfully.

+
+ + +
+
+
+ model_complexity + + +
+ + + + +
+
+
+ max_num_hands + + +
+ + + + +
+
+
+ min_detection_confidence + + +
+ + + + +
+
+
+ min_tracking_confidence + + +
+ + + + +
+
+
+ mp_hands + + +
+ + + + +
+
+
+ hands + + +
+ + + + +
+
+ +
+ + def + run(self, cv_img): + + + +
+ +
1522    def run(self, cv_img):
+1523        """
+1524        Processes an image and returns hand landmarks and other related information.
+1525
+1526        Parameters:
+1527            cv_img (numpy.ndarray): The input image.
+1528
+1529        Returns:
+1530            list: A list of dictionaries, where each dictionary contains information about a detected hand, including center coordinates, bounding rectangle, landmark coordinates, hand angles, and right/left classification.
+1531        """
+1532        import copy
+1533        image = cv_img
+1534        debug_image = copy.deepcopy(image)
+1535        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+1536        results = self.hands.process(image)
+1537        hf = []
+1538        if results.multi_hand_landmarks is not None:
+1539            for hand_landmarks, handedness in zip(results.multi_hand_landmarks,
+1540                                                  results.multi_handedness):
+1541                # Calculate the center of the palm
+1542                cx, cy = self.calc_palm_moment(debug_image, hand_landmarks)
+1543                # Calculate the bounding rectangle of the hand
+1544                rect = self.calc_bounding_rect(debug_image, hand_landmarks)
+1545                # Get individual landmarks
+1546                dlandmark = self.dlandmarks(debug_image, hand_landmarks, handedness)
+1547
+1548                hf.append({'center': (cx, cy), 'rect': rect, 'dlandmark': dlandmark[0],
+1549                           'hand_angle': self.hand_angle(dlandmark[0]), 'right_left': dlandmark[1]})
+1550        return hf
+
+ + +

Processes an image and returns hand landmarks and other related information.

+ +

Parameters: + cv_img (numpy.ndarray): The input image.

+ +

Returns: + list: A list of dictionaries, where each dictionary contains information about a detected hand, including center coordinates, bounding rectangle, landmark coordinates, hand angles, and right/left classification.

+
+ + +
+
+ +
+ + def + calc_palm_moment(self, image, landmarks): + + + +
+ +
1552    def calc_palm_moment(self, image, landmarks):
+1553        """
+1554        Calculates the moment (center) of the palm.
+1555
+1556        Parameters:
+1557            image (numpy.ndarray): The input image.
+1558            landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.
+1559
+1560        Returns:
+1561            tuple: The (x, y) coordinates of the palm's center.
+1562        """
+1563        image_width, image_height = image.shape[1], image.shape[0]
+1564        palm_array = np.empty((0, 2), int)
+1565        for index, landmark in enumerate(landmarks.landmark):
+1566            landmark_x = min(int(landmark.x * image_width), image_width - 1)
+1567            landmark_y = min(int(landmark.y * image_height), image_height - 1)
+1568            landmark_point = [np.array((landmark_x, landmark_y))]
+1569            if index == 0:  # Wrist 1
+1570                palm_array = np.append(palm_array, landmark_point, axis=0)
+1571            if index == 1:  # Wrist 2
+1572                palm_array = np.append(palm_array, landmark_point, axis=0)
+1573            if index == 5:  # Index finger: base
+1574                palm_array = np.append(palm_array, landmark_point, axis=0)
+1575            if index == 9:  # Middle finger: base
+1576                palm_array = np.append(palm_array, landmark_point, axis=0)
+1577            if index == 13:  # Ring finger: base
+1578                palm_array = np.append(palm_array, landmark_point, axis=0)
+1579            if index == 17:  # Pinky finger: base
+1580                palm_array = np.append(palm_array, landmark_point, axis=0)
+1581        M = cv2.moments(palm_array)
+1582        cx, cy = 0, 0
+1583        if M['m00'] != 0:
+1584            cx = int(M['m10'] / M['m00'])
+1585            cy = int(M['m01'] / M['m00'])
+1586        return cx, cy
+
+ + +

Calculates the moment (center) of the palm.

+ +

Parameters: + image (numpy.ndarray): The input image. + landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.

+ +

Returns: + tuple: The (x, y) coordinates of the palm's center.

+
+ + +
+
+ +
+ + def + calc_bounding_rect(self, image, landmarks): + + + +
+ +
1588    def calc_bounding_rect(self, image, landmarks):
+1589        """
+1590        Calculates the bounding rectangle of the hand.
+1591
+1592        Parameters:
+1593            image (numpy.ndarray): The input image.
+1594            landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.
+1595
+1596        Returns:
+1597            list: A list [x, y, w, h] representing the bounding rectangle.
+1598        """
+1599        image_width, image_height = image.shape[1], image.shape[0]
+1600        landmark_array = np.empty((0, 2), int)
+1601        for _, landmark in enumerate(landmarks.landmark):
+1602            landmark_x = min(int(landmark.x * image_width), image_width - 1)
+1603            landmark_y = min(int(landmark.y * image_height), image_height - 1)
+1604            landmark_point = [np.array((landmark_x, landmark_y))]
+1605            landmark_array = np.append(landmark_array, landmark_point, axis=0)
+1606        x, y, w, h = cv2.boundingRect(landmark_array)
+1607        return [x, y, w, h]
+
+ + +

Calculates the bounding rectangle of the hand.

+ +

Parameters: + image (numpy.ndarray): The input image. + landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.

+ +

Returns: + list: A list [x, y, w, h] representing the bounding rectangle.

+
+ + +
+
+ +
+ + def + dlandmarks(self, image, landmarks, handedness): + + + +
+ +
1609    def dlandmarks(self, image, landmarks, handedness):
+1610        """
+1611        Extracts and returns the coordinates of hand landmarks.
+1612
+1613        Parameters:
+1614            image (numpy.ndarray): The input image.
+1615            landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks.
+1616            handedness (mediapipe.framework.formats.classification_pb2.ClassificationList): Handedness information.
+1617
+1618        Returns:
+1619            tuple: A tuple containing a list of landmark coordinates and the handedness label ('Right' or 'Left').
+1620        """
+1621        image_width, image_height = image.shape[1], image.shape[0]
+1622        landmark_point = []
+1623        for index, landmark in enumerate(landmarks.landmark):
+1624            if landmark.visibility < 0 or landmark.presence < 0:
+1625                continue
+1626            landmark_x = min(int(landmark.x * image_width), image_width - 1)
+1627            landmark_y = min(int(landmark.y * image_height), image_height - 1)
+1628            landmark_point.append((landmark_x, landmark_y))
+1629        return landmark_point, handedness.classification[0].label[0]
+
+ + +

Extracts and returns the coordinates of hand landmarks.

+ +

Parameters: + image (numpy.ndarray): The input image. + landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks. + handedness (mediapipe.framework.formats.classification_pb2.ClassificationList): Handedness information.

+ +

Returns: + tuple: A tuple containing a list of landmark coordinates and the handedness label ('Right' or 'Left').

+
+ + +
+
+ +
+ + def + vector_2d_angle(self, v1, v2): + + + +
+ +
1631    def vector_2d_angle(self, v1, v2):
+1632        """
+1633        Calculates the angle between two 2D vectors.
+1634
+1635        Parameters:
+1636            v1 (tuple): The first vector (x, y).
+1637            v2 (tuple): The second vector (x, y).
+1638
+1639        Returns:
+1640            float: The angle between the two vectors in degrees.
+1641        """
+1642        v1_x = v1[0]
+1643        v1_y = v1[1]
+1644        v2_x = v2[0]
+1645        v2_y = v2[1]
+1646        try:
+1647            angle_ = math.degrees(math.acos((v1_x * v2_x + v1_y * v2_y) / (((v1_x ** 2 + v1_y ** 2) ** 0.5) * ((v2_x ** 2 + v2_y ** 2) ** 0.5))))
+1648        except:
+1649            angle_ = 180
+1650        return angle_
+
+ + +

Calculates the angle between two 2D vectors.

+ +

Parameters: + v1 (tuple): The first vector (x, y). + v2 (tuple): The second vector (x, y).

+ +

Returns: + float: The angle between the two vectors in degrees.

+
+ + +
+
+ +
+ + def + hand_angle(self, hand_): + + + +
+ +
1652    def hand_angle(self, hand_):
+1653        """
+1654        Calculates the angles of the fingers.
+1655
+1656        Parameters:
+1657            hand_ (list): A list of hand landmark coordinates.
+1658
+1659        Returns:
+1660            list: A list of finger angles (thumb, index, middle, ring, pinky).
+1661        """
+1662        angle_list = []
+1663        # thumb Thumb angle
+1664        angle_ = self.vector_2d_angle(
+1665            ((int(hand_[0][0]) - int(hand_[2][0])), (int(hand_[0][1]) - int(hand_[2][1]))),
+1666            ((int(hand_[3][0]) - int(hand_[4][0])), (int(hand_[3][1]) - int(hand_[4][1])))
+1667        )
+1668        angle_list.append(angle_)
+1669        # index Index finger angle
+1670        angle_ = self.vector_2d_angle(
+1671            ((int(hand_[0][0]) - int(hand_[6][0])), (int(hand_[0][1]) - int(hand_[6][1]))),
+1672            ((int(hand_[7][0]) - int(hand_[8][0])), (int(hand_[7][1]) - int(hand_[8][1])))
+1673        )
+1674        angle_list.append(angle_)
+1675        # middle Middle finger angle
+1676        angle_ = self.vector_2d_angle(
+1677            ((int(hand_[0][0]) - int(hand_[10][0])), (int(hand_[0][1]) - int(hand_[10][1]))),
+1678            ((int(hand_[11][0]) - int(hand_[12][0])), (int(hand_[11][1]) - int(hand_[12][1])))
+1679        )
+1680        angle_list.append(angle_)
+1681        # ring Ring finger angle
+1682        angle_ = self.vector_2d_angle(
+1683            ((int(hand_[0][0]) - int(hand_[14][0])), (int(hand_[0][1]) - int(hand_[14][1]))),
+1684            ((int(hand_[15][0]) - int(hand_[16][0])), (int(hand_[15][1]) - int(hand_[16][1])))
+1685        )
+1686        angle_list.append(angle_)
+1687        # pink Pinky finger angle
+1688        angle_ = self.vector_2d_angle(
+1689            ((int(hand_[0][0]) - int(hand_[18][0])), (int(hand_[0][1]) - int(hand_[18][1]))),
+1690            ((int(hand_[19][0]) - int(hand_[20][0])), (int(hand_[19][1]) - int(hand_[20][1])))
+1691        )
+1692        angle_list.append(angle_)
+1693        return angle_list
+
+ + +

Calculates the angles of the fingers.

+ +

Parameters: + hand_ (list): A list of hand landmark coordinates.

+ +

Returns: + list: A list of finger angles (thumb, index, middle, ring, pinky).

+
+ + +
+
+
+ +
+ + class + yoloXgo: + + + +
+ +
1695class yoloXgo():
+1696    """
+1697    A class for object detection using YOLO (You Only Look Once) models with ONNX Runtime.
+1698    """
+1699    def __init__(self, model, classes, inputwh, thresh):
+1700        """
+1701        Initializes the yoloXgo object.
+1702
+1703        Parameters:
+1704            model (str): The path to the ONNX model file.
+1705            classes (list): A list of class names.
+1706            inputwh (list): A list [width, height] representing the input size of the model.
+1707            thresh (float): The confidence threshold for object detection.
+1708        """
+1709        import onnxruntime
+1710        self.session = onnxruntime.InferenceSession(model)
+1711        self.input_width = inputwh[0]
+1712        self.input_height = inputwh[1]
+1713        self.thresh = thresh
+1714        self.classes = classes
+1715
+1716    def sigmoid(self, x):
+1717        """
+1718        Computes the sigmoid function.
+1719
+1720        Parameters:
+1721            x (float or numpy.ndarray): The input value.
+1722
+1723        Returns:
+1724            float or numpy.ndarray: The sigmoid of the input.
+1725        """
+1726        return 1. / (1 + np.exp(-x))
+1727
+1728    # tanh function
+1729    def tanh(self, x):
+1730        """
+1731        Computes the hyperbolic tangent function.
+1732
+1733        Parameters:
+1734            x (float or numpy.ndarray): The input value.
+1735
+1736        Returns:
+1737            float or numpy.ndarray: The hyperbolic tangent of the input.
+1738        """
+1739        return 2. / (1 + np.exp(-2 * x)) - 1
+1740
+1741    # Data preprocessing
+1742    def preprocess(self, src_img, size):
+1743        """
+1744        Preprocesses the input image for the YOLO model.
+1745
+1746        Parameters:
+1747            src_img (numpy.ndarray): The input image.
+1748            size (list): A list [width, height] representing the target size.
+1749
+1750        Returns:
+1751            numpy.ndarray: The preprocessed image data.
+1752        """
+1753        output = cv2.resize(src_img, (size[0], size[1]), interpolation=cv2.INTER_AREA)
+1754        output = output.transpose(2, 0, 1)
+1755        output = output.reshape((1, 3, size[1], size[0])) / 255
+1756        return output.astype('float32')
+1757
+1758        # nms algorithm
+1759
+1760    def nms(self, dets, thresh=0.45):
+1761        """
+1762        Performs Non-Maximum Suppression (NMS) to filter out overlapping bounding boxes.
+1763
+1764        Parameters:
+1765            dets (numpy.ndarray): An array of bounding boxes with shape (N, 6), where N is the number of boxes, and each box is represented as [x1, y1, x2, y2, score, class_index].
+1766            thresh (float, optional): The IoU (Intersection over Union) threshold for suppression. Defaults to 0.45.
+1767
+1768        Returns:
+1769            list: A list of filtered bounding boxes, each represented as [x1, y1, x2, y2, score, class_index].
+1770        """
+1771        # dets:N*M,N is the number of bbox, the first 4 digits of M are the corresponding (x1, y1, x2, y2), and the 5th digit is the corresponding score
+1772        # #thresh:0.3,0.5....
+1773        x1 = dets[:, 0]
+1774        y1 = dets[:, 1]
+1775        x2 = dets[:, 2]
+1776        y2 = dets[:, 3]
+1777        scores = dets[:, 4]
+1778        areas = (x2 - x1 + 1) * (y2 - y1 + 1)  # Calculate the area of each bbox
+1779        order = scores.argsort()[::-1]  # Sort scores in descending order
+1780        keep = []  # Used to store the bboxx subscripts that are finally retained
+1781
+1782        while order.size > 0:
+1783            i = order[0]  # Unconditionally keep the bbox with the highest confidence in each iteration
+1784            keep.append(i)
+1785
+1786            # Calculate the intersection area between the bbox with the highest confidence and the other remaining bboxes
+1787            xx1 = np.maximum(x1[i], x1[order[1:]])
+1788            yy1 = np.maximum(y1[i], y1[order[1:]])
+1789            xx2 = np.minimum(x2[i], x2[order[1:]])
+1790            yy2 = np.minimum(y2[i], y2[order[1:]])
+1791
+1792            # Calculate the area of the intersection area between the high-confidence bbox and the other remaining bboxes
+1793            w = np.maximum(0.0, xx2 - xx1 + 1)
+1794            h = np.maximum(0.0, yy2 - yy1 + 1)
+1795            inter = w * h
+1796
+1797            # Calculate the ratio of the area of the intersection area to the area of both (the bbox with high confidence and other bboxes)
+1798            ovr = inter / (areas[i] + areas[order[1:]] - inter)
+1799
+1800            # Keep the bbox whose ovr is less than thresh and enter the next iteration.
+1801            inds = np.where(ovr <= thresh)[0]
+1802
+1803            # Because the index in ovr does not include order[0], it needs to be moved one bit backward
+1804            order = order[inds + 1]
+1805
+1806        output = []
+1807        for i in keep:
+1808            output.append(dets[i].tolist())
+1809
+1810        return output
+1811
+1812    def run(self, img, ):
+1813        """
+1814        Runs object detection on an image using the YOLO model.
+1815
+1816        Parameters:
+1817            img (numpy.ndarray): The input image.
+1818
+1819        Returns:
+1820            list or bool: A list of dictionaries, where each dictionary represents a detected object and contains the class name, confidence score, and bounding box coordinates. Returns False if no objects are detected.
+1821        """
+1822        pred = []
+1823
+1824        # Original width and height of the input image
+1825        H, W, _ = img.shape
+1826
+1827        # Data preprocessing: resize, 1/255
+1828        data = self.preprocess(img, [self.input_width, self.input_height])
+1829
+1830        # Model inference
+1831        input_name = self.session.get_inputs()[0].name
+1832        feature_map = self.session.run([], {input_name: data})[0][0]
+1833
+1834        # Output feature map transpose: CHW, HWC
+1835        feature_map = feature_map.transpose(1, 2, 0)
+1836        # The width and height of the output feature map
+1837        feature_map_height = feature_map.shape[0]
+1838        feature_map_width = feature_map.shape[1]
+1839
+1840        # Feature map post-processing
+1841        for h in range(feature_map_height):
+1842            for w in range(feature_map_width):
+1843                data = feature_map[h][w]
+1844
+1845                # Resolve detection frame confidence
+1846                obj_score, cls_score = data[0], data[5:].max()
+1847                score = (obj_score ** 0.6) * (cls_score ** 0.4)
+1848
+1849                # Threshold screening
+1850                if score > self.thresh:
+1851                    # Detection frame category
+1852                    cls_index = np.argmax(data[5:])
+1853                    # Detection frame center point offset
+1854                    x_offset, y_offset = self.tanh(data[1]), self.tanh(data[2])
+1855                    # Normalized width and height of the detection frame
+1856                    box_width, box_height = self.sigmoid(data[3]), self.sigmoid(data[4])
+1857                    # The center point after normalization of the detection frame
+1858                    box_cx = (w + x_offset) / feature_map_width
+1859                    box_cy = (h + y_offset) / feature_map_height
+1860
+1861                    # cx,cy,w,h => x1, y1, x2, y2
+1862                    x1, y1 = box_cx - 0.5 * box_width, box_cy - 0.5 * box_height
+1863                    x2, y2 = box_cx + 0.5 * box_width, box_cy + 0.5 * box_height
+1864                    x1, y1, x2, y2 = int(x1 * W), int(y1 * H), int(x2 * W), int(y2 * H)
+1865
+1866                    pred.append([x1, y1, x2, y2, score, cls_index])
+1867        datas = np.array(pred)
+1868        data = []
+1869        if len(datas) > 0:
+1870            boxes = self.nms(datas)
+1871            for b in boxes:
+1872                obj_score, cls_index = b[4], int(b[5])
+1873                x1, y1, x2, y2 = int(b[0]), int(b[1]), int(b[2]), int(b[3])
+1874                s = {'classes': self.classes[cls_index], 'score': '%.2f' % obj_score, 'xywh': [x1, y1, x2 - x1, y2 - y1], }
+1875                data.append(s)
+1876            return data
+1877        else:
+1878            return False
+
+ + +

A class for object detection using YOLO (You Only Look Once) models with ONNX Runtime.

+
+ + +
+ +
+ + yoloXgo(model, classes, inputwh, thresh) + + + +
+ +
1699    def __init__(self, model, classes, inputwh, thresh):
+1700        """
+1701        Initializes the yoloXgo object.
+1702
+1703        Parameters:
+1704            model (str): The path to the ONNX model file.
+1705            classes (list): A list of class names.
+1706            inputwh (list): A list [width, height] representing the input size of the model.
+1707            thresh (float): The confidence threshold for object detection.
+1708        """
+1709        import onnxruntime
+1710        self.session = onnxruntime.InferenceSession(model)
+1711        self.input_width = inputwh[0]
+1712        self.input_height = inputwh[1]
+1713        self.thresh = thresh
+1714        self.classes = classes
+
+ + +

Initializes the yoloXgo object.

+ +

Parameters: + model (str): The path to the ONNX model file. + classes (list): A list of class names. + inputwh (list): A list [width, height] representing the input size of the model. + thresh (float): The confidence threshold for object detection.

+
+ + +
+
+
+ session + + +
+ + + + +
+
+
+ input_width + + +
+ + + + +
+
+
+ input_height + + +
+ + + + +
+
+
+ thresh + + +
+ + + + +
+
+
+ classes + + +
+ + + + +
+
+ +
+ + def + sigmoid(self, x): + + + +
+ +
1716    def sigmoid(self, x):
+1717        """
+1718        Computes the sigmoid function.
+1719
+1720        Parameters:
+1721            x (float or numpy.ndarray): The input value.
+1722
+1723        Returns:
+1724            float or numpy.ndarray: The sigmoid of the input.
+1725        """
+1726        return 1. / (1 + np.exp(-x))
+
+ + +

Computes the sigmoid function.

+ +

Parameters: + x (float or numpy.ndarray): The input value.

+ +

Returns: + float or numpy.ndarray: The sigmoid of the input.

+
+ + +
+
+ +
+ + def + tanh(self, x): + + + +
+ +
1729    def tanh(self, x):
+1730        """
+1731        Computes the hyperbolic tangent function.
+1732
+1733        Parameters:
+1734            x (float or numpy.ndarray): The input value.
+1735
+1736        Returns:
+1737            float or numpy.ndarray: The hyperbolic tangent of the input.
+1738        """
+1739        return 2. / (1 + np.exp(-2 * x)) - 1
+
+ + +

Computes the hyperbolic tangent function.

+ +

Parameters: + x (float or numpy.ndarray): The input value.

+ +

Returns: + float or numpy.ndarray: The hyperbolic tangent of the input.

+
+ + +
+
+ +
+ + def + preprocess(self, src_img, size): + + + +
+ +
1742    def preprocess(self, src_img, size):
+1743        """
+1744        Preprocesses the input image for the YOLO model.
+1745
+1746        Parameters:
+1747            src_img (numpy.ndarray): The input image.
+1748            size (list): A list [width, height] representing the target size.
+1749
+1750        Returns:
+1751            numpy.ndarray: The preprocessed image data.
+1752        """
+1753        output = cv2.resize(src_img, (size[0], size[1]), interpolation=cv2.INTER_AREA)
+1754        output = output.transpose(2, 0, 1)
+1755        output = output.reshape((1, 3, size[1], size[0])) / 255
+1756        return output.astype('float32')
+1757
+1758        # nms algorithm
+
+ + +

Preprocesses the input image for the YOLO model.

+ +

Parameters: + src_img (numpy.ndarray): The input image. + size (list): A list [width, height] representing the target size.

+ +

Returns: + numpy.ndarray: The preprocessed image data.

+
+ + +
+
+ +
+ + def + nms(self, dets, thresh=0.45): + + + +
+ +
1760    def nms(self, dets, thresh=0.45):
+1761        """
+1762        Performs Non-Maximum Suppression (NMS) to filter out overlapping bounding boxes.
+1763
+1764        Parameters:
+1765            dets (numpy.ndarray): An array of bounding boxes with shape (N, 6), where N is the number of boxes, and each box is represented as [x1, y1, x2, y2, score, class_index].
+1766            thresh (float, optional): The IoU (Intersection over Union) threshold for suppression. Defaults to 0.45.
+1767
+1768        Returns:
+1769            list: A list of filtered bounding boxes, each represented as [x1, y1, x2, y2, score, class_index].
+1770        """
+1771        # dets:N*M,N is the number of bbox, the first 4 digits of M are the corresponding (x1, y1, x2, y2), and the 5th digit is the corresponding score
+1772        # #thresh:0.3,0.5....
+1773        x1 = dets[:, 0]
+1774        y1 = dets[:, 1]
+1775        x2 = dets[:, 2]
+1776        y2 = dets[:, 3]
+1777        scores = dets[:, 4]
+1778        areas = (x2 - x1 + 1) * (y2 - y1 + 1)  # Calculate the area of each bbox
+1779        order = scores.argsort()[::-1]  # Sort scores in descending order
+1780        keep = []  # Used to store the bboxx subscripts that are finally retained
+1781
+1782        while order.size > 0:
+1783            i = order[0]  # Unconditionally keep the bbox with the highest confidence in each iteration
+1784            keep.append(i)
+1785
+1786            # Calculate the intersection area between the bbox with the highest confidence and the other remaining bboxes
+1787            xx1 = np.maximum(x1[i], x1[order[1:]])
+1788            yy1 = np.maximum(y1[i], y1[order[1:]])
+1789            xx2 = np.minimum(x2[i], x2[order[1:]])
+1790            yy2 = np.minimum(y2[i], y2[order[1:]])
+1791
+1792            # Calculate the area of the intersection area between the high-confidence bbox and the other remaining bboxes
+1793            w = np.maximum(0.0, xx2 - xx1 + 1)
+1794            h = np.maximum(0.0, yy2 - yy1 + 1)
+1795            inter = w * h
+1796
+1797            # Calculate the ratio of the area of the intersection area to the area of both (the bbox with high confidence and other bboxes)
+1798            ovr = inter / (areas[i] + areas[order[1:]] - inter)
+1799
+1800            # Keep the bbox whose ovr is less than thresh and enter the next iteration.
+1801            inds = np.where(ovr <= thresh)[0]
+1802
+1803            # Because the index in ovr does not include order[0], it needs to be moved one bit backward
+1804            order = order[inds + 1]
+1805
+1806        output = []
+1807        for i in keep:
+1808            output.append(dets[i].tolist())
+1809
+1810        return output
+
+ + +

Performs Non-Maximum Suppression (NMS) to filter out overlapping bounding boxes.

+ +

Parameters: + dets (numpy.ndarray): An array of bounding boxes with shape (N, 6), where N is the number of boxes, and each box is represented as [x1, y1, x2, y2, score, class_index]. + thresh (float, optional): The IoU (Intersection over Union) threshold for suppression. Defaults to 0.45.

+ +

Returns: + list: A list of filtered bounding boxes, each represented as [x1, y1, x2, y2, score, class_index].

+
+ + +
+
+ +
+ + def + run(self, img): + + + +
+ +
1812    def run(self, img, ):
+1813        """
+1814        Runs object detection on an image using the YOLO model.
+1815
+1816        Parameters:
+1817            img (numpy.ndarray): The input image.
+1818
+1819        Returns:
+1820            list or bool: A list of dictionaries, where each dictionary represents a detected object and contains the class name, confidence score, and bounding box coordinates. Returns False if no objects are detected.
+1821        """
+1822        pred = []
+1823
+1824        # Original width and height of the input image
+1825        H, W, _ = img.shape
+1826
+1827        # Data preprocessing: resize, 1/255
+1828        data = self.preprocess(img, [self.input_width, self.input_height])
+1829
+1830        # Model inference
+1831        input_name = self.session.get_inputs()[0].name
+1832        feature_map = self.session.run([], {input_name: data})[0][0]
+1833
+1834        # Output feature map transpose: CHW, HWC
+1835        feature_map = feature_map.transpose(1, 2, 0)
+1836        # The width and height of the output feature map
+1837        feature_map_height = feature_map.shape[0]
+1838        feature_map_width = feature_map.shape[1]
+1839
+1840        # Feature map post-processing
+1841        for h in range(feature_map_height):
+1842            for w in range(feature_map_width):
+1843                data = feature_map[h][w]
+1844
+1845                # Resolve detection frame confidence
+1846                obj_score, cls_score = data[0], data[5:].max()
+1847                score = (obj_score ** 0.6) * (cls_score ** 0.4)
+1848
+1849                # Threshold screening
+1850                if score > self.thresh:
+1851                    # Detection frame category
+1852                    cls_index = np.argmax(data[5:])
+1853                    # Detection frame center point offset
+1854                    x_offset, y_offset = self.tanh(data[1]), self.tanh(data[2])
+1855                    # Normalized width and height of the detection frame
+1856                    box_width, box_height = self.sigmoid(data[3]), self.sigmoid(data[4])
+1857                    # The center point after normalization of the detection frame
+1858                    box_cx = (w + x_offset) / feature_map_width
+1859                    box_cy = (h + y_offset) / feature_map_height
+1860
+1861                    # cx,cy,w,h => x1, y1, x2, y2
+1862                    x1, y1 = box_cx - 0.5 * box_width, box_cy - 0.5 * box_height
+1863                    x2, y2 = box_cx + 0.5 * box_width, box_cy + 0.5 * box_height
+1864                    x1, y1, x2, y2 = int(x1 * W), int(y1 * H), int(x2 * W), int(y2 * H)
+1865
+1866                    pred.append([x1, y1, x2, y2, score, cls_index])
+1867        datas = np.array(pred)
+1868        data = []
+1869        if len(datas) > 0:
+1870            boxes = self.nms(datas)
+1871            for b in boxes:
+1872                obj_score, cls_index = b[4], int(b[5])
+1873                x1, y1, x2, y2 = int(b[0]), int(b[1]), int(b[2]), int(b[3])
+1874                s = {'classes': self.classes[cls_index], 'score': '%.2f' % obj_score, 'xywh': [x1, y1, x2 - x1, y2 - y1], }
+1875                data.append(s)
+1876            return data
+1877        else:
+1878            return False
+
+ + +

Runs object detection on an image using the YOLO model.

+ +

Parameters: + img (numpy.ndarray): The input image.

+ +

Returns: + list or bool: A list of dictionaries, where each dictionary represents a detected object and contains the class name, confidence score, and bounding box coordinates. Returns False if no objects are detected.

+
+ + +
+
+
+ +
+ + class + face_detection: + + + +
+ +
1880class face_detection():
+1881    """
+1882    A class for face detection using MediaPipe.
+1883    """
+1884    def __init__(self, min_detection_confidence):
+1885        """
+1886        Initializes the face_detection object.
+1887
+1888        Parameters:
+1889            min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for face detection to be considered successful.
+1890        """
+1891        import mediapipe as mp
+1892        self.model_selection = 0
+1893        self.min_detection_confidence = min_detection_confidence
+1894        self.mp_face_detection = mp.solutions.face_detection
+1895        self.face_detection = self.mp_face_detection.FaceDetection(
+1896            min_detection_confidence=self.min_detection_confidence,
+1897        )
+1898
+1899    def run(self, cv_img):
+1900        """
+1901        Performs face detection on an image.
+1902
+1903        Parameters:
+1904            cv_img (numpy.ndarray): The input image.
+1905
+1906        Returns:
+1907            list: A list of dictionaries, where each dictionary contains information about a detected face, including bounding box coordinates and landmark coordinates.
+1908        """
+1909        image = cv_img
+1910        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+1911        results = self.face_detection.process(cv_img)
+1912        face = []
+1913        if results.detections is not None:
+1914            for detection in results.detections:
+1915                data = self.draw_detection(image, detection)
+1916                face.append(data)
+1917        return face
+1918
+1919    def draw_detection(self, image, detection):
+1920        """
+1921        Extracts face detection information and returns it as a dictionary.
+1922
+1923        Parameters:
+1924            image (numpy.ndarray): The input image.
+1925            detection (mediapipe.framework.formats.detection_pb2.Detection): Face detection result.
+1926
+1927        Returns:
+1928            dict: A dictionary containing face detection information, including label ID, confidence score, bounding box coordinates, and landmark coordinates.
+1929        """
+1930        image_width, image_height = image.shape[1], image.shape[0]
+1931        bbox = detection.location_data.relative_bounding_box
+1932        bbox.xmin = int(bbox.xmin * image_width)
+1933        bbox.ymin = int(bbox.ymin * image_height)
+1934        bbox.width = int(bbox.width * image_width)
+1935        bbox.height = int(bbox.height * image_height)
+1936
+1937        # Position: right eye
+1938        keypoint0 = detection.location_data.relative_keypoints[0]
+1939        keypoint0.x = int(keypoint0.x * image_width)
+1940        keypoint0.y = int(keypoint0.y * image_height)
+1941
+1942        # Position: left eye
+1943        keypoint1 = detection.location_data.relative_keypoints[1]
+1944        keypoint1.x = int(keypoint1.x * image_width)
+1945        keypoint1.y = int(keypoint1.y * image_height)
+1946
+1947        # Position: nose
+1948        keypoint2 = detection.location_data.relative_keypoints[2]
+1949        keypoint2.x = int(keypoint2.x * image_width)
+1950        keypoint2.y = int(keypoint2.y * image_height)
+1951
+1952        # Position: mouth
+1953        keypoint3 = detection.location_data.relative_keypoints[3]
+1954        keypoint3.x = int(keypoint3.x * image_width)
+1955        keypoint3.y = int(keypoint3.y * image_height)
+1956
+1957        # Position: right ear
+1958        keypoint4 = detection.location_data.relative_keypoints[4]
+1959        keypoint4.x = int(keypoint4.x * image_width)
+1960        keypoint4.y = int(keypoint4.y * image_height)
+1961
+1962        # Position: left ear
+1963        keypoint5 = detection.location_data.relative_keypoints[5]
+1964        keypoint5.x = int(keypoint5.x * image_width)
+1965        keypoint5.y = int(keypoint5.y * image_height)
+1966
+1967        data = {'id': detection.label_id[0],
+1968                'score': round(detection.score[0], 3),
+1969                'rect': [int(bbox.xmin), int(bbox.ymin), int(bbox.width), int(bbox.height)],
+1970                'right_eye': (int(keypoint0.x), int(keypoint0.y)),
+1971                'left_eye': (int(keypoint1.x), int(keypoint1.y)),
+1972                'nose': (int(keypoint2.x), int(keypoint2.y)),
+1973                'mouth': (int(keypoint3.x), int(keypoint3.y)),
+1974                'right_ear': (int(keypoint4.x), int(keypoint4.y)),
+1975                'left_ear': (int(keypoint5.x), int(keypoint5.y)),
+1976                }
+1977        return data
+
+ + +

A class for face detection using MediaPipe.

+
+ + +
+ +
+ + face_detection(min_detection_confidence) + + + +
+ +
1884    def __init__(self, min_detection_confidence):
+1885        """
+1886        Initializes the face_detection object.
+1887
+1888        Parameters:
+1889            min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for face detection to be considered successful.
+1890        """
+1891        import mediapipe as mp
+1892        self.model_selection = 0
+1893        self.min_detection_confidence = min_detection_confidence
+1894        self.mp_face_detection = mp.solutions.face_detection
+1895        self.face_detection = self.mp_face_detection.FaceDetection(
+1896            min_detection_confidence=self.min_detection_confidence,
+1897        )
+
+ + +

Initializes the face_detection object.

+ +

Parameters: + min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for face detection to be considered successful.

+
+ + +
+
+
+ model_selection + + +
+ + + + +
+
+
+ min_detection_confidence + + +
+ + + + +
+
+
+ mp_face_detection + + +
+ + + + +
+
+
+ face_detection + + +
+ + + + +
+
+ +
+ + def + run(self, cv_img): + + + +
+ +
1899    def run(self, cv_img):
+1900        """
+1901        Performs face detection on an image.
+1902
+1903        Parameters:
+1904            cv_img (numpy.ndarray): The input image.
+1905
+1906        Returns:
+1907            list: A list of dictionaries, where each dictionary contains information about a detected face, including bounding box coordinates and landmark coordinates.
+1908        """
+1909        image = cv_img
+1910        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+1911        results = self.face_detection.process(cv_img)
+1912        face = []
+1913        if results.detections is not None:
+1914            for detection in results.detections:
+1915                data = self.draw_detection(image, detection)
+1916                face.append(data)
+1917        return face
+
+ + +

Performs face detection on an image.

+ +

Parameters: + cv_img (numpy.ndarray): The input image.

+ +

Returns: + list: A list of dictionaries, where each dictionary contains information about a detected face, including bounding box coordinates and landmark coordinates.

+
+ + +
+
+ +
+ + def + draw_detection(self, image, detection): + + + +
+ +
1919    def draw_detection(self, image, detection):
+1920        """
+1921        Extracts face detection information and returns it as a dictionary.
+1922
+1923        Parameters:
+1924            image (numpy.ndarray): The input image.
+1925            detection (mediapipe.framework.formats.detection_pb2.Detection): Face detection result.
+1926
+1927        Returns:
+1928            dict: A dictionary containing face detection information, including label ID, confidence score, bounding box coordinates, and landmark coordinates.
+1929        """
+1930        image_width, image_height = image.shape[1], image.shape[0]
+1931        bbox = detection.location_data.relative_bounding_box
+1932        bbox.xmin = int(bbox.xmin * image_width)
+1933        bbox.ymin = int(bbox.ymin * image_height)
+1934        bbox.width = int(bbox.width * image_width)
+1935        bbox.height = int(bbox.height * image_height)
+1936
+1937        # Position: right eye
+1938        keypoint0 = detection.location_data.relative_keypoints[0]
+1939        keypoint0.x = int(keypoint0.x * image_width)
+1940        keypoint0.y = int(keypoint0.y * image_height)
+1941
+1942        # Position: left eye
+1943        keypoint1 = detection.location_data.relative_keypoints[1]
+1944        keypoint1.x = int(keypoint1.x * image_width)
+1945        keypoint1.y = int(keypoint1.y * image_height)
+1946
+1947        # Position: nose
+1948        keypoint2 = detection.location_data.relative_keypoints[2]
+1949        keypoint2.x = int(keypoint2.x * image_width)
+1950        keypoint2.y = int(keypoint2.y * image_height)
+1951
+1952        # Position: mouth
+1953        keypoint3 = detection.location_data.relative_keypoints[3]
+1954        keypoint3.x = int(keypoint3.x * image_width)
+1955        keypoint3.y = int(keypoint3.y * image_height)
+1956
+1957        # Position: right ear
+1958        keypoint4 = detection.location_data.relative_keypoints[4]
+1959        keypoint4.x = int(keypoint4.x * image_width)
+1960        keypoint4.y = int(keypoint4.y * image_height)
+1961
+1962        # Position: left ear
+1963        keypoint5 = detection.location_data.relative_keypoints[5]
+1964        keypoint5.x = int(keypoint5.x * image_width)
+1965        keypoint5.y = int(keypoint5.y * image_height)
+1966
+1967        data = {'id': detection.label_id[0],
+1968                'score': round(detection.score[0], 3),
+1969                'rect': [int(bbox.xmin), int(bbox.ymin), int(bbox.width), int(bbox.height)],
+1970                'right_eye': (int(keypoint0.x), int(keypoint0.y)),
+1971                'left_eye': (int(keypoint1.x), int(keypoint1.y)),
+1972                'nose': (int(keypoint2.x), int(keypoint2.y)),
+1973                'mouth': (int(keypoint3.x), int(keypoint3.y)),
+1974                'right_ear': (int(keypoint4.x), int(keypoint4.y)),
+1975                'left_ear': (int(keypoint5.x), int(keypoint5.y)),
+1976                }
+1977        return data
+
+ + +

Extracts face detection information and returns it as a dictionary.

+ +

Parameters: + image (numpy.ndarray): The input image. + detection (mediapipe.framework.formats.detection_pb2.Detection): Face detection result.

+ +

Returns: + dict: A dictionary containing face detection information, including label ID, confidence score, bounding box coordinates, and landmark coordinates.

+
+ + +
+
+
+ + \ No newline at end of file diff --git a/docs/xgolib/index.html b/docs/xgolib/index.html new file mode 100644 index 0000000..6a61a19 --- /dev/null +++ b/docs/xgolib/index.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/xgolib/search.js b/docs/xgolib/search.js new file mode 100644 index 0000000..8b51c48 --- /dev/null +++ b/docs/xgolib/search.js @@ -0,0 +1,46 @@ +window.pdocSearch = (function(){ +/** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o

\n"}, "xgolib.XGOorder": {"fullname": "xgolib.XGOorder", "modulename": "xgolib", "qualname": "XGOorder", "kind": "variable", "doc": "

XGOparam is used to store the parameter limit range of the robot dog.

\n", "default_value": "{'BATTERY': [1, 100], 'PERFORM': [3, 0], 'CALIBRATION': [4, 0], 'UPGRADE': [5, 0], 'SET_ORIGIN': [6, 1], 'FIRMWARE_VERSION': [7], 'GAIT_TYPE': [9, 0], 'BT_NAME': [19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'UNLOAD_MOTOR': [32, 0], 'LOAD_MOTOR': [32, 0], 'VX': [48, 128], 'VY': [49, 128], 'VYAW': [50, 128], 'TRANSLATION': [51, 0, 0, 0], 'ATTITUDE': [54, 0, 0, 0], 'PERIODIC_ROT': [57, 0, 0, 0], 'MarkTime': [60, 0], 'MOVE_MODE': [61, 0], 'ACTION': [62, 0], 'MOVE_TO': [63, 0, 0], 'PERIODIC_TRAN': [128, 0, 0, 0], 'MOTOR_ANGLE': [80, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], 'MOTOR_SPEED': [92, 1], 'MOVE_TO_MID': [95, 1], 'LEG_POS': [64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'IMU': [97, 0], 'ROLL': [98, 0], 'PITCH': [99, 0], 'TEACH_RECORD': [33, 0], 'TEACH_PLAY': [34, 0], 'TEACH_ARM_RECORD': [35, 0], 'TEACH_ARM_PLAY': [36, 0], 'YAW': [100, 0], 'CLAW': [113, 0], 'ARM_MODE': [114, 0], 'ARM_X': [115, 0], 'ARM_Z': [116, 0], 'ARM_SPEED': [117, 0], 'ARM_THETA': [118, 0], 'ARM_R': [119, 0], 'OUTPUT_ANALOG': [144, 0], 'OUTPUT_DIGITAL': [145, 0], 'LED_COLOR': [105, 0, 0, 0]}"}, "xgolib.XGOparam": {"fullname": "xgolib.XGOparam", "modulename": "xgolib", "qualname": "XGOparam", "kind": "variable", "doc": "

\n", "default_value": "{}"}, "xgolib.search": {"fullname": "xgolib.search", "modulename": "xgolib", "qualname": "search", "kind": "function", "doc": "

Searches for a specific data element within a list.

\n\n

Parameters:\n data: The data element to search for.\n list: The list to search within.

\n\n

Returns:\n int: The index (position + 1) of the data element in the list if found, otherwise -1.

\n", "signature": "(data, list):", "funcdef": "def"}, "xgolib.conver2u8": {"fullname": "xgolib.conver2u8", "modulename": "xgolib", "qualname": "conver2u8", "kind": "function", "doc": "

Converts the actual parameters to single byte data from 0 to 255.

\n\n

Parameters:\n data (float): The actual parameter value.\n limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit].\n min_value (int, optional): The minimum value to return if the data is below the limit. Defaults to 0.

\n\n

Returns:\n int: The converted single byte data (0-255).

\n", "signature": "(data, limit, min_value=0):", "funcdef": "def"}, "xgolib.conver2float": {"fullname": "xgolib.conver2float", "modulename": "xgolib", "qualname": "conver2float", "kind": "function", "doc": "

Converts a single byte data (0-255) to its corresponding float value based on the provided limit.

\n\n

Parameters:\n data (int): The single byte data (0-255).\n limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit].

\n\n

Returns:\n float: The corresponding float value.

\n", "signature": "(data, limit):", "funcdef": "def"}, "xgolib.Byte2Float": {"fullname": "xgolib.Byte2Float", "modulename": "xgolib", "qualname": "Byte2Float", "kind": "function", "doc": "

Converts a 4-byte sequence (in little-endian format) to a float.

\n\n

Parameters:\n rawdata (list): A list containing 4 bytes.

\n\n

Returns:\n float: The converted float value.

\n", "signature": "(rawdata):", "funcdef": "def"}, "xgolib.Byte2Short": {"fullname": "xgolib.Byte2Short", "modulename": "xgolib", "qualname": "Byte2Short", "kind": "function", "doc": "

Converts a 2-byte sequence (in big-endian format) to a signed short integer.

\n\n

Parameters:\n rawdata (list): A list containing 2 bytes.

\n\n

Returns:\n int: The converted signed short integer value.

\n", "signature": "(rawdata):", "funcdef": "def"}, "xgolib.changePara": {"fullname": "xgolib.changePara", "modulename": "xgolib", "qualname": "changePara", "kind": "function", "doc": "

Changes the XGOparam dictionary based on the robot version.

\n\n

Parameters:\n version (str): The robot version ('xgomini', 'xgolite', or 'xgorider').

\n", "signature": "(version):", "funcdef": "def"}, "xgolib.XGO": {"fullname": "xgolib.XGO", "modulename": "xgolib", "qualname": "XGO", "kind": "class", "doc": "

When instantiating XGO, you need to specify the serial communication interface between the upper computer and the machine dog.

\n"}, "xgolib.XGO.__init__": {"fullname": "xgolib.XGO.__init__", "modulename": "xgolib", "qualname": "XGO.__init__", "kind": "function", "doc": "

Initializes the XGO robot object.

\n\n

Parameters:\n port (str): The serial port to use for communication (e.g., '/dev/ttyACM0', 'COM3').\n baud (int, optional): The baud rate for serial communication. Defaults to 115200.\n version (string, optional): Specifies the version of the XGO robot. Accepts 'xgomini', 'xgolite', or 'xgorider'. Defaults to 'xgomini'.\n verbose (bool, optional): Enables verbose output for debugging. Defaults to False.

\n", "signature": "(port, baud=115200, version='xgomini', verbose=False)"}, "xgolib.XGO.verbose": {"fullname": "xgolib.XGO.verbose", "modulename": "xgolib", "qualname": "XGO.verbose", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.ser": {"fullname": "xgolib.XGO.ser", "modulename": "xgolib", "qualname": "XGO.ser", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.port": {"fullname": "xgolib.XGO.port", "modulename": "xgolib", "qualname": "XGO.port", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.rx_FLAG": {"fullname": "xgolib.XGO.rx_FLAG", "modulename": "xgolib", "qualname": "XGO.rx_FLAG", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.rx_COUNT": {"fullname": "xgolib.XGO.rx_COUNT", "modulename": "xgolib", "qualname": "XGO.rx_COUNT", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.rx_ADDR": {"fullname": "xgolib.XGO.rx_ADDR", "modulename": "xgolib", "qualname": "XGO.rx_ADDR", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.rx_LEN": {"fullname": "xgolib.XGO.rx_LEN", "modulename": "xgolib", "qualname": "XGO.rx_LEN", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.rx_data": {"fullname": "xgolib.XGO.rx_data", "modulename": "xgolib", "qualname": "XGO.rx_data", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.version": {"fullname": "xgolib.XGO.version", "modulename": "xgolib", "qualname": "XGO.version", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.mintime": {"fullname": "xgolib.XGO.mintime", "modulename": "xgolib", "qualname": "XGO.mintime", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.init_yaw": {"fullname": "xgolib.XGO.init_yaw", "modulename": "xgolib", "qualname": "XGO.init_yaw", "kind": "variable", "doc": "

\n"}, "xgolib.XGO.stop": {"fullname": "xgolib.XGO.stop", "modulename": "xgolib", "qualname": "XGO.stop", "kind": "function", "doc": "

Stops all movement of the XGO robot.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.move": {"fullname": "xgolib.XGO.move", "modulename": "xgolib", "qualname": "XGO.move", "kind": "function", "doc": "

Moves the XGO robot in a specified direction.

\n\n

Parameters:\n direction (str): The direction of movement ('x', 'X', 'y', or 'Y').\n step (float): The step size or speed of the movement.

\n\n

Raises:\n ValueError: If an invalid direction is provided.

\n", "signature": "(self, direction, step):", "funcdef": "def"}, "xgolib.XGO.move_x": {"fullname": "xgolib.XGO.move_x", "modulename": "xgolib", "qualname": "XGO.move_x", "kind": "function", "doc": "

Moves the XGO robot along the x-axis.

\n\n

Parameters:\n step (float): The step size or speed of the movement along the x-axis.\n runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.

\n", "signature": "(self, step, runtime=0):", "funcdef": "def"}, "xgolib.XGO.move_y": {"fullname": "xgolib.XGO.move_y", "modulename": "xgolib", "qualname": "XGO.move_y", "kind": "function", "doc": "

Moves the XGO robot along the y-axis.

\n\n

Parameters:\n step (float): The step size or speed of the movement along the y-axis.\n runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.

\n", "signature": "(self, step, runtime=0):", "funcdef": "def"}, "xgolib.XGO.turn": {"fullname": "xgolib.XGO.turn", "modulename": "xgolib", "qualname": "XGO.turn", "kind": "function", "doc": "

Rotates the XGO robot.

\n\n

Parameters:\n step (float): The step size or speed of the rotation.\n runtime (float, optional): The duration of the rotation in seconds. If provided, the robot will stop rotating after this duration. Defaults to 0.

\n", "signature": "(self, step, runtime=0):", "funcdef": "def"}, "xgolib.XGO.forward": {"fullname": "xgolib.XGO.forward", "modulename": "xgolib", "qualname": "XGO.forward", "kind": "function", "doc": "

Moves the XGO robot forward.

\n\n

Parameters:\n step (float): The step size or speed of the forward movement.

\n", "signature": "(self, step):", "funcdef": "def"}, "xgolib.XGO.back": {"fullname": "xgolib.XGO.back", "modulename": "xgolib", "qualname": "XGO.back", "kind": "function", "doc": "

Moves the XGO robot backward.

\n\n

Parameters:\n step (float): The step size or speed of the backward movement.

\n", "signature": "(self, step):", "funcdef": "def"}, "xgolib.XGO.left": {"fullname": "xgolib.XGO.left", "modulename": "xgolib", "qualname": "XGO.left", "kind": "function", "doc": "

Moves the XGO robot to the left.

\n\n

Parameters:\n step (float): The step size or speed of the leftward movement.

\n", "signature": "(self, step):", "funcdef": "def"}, "xgolib.XGO.right": {"fullname": "xgolib.XGO.right", "modulename": "xgolib", "qualname": "XGO.right", "kind": "function", "doc": "

Moves the XGO robot to the right.

\n\n

Parameters:\n step (float): The step size or speed of the rightward movement.

\n", "signature": "(self, step):", "funcdef": "def"}, "xgolib.XGO.turnleft": {"fullname": "xgolib.XGO.turnleft", "modulename": "xgolib", "qualname": "XGO.turnleft", "kind": "function", "doc": "

Turns the XGO robot to the left.

\n\n

Parameters:\n step (float): The step size or speed of the left turn.

\n", "signature": "(self, step):", "funcdef": "def"}, "xgolib.XGO.turnright": {"fullname": "xgolib.XGO.turnright", "modulename": "xgolib", "qualname": "XGO.turnright", "kind": "function", "doc": "

Turns the XGO robot to the right.

\n\n

Parameters:\n step (float): The step size or speed of the right turn.

\n", "signature": "(self, step):", "funcdef": "def"}, "xgolib.XGO.move_by": {"fullname": "xgolib.XGO.move_by", "modulename": "xgolib", "qualname": "XGO.move_by", "kind": "function", "doc": "

Moves the XGO robot a specific distance using a combination of x and y velocities.

\n\n

Parameters:\n distance (float): The distance to move.\n vx (float): The velocity along the x-axis.\n vy (float): The velocity along the y-axis.\n k (float): A scaling factor for the movement duration.\n mintime (float): The minimum duration of the movement.

\n", "signature": "(self, distance, vx, vy, k, mintime):", "funcdef": "def"}, "xgolib.XGO.move_x_by": {"fullname": "xgolib.XGO.move_x_by", "modulename": "xgolib", "qualname": "XGO.move_x_by", "kind": "function", "doc": "

Moves the XGO robot a specific distance along the x-axis.

\n\n

Parameters:\n distance (float): The distance to move along the x-axis.\n vx (float, optional): The velocity along the x-axis. Defaults to 18.\n k (float, optional): A scaling factor for the movement duration. Defaults to 0.035.\n mintime (float, optional): The minimum duration of the movement. Defaults to 0.55.

\n", "signature": "(self, distance, vx=18, k=0.035, mintime=0.55):", "funcdef": "def"}, "xgolib.XGO.move_y_by": {"fullname": "xgolib.XGO.move_y_by", "modulename": "xgolib", "qualname": "XGO.move_y_by", "kind": "function", "doc": "

Moves the XGO robot a specific distance along the y-axis.

\n\n

Parameters:\n distance (float): The distance to move along the y-axis.\n vy (float, optional): The velocity along the y-axis. Defaults to 18.\n k (float, optional): A scaling factor for the movement duration. Defaults to 0.0373.\n mintime (float, optional): The minimum duration of the movement. Defaults to 0.5.

\n", "signature": "(self, distance, vy=18, k=0.0373, mintime=0.5):", "funcdef": "def"}, "xgolib.XGO.turn_by": {"fullname": "xgolib.XGO.turn_by", "modulename": "xgolib", "qualname": "XGO.turn_by", "kind": "function", "doc": "

Turns the XGO robot by a specific angle.

\n\n

Parameters:\n theta (float): The angle to turn (in degrees).\n mintime (float): The minimum duration of the turn.\n vyaw (float, optional): The angular velocity. Defaults to 16.\n k (float, optional): A scaling factor for the turn duration. Defaults to 0.08.

\n", "signature": "(self, theta, mintime, vyaw=16, k=0.08):", "funcdef": "def"}, "xgolib.XGO.turn_to": {"fullname": "xgolib.XGO.turn_to", "modulename": "xgolib", "qualname": "XGO.turn_to", "kind": "function", "doc": "

Turns the XGO robot to a specific absolute angle.

\n\n

Parameters:\n theta (float): The target angle (in degrees).\n vyaw (float, optional): The angular velocity. Defaults to 60.\n emax (float, optional): The maximum error tolerance for the angle. Defaults to 10.

\n", "signature": "(self, theta, vyaw=60, emax=10):", "funcdef": "def"}, "xgolib.XGO.translation": {"fullname": "xgolib.XGO.translation", "modulename": "xgolib", "qualname": "XGO.translation", "kind": "function", "doc": "

Translates the XGO robot's body.

\n\n

Parameters:\n direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these).\n data (float or list): The translation amount(s).

\n\n

Raises:\n ValueError: If the length of direction and data don't match when using a list.

\n", "signature": "(self, direction, data):", "funcdef": "def"}, "xgolib.XGO.attitude": {"fullname": "xgolib.XGO.attitude", "modulename": "xgolib", "qualname": "XGO.attitude", "kind": "function", "doc": "

Adjusts the XGO robot's body attitude.

\n\n

Parameters:\n direction (str or list): The axis/axes of attitude adjustment ('r', 'p', 'y', or a list of these).\n data (float or list): The attitude adjustment amount(s).

\n\n

Raises:\n ValueError: If the length of direction and data don't match when using a list.

\n", "signature": "(self, direction, data):", "funcdef": "def"}, "xgolib.XGO.action": {"fullname": "xgolib.XGO.action", "modulename": "xgolib", "qualname": "XGO.action", "kind": "function", "doc": "

Makes the XGO robot perform a predefined action.

\n\n

Parameters:\n action_id (int): The ID of the action to perform (1-255).\n wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.

\n\n

Raises:\n ValueError: If an invalid action ID is provided.

\n", "signature": "(self, action_id, wait=False):", "funcdef": "def"}, "xgolib.XGO.reset": {"fullname": "xgolib.XGO.reset", "modulename": "xgolib", "qualname": "XGO.reset", "kind": "function", "doc": "

Resets the XGO robot to its initial state.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.leg": {"fullname": "xgolib.XGO.leg", "modulename": "xgolib", "qualname": "XGO.leg", "kind": "function", "doc": "

Controls the three-axis movement of a single leg of the XGO robot.

\n\n

Parameters:\n leg_id (int): The ID of the leg to control (1, 2, 3, or 4).\n data (list): A list of three float values representing the x, y, and z coordinates of the leg's end effector.

\n\n

Raises:\n ValueError: If an invalid leg ID or data length is provided.

\n", "signature": "(self, leg_id, data):", "funcdef": "def"}, "xgolib.XGO.motor": {"fullname": "xgolib.XGO.motor", "modulename": "xgolib", "qualname": "XGO.motor", "kind": "function", "doc": "

Controls one or more motors of the XGO robot.

\n\n

Parameters:\n motor_id (int or list): The ID(s) of the motor(s) to control (11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, or 53).\n data (float or list): The target angle(s) for the motor(s).

\n\n

Raises:\n ValueError: If an invalid motor ID or data length is provided.

\n", "signature": "(self, motor_id, data):", "funcdef": "def"}, "xgolib.XGO.unload_motor": {"fullname": "xgolib.XGO.unload_motor", "modulename": "xgolib", "qualname": "XGO.unload_motor", "kind": "function", "doc": "

Unloads the motors of a specified leg.

\n\n

Parameters:\n leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).

\n\n

Raises:\n ValueError: If an invalid leg ID is provided.

\n", "signature": "(self, leg_id):", "funcdef": "def"}, "xgolib.XGO.unload_allmotor": {"fullname": "xgolib.XGO.unload_allmotor", "modulename": "xgolib", "qualname": "XGO.unload_allmotor", "kind": "function", "doc": "

Unloads all motors of the XGO robot.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.load_motor": {"fullname": "xgolib.XGO.load_motor", "modulename": "xgolib", "qualname": "XGO.load_motor", "kind": "function", "doc": "

Loads the motors of a specified leg.

\n\n

Parameters:\n leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).

\n\n

Raises:\n ValueError: If an invalid leg ID is provided.

\n", "signature": "(self, leg_id):", "funcdef": "def"}, "xgolib.XGO.load_allmotor": {"fullname": "xgolib.XGO.load_allmotor", "modulename": "xgolib", "qualname": "XGO.load_allmotor", "kind": "function", "doc": "

Loads all motors of the XGO robot.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.periodic_rot": {"fullname": "xgolib.XGO.periodic_rot", "modulename": "xgolib", "qualname": "XGO.periodic_rot", "kind": "function", "doc": "

Initiates periodic rotation of the XGO robot's body.

\n\n

Parameters:\n direction (str or list): The axis/axes of rotation ('r', 'p', 'y', or a list of these).\n period (float or list): The period(s) of rotation.

\n\n

Raises:\n ValueError: If the length of direction and period don't match when using a list.

\n", "signature": "(self, direction, period):", "funcdef": "def"}, "xgolib.XGO.periodic_tran": {"fullname": "xgolib.XGO.periodic_tran", "modulename": "xgolib", "qualname": "XGO.periodic_tran", "kind": "function", "doc": "

Initiates periodic translation of the XGO robot's body.

\n\n

Parameters:\n direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these).\n period (float or list): The period(s) of translation.

\n\n

Raises:\n ValueError: If the length of direction and period don't match when using a list.

\n", "signature": "(self, direction, period):", "funcdef": "def"}, "xgolib.XGO.mark_time": {"fullname": "xgolib.XGO.mark_time", "modulename": "xgolib", "qualname": "XGO.mark_time", "kind": "function", "doc": "

Makes the XGO robot mark time (\u539f\u5730\u8e0f\u6b65).

\n\n

Parameters:\n data (float): The height of the mark time movement. Set to 0 to stop marking time.

\n", "signature": "(self, data):", "funcdef": "def"}, "xgolib.XGO.pace": {"fullname": "xgolib.XGO.pace", "modulename": "xgolib", "qualname": "XGO.pace", "kind": "function", "doc": "

Changes the step frequency of the XGO robot.

\n\n

Parameters:\n mode (str): The desired pace ('normal', 'slow', or 'high').

\n\n

Raises:\n ValueError: If an invalid pace mode is provided.

\n", "signature": "(self, mode):", "funcdef": "def"}, "xgolib.XGO.gait_type": {"fullname": "xgolib.XGO.gait_type", "modulename": "xgolib", "qualname": "XGO.gait_type", "kind": "function", "doc": "

Sets the gait type of the XGO robot.

\n\n

Parameters:\n mode (str): The desired gait type ('trot', 'walk', 'high_walk', or 'slow_trot').

\n", "signature": "(self, mode):", "funcdef": "def"}, "xgolib.XGO.imu": {"fullname": "xgolib.XGO.imu", "modulename": "xgolib", "qualname": "XGO.imu", "kind": "function", "doc": "

Turns on/off the self-stabilization of the XGO robot.

\n\n

Parameters:\n mode (int): 1 to turn on self-stabilization, 0 to turn it off.

\n\n

Raises:\n ValueError: If an invalid mode value is provided.

\n", "signature": "(self, mode):", "funcdef": "def"}, "xgolib.XGO.perform": {"fullname": "xgolib.XGO.perform", "modulename": "xgolib", "qualname": "XGO.perform", "kind": "function", "doc": "

Turns on/off the XGO robot's performance mode (\u5faa\u73af\u505a\u52a8\u4f5c\u72b6\u6001).

\n\n

Parameters:\n mode (int): 1 to turn on performance mode, 0 to turn it off.

\n\n

Raises:\n ValueError: If an invalid mode value is provided.

\n", "signature": "(self, mode):", "funcdef": "def"}, "xgolib.XGO.motor_speed": {"fullname": "xgolib.XGO.motor_speed", "modulename": "xgolib", "qualname": "XGO.motor_speed", "kind": "function", "doc": "

Adjusts the rotation speed of the motors.

\n\n

Parameters:\n speed (int): The desired motor speed (1-255).

\n\n

Raises:\n ValueError: If an invalid speed value is provided.

\n", "signature": "(self, speed):", "funcdef": "def"}, "xgolib.XGO.bt_rename": {"fullname": "xgolib.XGO.bt_rename", "modulename": "xgolib", "qualname": "XGO.bt_rename", "kind": "function", "doc": "

Renames the Bluetooth name of the XGO robot.

\n\n

Parameters:\n name (str): The new Bluetooth name (maximum 10 characters, ASCII only).

\n\n

Raises:\n TypeError: If the input is not a string.\n ValueError: If the name is longer than 10 characters or contains non-ASCII characters.

\n", "signature": "(self, name):", "funcdef": "def"}, "xgolib.XGO.read_motor": {"fullname": "xgolib.XGO.read_motor", "modulename": "xgolib", "qualname": "XGO.read_motor", "kind": "function", "doc": "

Reads the angles of all 15 motors.

\n\n

Returns:\n list: A list of 15 float values representing the angles of the motors.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.read_battery": {"fullname": "xgolib.XGO.read_battery", "modulename": "xgolib", "qualname": "XGO.read_battery", "kind": "function", "doc": "

Reads the battery level of the XGO robot.

\n\n

Returns:\n int: The battery level (0-100).

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.read_firmware": {"fullname": "xgolib.XGO.read_firmware", "modulename": "xgolib", "qualname": "XGO.read_firmware", "kind": "function", "doc": "

Reads the firmware version of the XGO robot.

\n\n

Returns:\n str: The firmware version string.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.read_roll": {"fullname": "xgolib.XGO.read_roll", "modulename": "xgolib", "qualname": "XGO.read_roll", "kind": "function", "doc": "

Reads the roll angle of the XGO robot.

\n\n

Returns:\n float: The roll angle in degrees.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.read_pitch": {"fullname": "xgolib.XGO.read_pitch", "modulename": "xgolib", "qualname": "XGO.read_pitch", "kind": "function", "doc": "

Reads the pitch angle of the XGO robot.

\n\n

Returns:\n float: The pitch angle in degrees.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.read_yaw": {"fullname": "xgolib.XGO.read_yaw", "modulename": "xgolib", "qualname": "XGO.read_yaw", "kind": "function", "doc": "

Reads the yaw angle of the XGO robot.

\n\n

Returns:\n float: The yaw angle in degrees.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.set_move_mintime": {"fullname": "xgolib.XGO.set_move_mintime", "modulename": "xgolib", "qualname": "XGO.set_move_mintime", "kind": "function", "doc": "

Sets the minimum movement time for the XGO robot.

\n\n

Parameters:\n mintime (float): The minimum movement time in seconds.

\n", "signature": "(self, mintime):", "funcdef": "def"}, "xgolib.XGO.upgrade": {"fullname": "xgolib.XGO.upgrade", "modulename": "xgolib", "qualname": "XGO.upgrade", "kind": "function", "doc": "

Upgrades the firmware of the XGO robot.

\n\n

Parameters:\n filename (str): The path to the firmware file.

\n", "signature": "(self, filename):", "funcdef": "def"}, "xgolib.XGO.read_lib_version": {"fullname": "xgolib.XGO.read_lib_version", "modulename": "xgolib", "qualname": "XGO.read_lib_version", "kind": "function", "doc": "

Returns the version of the XGO Python library.

\n\n

Returns:\n str: The library version string.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.calibration": {"fullname": "xgolib.XGO.calibration", "modulename": "xgolib", "qualname": "XGO.calibration", "kind": "function", "doc": "

Initiates or terminates the calibration process of the XGO robot.

\n\n

Parameters:\n state (str): 'start' to initiate calibration, 'end' to terminate.

\n\n

Raises:\n ValueError: If an invalid state is provided.

\n", "signature": "(self, state):", "funcdef": "def"}, "xgolib.XGO.arm": {"fullname": "xgolib.XGO.arm", "modulename": "xgolib", "qualname": "XGO.arm", "kind": "function", "doc": "

Controls the movement of the XGO robot's arm in the x and z directions.

\n\n

Parameters:\n arm_x (float): The x-coordinate of the arm's end effector.\n arm_z (float): The z-coordinate of the arm's end effector.

\n\n

Raises:\n ValueError: If invalid arm_x or arm_z values are provided.

\n", "signature": "(self, arm_x, arm_z):", "funcdef": "def"}, "xgolib.XGO.arm_polar": {"fullname": "xgolib.XGO.arm_polar", "modulename": "xgolib", "qualname": "XGO.arm_polar", "kind": "function", "doc": "

Controls the movement of the XGO robot's arm using polar coordinates.

\n\n

Parameters:\n arm_theta (float): The angle (theta) of the arm.\n arm_r (float): The radial distance (r) of the arm's end effector.

\n\n

Raises:\n ValueError: If invalid arm_theta or arm_r values are provided.

\n", "signature": "(self, arm_theta, arm_r):", "funcdef": "def"}, "xgolib.XGO.arm_mode": {"fullname": "xgolib.XGO.arm_mode", "modulename": "xgolib", "qualname": "XGO.arm_mode", "kind": "function", "doc": "

Sets the mode of the XGO robot's arm.

\n\n

Parameters:\n mode (int): The arm mode (0x00 or 0x01).

\n\n

Raises:\n ValueError: If an invalid mode value is provided.

\n", "signature": "(self, mode):", "funcdef": "def"}, "xgolib.XGO.claw": {"fullname": "xgolib.XGO.claw", "modulename": "xgolib", "qualname": "XGO.claw", "kind": "function", "doc": "

Controls the position of the XGO robot's claw.

\n\n

Parameters:\n pos (float): The desired claw position (0-255).

\n\n

Raises:\n ValueError: If an invalid claw position value is provided.

\n", "signature": "(self, pos):", "funcdef": "def"}, "xgolib.XGO.btRename": {"fullname": "xgolib.XGO.btRename", "modulename": "xgolib", "qualname": "XGO.btRename", "kind": "function", "doc": "

Renames the Bluetooth name of the XGO robot (alternative implementation).

\n\n

Parameters:\n name (str): The new Bluetooth name (maximum 20 characters, alphanumeric only).

\n\n

Raises:\n TypeError: If the input is not a string.\n ValueError: If the name is longer than 20 characters or contains non-alphanumeric characters.

\n", "signature": "(self, name):", "funcdef": "def"}, "xgolib.XGO.moveToMid": {"fullname": "xgolib.XGO.moveToMid", "modulename": "xgolib", "qualname": "XGO.moveToMid", "kind": "function", "doc": "

Moves the XGO robot's legs to their middle position.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.teach": {"fullname": "xgolib.XGO.teach", "modulename": "xgolib", "qualname": "XGO.teach", "kind": "function", "doc": "

Records or plays back a taught position for the XGO robot's legs.

\n\n

Parameters:\n mode (str): 'record' to record a position, 'play' to play back a recorded position.\n pos_id (int): The ID of the position to record or play back.

\n", "signature": "(self, mode, pos_id):", "funcdef": "def"}, "xgolib.XGO.teach_arm": {"fullname": "xgolib.XGO.teach_arm", "modulename": "xgolib", "qualname": "XGO.teach_arm", "kind": "function", "doc": "

Records or plays back a taught position for the XGO robot's arm.

\n\n

Parameters:\n mode (str): 'record' to record a position, 'play' to play back a recorded position.\n pos_id (int): The ID of the position to record or play back.

\n", "signature": "(self, mode, pos_id):", "funcdef": "def"}, "xgolib.XGO.arm_speed": {"fullname": "xgolib.XGO.arm_speed", "modulename": "xgolib", "qualname": "XGO.arm_speed", "kind": "function", "doc": "

Adjusts the rotation speed of the arm.

\n\n

Parameters:\n speed (int): The desired arm speed (1-255).

\n\n

Raises:\n ValueError: If an invalid speed value is provided.

\n", "signature": "(self, speed):", "funcdef": "def"}, "xgolib.XGO.read_imu": {"fullname": "xgolib.XGO.read_imu", "modulename": "xgolib", "qualname": "XGO.read_imu", "kind": "function", "doc": "

Reads IMU (Inertial Measurement Unit) data from the XGO robot.

\n\n

Returns:\n list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.read_imu_int16": {"fullname": "xgolib.XGO.read_imu_int16", "modulename": "xgolib", "qualname": "XGO.read_imu_int16", "kind": "function", "doc": "

Reads IMU data as signed 16-bit integers for a specific direction.

\n\n

Parameters:\n direction (str): The direction to read ('roll', 'pitch', or 'yaw').

\n\n

Returns:\n int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.

\n", "signature": "(self, direction):", "funcdef": "def"}, "xgolib.XGO.unpack_imu": {"fullname": "xgolib.XGO.unpack_imu", "modulename": "xgolib", "qualname": "XGO.unpack_imu", "kind": "function", "doc": "

Unpacks raw IMU data into meaningful values.

\n\n

Returns:\n list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.set_origin": {"fullname": "xgolib.XGO.set_origin", "modulename": "xgolib", "qualname": "XGO.set_origin", "kind": "function", "doc": "

Sets the current position of the XGO robot as the origin.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.move_to": {"fullname": "xgolib.XGO.move_to", "modulename": "xgolib", "qualname": "XGO.move_to", "kind": "function", "doc": "

Moves the robot to a specified position.

\n\n

Parameters:\n data (int): The target position value.

\n", "signature": "(self, data):", "funcdef": "def"}, "xgolib.XGO.output_analog": {"fullname": "xgolib.XGO.output_analog", "modulename": "xgolib", "qualname": "XGO.output_analog", "kind": "function", "doc": "

Sets the analog output value.

\n\n

Parameters:\n data (int): The analog output value.

\n", "signature": "(self, data):", "funcdef": "def"}, "xgolib.XGO.output_digital": {"fullname": "xgolib.XGO.output_digital", "modulename": "xgolib", "qualname": "XGO.output_digital", "kind": "function", "doc": "

Sets the digital output value.

\n\n

Parameters:\n data (int): The digital output value.

\n", "signature": "(self, data):", "funcdef": "def"}, "xgolib.XGO.rider_move_x": {"fullname": "xgolib.XGO.rider_move_x", "modulename": "xgolib", "qualname": "XGO.rider_move_x", "kind": "function", "doc": "

Moves the XGO Rider along the x-axis.

\n\n

Parameters:\n speed (float): The speed of movement along the x-axis.\n runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.

\n", "signature": "(self, speed, runtime=0):", "funcdef": "def"}, "xgolib.XGO.rider_turn": {"fullname": "xgolib.XGO.rider_turn", "modulename": "xgolib", "qualname": "XGO.rider_turn", "kind": "function", "doc": "

Turns the XGO Rider.

\n\n

Parameters:\n speed (float): The speed of the turn.\n runtime (float, optional): The duration of the turn in seconds. If provided, the robot will stop turning after this duration. Defaults to 0.

\n", "signature": "(self, speed, runtime=0):", "funcdef": "def"}, "xgolib.XGO.rider_reset_odom": {"fullname": "xgolib.XGO.rider_reset_odom", "modulename": "xgolib", "qualname": "XGO.rider_reset_odom", "kind": "function", "doc": "

Resets the odometry of the XGO Rider.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.rider_action": {"fullname": "xgolib.XGO.rider_action", "modulename": "xgolib", "qualname": "XGO.rider_action", "kind": "function", "doc": "

Makes the XGO Rider perform a predefined action.

\n\n

Parameters:\n action_id (int): The ID of the action to perform (1-255).\n wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.

\n\n

Raises:\n ValueError: If an invalid action ID is provided.

\n", "signature": "(self, action_id, wait=False):", "funcdef": "def"}, "xgolib.XGO.rider_balance_roll": {"fullname": "xgolib.XGO.rider_balance_roll", "modulename": "xgolib", "qualname": "XGO.rider_balance_roll", "kind": "function", "doc": "

Turns on/off the roll balance of the XGO Rider.

\n\n

Parameters:\n mode (int): 1 to turn on roll balance, 0 to turn it off.

\n\n

Raises:\n ValueError: If an invalid mode value is provided.

\n", "signature": "(self, mode):", "funcdef": "def"}, "xgolib.XGO.rider_perform": {"fullname": "xgolib.XGO.rider_perform", "modulename": "xgolib", "qualname": "XGO.rider_perform", "kind": "function", "doc": "

Turns on/off the XGO Rider's performance mode.

\n\n

Parameters:\n mode (int): 1 to turn on performance mode, 0 to turn it off.

\n\n

Raises:\n ValueError: If an invalid mode value is provided.

\n", "signature": "(self, mode):", "funcdef": "def"}, "xgolib.XGO.rider_calibration": {"fullname": "xgolib.XGO.rider_calibration", "modulename": "xgolib", "qualname": "XGO.rider_calibration", "kind": "function", "doc": "

Initiates or terminates the calibration process of the XGO Rider.

\n\n

Parameters:\n state (str): 'start' to initiate calibration, 'end' to terminate.

\n\n

Raises:\n ValueError: If an invalid state is provided.

\n", "signature": "(self, state):", "funcdef": "def"}, "xgolib.XGO.rider_height": {"fullname": "xgolib.XGO.rider_height", "modulename": "xgolib", "qualname": "XGO.rider_height", "kind": "function", "doc": "

Adjusts the height of the XGO Rider.

\n\n

Parameters:\n data (float): The desired height.

\n", "signature": "(self, data):", "funcdef": "def"}, "xgolib.XGO.rider_roll": {"fullname": "xgolib.XGO.rider_roll", "modulename": "xgolib", "qualname": "XGO.rider_roll", "kind": "function", "doc": "

Adjusts the roll angle of the XGO Rider.

\n\n

Parameters:\n data (float): The desired roll angle.

\n", "signature": "(self, data):", "funcdef": "def"}, "xgolib.XGO.rider_periodic_roll": {"fullname": "xgolib.XGO.rider_periodic_roll", "modulename": "xgolib", "qualname": "XGO.rider_periodic_roll", "kind": "function", "doc": "

Initiates periodic roll movement of the XGO Rider.

\n\n

Parameters:\n period (float): The period of the roll movement.

\n", "signature": "(self, period):", "funcdef": "def"}, "xgolib.XGO.rider_periodic_z": {"fullname": "xgolib.XGO.rider_periodic_z", "modulename": "xgolib", "qualname": "XGO.rider_periodic_z", "kind": "function", "doc": "

Initiates periodic vertical movement of the XGO Rider.

\n\n

Parameters:\n period (float): The period of the vertical movement.

\n", "signature": "(self, period):", "funcdef": "def"}, "xgolib.XGO.rider_read_battery": {"fullname": "xgolib.XGO.rider_read_battery", "modulename": "xgolib", "qualname": "XGO.rider_read_battery", "kind": "function", "doc": "

Reads the battery level of the XGO Rider.

\n\n

Returns:\n int: The battery level (0-100).

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.rider_read_firmware": {"fullname": "xgolib.XGO.rider_read_firmware", "modulename": "xgolib", "qualname": "XGO.rider_read_firmware", "kind": "function", "doc": "

Reads the firmware version of the XGO Rider.

\n\n

Returns:\n str: The firmware version string.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.rider_read_roll": {"fullname": "xgolib.XGO.rider_read_roll", "modulename": "xgolib", "qualname": "XGO.rider_read_roll", "kind": "function", "doc": "

Reads the roll angle of the XGO Rider.

\n\n

Returns:\n float: The roll angle in degrees.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.rider_read_pitch": {"fullname": "xgolib.XGO.rider_read_pitch", "modulename": "xgolib", "qualname": "XGO.rider_read_pitch", "kind": "function", "doc": "

Reads the pitch angle of the XGO Rider.

\n\n

Returns:\n float: The pitch angle in degrees.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.rider_read_yaw": {"fullname": "xgolib.XGO.rider_read_yaw", "modulename": "xgolib", "qualname": "XGO.rider_read_yaw", "kind": "function", "doc": "

Reads the yaw angle of the XGO Rider.

\n\n

Returns:\n float: The yaw angle in degrees.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.rider_read_imu_int16": {"fullname": "xgolib.XGO.rider_read_imu_int16", "modulename": "xgolib", "qualname": "XGO.rider_read_imu_int16", "kind": "function", "doc": "

Reads IMU data as signed 16-bit integers for a specific direction on the XGO Rider.

\n\n

Parameters:\n direction (str): The direction to read ('roll', 'pitch', or 'yaw').

\n\n

Returns:\n int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.

\n", "signature": "(self, direction):", "funcdef": "def"}, "xgolib.XGO.rider_reset": {"fullname": "xgolib.XGO.rider_reset", "modulename": "xgolib", "qualname": "XGO.rider_reset", "kind": "function", "doc": "

Resets the XGO Rider.

\n", "signature": "(self):", "funcdef": "def"}, "xgolib.XGO.rider_upgrade": {"fullname": "xgolib.XGO.rider_upgrade", "modulename": "xgolib", "qualname": "XGO.rider_upgrade", "kind": "function", "doc": "

Upgrades the firmware of the XGO Rider.

\n\n

Parameters:\n filename (str): The path to the firmware file.

\n", "signature": "(self, filename):", "funcdef": "def"}, "xgolib.XGO.rider_led": {"fullname": "xgolib.XGO.rider_led", "modulename": "xgolib", "qualname": "XGO.rider_led", "kind": "function", "doc": "

Sets the color of an LED on the XGO Rider.

\n\n

Parameters:\n index (int): The index of the LED (likely 1-4 depending on hardware).\n color (list): A list of three integers representing the RGB color values (0-255 each).

\n", "signature": "(self, index, color):", "funcdef": "def"}}, "docInfo": {"xgolib": {"qualname": 0, "fullname": 1, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGOorder": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 333, "signature": 0, "bases": 0, "doc": 16}, "xgolib.XGOparam": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 1, "signature": 0, "bases": 0, "doc": 3}, "xgolib.search": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 50}, "xgolib.conver2u8": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 27, "bases": 0, "doc": 99}, "xgolib.conver2float": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 83}, "xgolib.Byte2Float": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 36}, "xgolib.Byte2Short": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 40}, "xgolib.changePara": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 26}, "xgolib.XGO": {"qualname": 1, "fullname": 2, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 22}, "xgolib.XGO.__init__": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 43, "bases": 0, "doc": 70}, "xgolib.XGO.verbose": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.ser": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.port": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.rx_FLAG": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.rx_COUNT": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.rx_ADDR": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.rx_LEN": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.rx_data": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.version": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.mintime": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.init_yaw": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 0, "bases": 0, "doc": 3}, "xgolib.XGO.stop": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 10}, "xgolib.XGO.move": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 49}, "xgolib.XGO.move_x": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 26, "bases": 0, "doc": 54}, "xgolib.XGO.move_y": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 26, "bases": 0, "doc": 54}, "xgolib.XGO.turn": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 26, "bases": 0, "doc": 46}, "xgolib.XGO.forward": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 24}, "xgolib.XGO.back": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 24}, "xgolib.XGO.left": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 26}, "xgolib.XGO.right": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 26}, "xgolib.XGO.turnleft": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 26}, "xgolib.XGO.turnright": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 26}, "xgolib.XGO.move_by": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 36, "bases": 0, "doc": 66}, "xgolib.XGO.move_x_by": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 48, "bases": 0, "doc": 71}, "xgolib.XGO.move_y_by": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 48, "bases": 0, "doc": 71}, "xgolib.XGO.turn_by": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 42, "bases": 0, "doc": 58}, "xgolib.XGO.turn_to": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 36, "bases": 0, "doc": 48}, "xgolib.XGO.translation": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 58}, "xgolib.XGO.attitude": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 61}, "xgolib.XGO.action": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 27, "bases": 0, "doc": 60}, "xgolib.XGO.reset": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 11}, "xgolib.XGO.leg": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 22, "bases": 0, "doc": 73}, "xgolib.XGO.motor": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 22, "bases": 0, "doc": 75}, "xgolib.XGO.unload_motor": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 17, "bases": 0, "doc": 44}, "xgolib.XGO.unload_allmotor": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 10}, "xgolib.XGO.load_motor": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 17, "bases": 0, "doc": 44}, "xgolib.XGO.load_allmotor": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 10}, "xgolib.XGO.periodic_rot": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 62}, "xgolib.XGO.periodic_tran": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 62}, "xgolib.XGO.mark_time": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 31}, "xgolib.XGO.pace": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 37}, "xgolib.XGO.gait_type": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 29}, "xgolib.XGO.imu": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 42}, "xgolib.XGO.perform": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 42}, "xgolib.XGO.motor_speed": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 35}, "xgolib.XGO.bt_rename": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 53}, "xgolib.XGO.read_motor": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 27}, "xgolib.XGO.read_battery": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 21}, "xgolib.XGO.read_firmware": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 20}, "xgolib.XGO.read_roll": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 21}, "xgolib.XGO.read_pitch": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 21}, "xgolib.XGO.read_yaw": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 21}, "xgolib.XGO.set_move_mintime": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 25}, "xgolib.XGO.upgrade": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 23}, "xgolib.XGO.read_lib_version": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 20}, "xgolib.XGO.calibration": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 38}, "xgolib.XGO.arm": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 23, "bases": 0, "doc": 63}, "xgolib.XGO.arm_polar": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 23, "bases": 0, "doc": 58}, "xgolib.XGO.arm_mode": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 37}, "xgolib.XGO.claw": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 38}, "xgolib.XGO.btRename": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 55}, "xgolib.XGO.moveToMid": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 13}, "xgolib.XGO.teach": {"qualname": 2, "fullname": 3, "annotation": 0, "default_value": 0, "signature": 22, "bases": 0, "doc": 49}, "xgolib.XGO.teach_arm": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 22, "bases": 0, "doc": 49}, "xgolib.XGO.arm_speed": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 35}, "xgolib.XGO.read_imu": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 39}, "xgolib.XGO.read_imu_int16": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 54}, "xgolib.XGO.unpack_imu": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 36}, "xgolib.XGO.set_origin": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 14}, "xgolib.XGO.move_to": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 21}, "xgolib.XGO.output_analog": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 19}, "xgolib.XGO.output_digital": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 19}, "xgolib.XGO.rider_move_x": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 26, "bases": 0, "doc": 50}, "xgolib.XGO.rider_turn": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 26, "bases": 0, "doc": 43}, "xgolib.XGO.rider_reset_odom": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 10}, "xgolib.XGO.rider_action": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 27, "bases": 0, "doc": 60}, "xgolib.XGO.rider_balance_roll": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 42}, "xgolib.XGO.rider_perform": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 41}, "xgolib.XGO.rider_calibration": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 38}, "xgolib.XGO.rider_height": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 20}, "xgolib.XGO.rider_roll": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 22}, "xgolib.XGO.rider_periodic_roll": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 24}, "xgolib.XGO.rider_periodic_z": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 24}, "xgolib.XGO.rider_read_battery": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 21}, "xgolib.XGO.rider_read_firmware": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 20}, "xgolib.XGO.rider_read_roll": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 21}, "xgolib.XGO.rider_read_pitch": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 21}, "xgolib.XGO.rider_read_yaw": {"qualname": 4, "fullname": 5, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 21}, "xgolib.XGO.rider_read_imu_int16": {"qualname": 5, "fullname": 6, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 58}, "xgolib.XGO.rider_reset": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 11, "bases": 0, "doc": 7}, "xgolib.XGO.rider_upgrade": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 16, "bases": 0, "doc": 23}, "xgolib.XGO.rider_led": {"qualname": 3, "fullname": 4, "annotation": 0, "default_value": 0, "signature": 21, "bases": 0, "doc": 47}}, "length": 103, "save": true}, "index": {"qualname": {"root": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1, "x": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}}, "df": 3, "g": {"docs": {}, "df": 0, "o": {"docs": {"xgolib.XGO": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.verbose": {"tf": 1}, "xgolib.XGO.ser": {"tf": 1}, "xgolib.XGO.port": {"tf": 1}, "xgolib.XGO.rx_FLAG": {"tf": 1}, "xgolib.XGO.rx_COUNT": {"tf": 1}, "xgolib.XGO.rx_ADDR": {"tf": 1}, "xgolib.XGO.rx_LEN": {"tf": 1}, "xgolib.XGO.rx_data": {"tf": 1}, "xgolib.XGO.version": {"tf": 1}, "xgolib.XGO.mintime": {"tf": 1}, "xgolib.XGO.init_yaw": {"tf": 1}, "xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 94, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGOparam": {"tf": 1}}, "df": 1}}}}}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.search": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {"xgolib.XGO.ser": {"tf": 1}}, "df": 1}, "t": {"docs": {"xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}}, "df": 2}}, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "p": {"docs": {"xgolib.XGO.stop": {"tf": 1}}, "df": 1}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}}, "df": 2}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"2": {"docs": {}, "df": 0, "u": {"8": {"docs": {"xgolib.conver2u8": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "f": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.conver2float": {"tf": 1}}, "df": 1}}}}}}, "docs": {}, "df": 0}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.rx_COUNT": {"tf": 1}}, "df": 1}}}}, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.changePara": {"tf": 1}}, "df": 1}}}}}}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 2}}}}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGO.claw": {"tf": 1}}, "df": 1}}}}, "b": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}}, "df": 4, "t": {"docs": {}, "df": 0, "e": {"2": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.Byte2Float": {"tf": 1}}, "df": 1}}}}}, "s": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.Byte2Short": {"tf": 1}}, "df": 1}}}}}}, "docs": {}, "df": 0}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {"xgolib.XGO.back": {"tf": 1}}, "df": 1}}, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}}, "df": 2}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.rider_balance_roll": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}}, "df": 1, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.btRename": {"tf": 1}}, "df": 1}}}}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.init_yaw": {"tf": 1}}, "df": 2}}, "t": {"1": {"6": {"docs": {"xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 2}, "docs": {}, "df": 0}, "docs": {}, "df": 0}}, "m": {"docs": {}, "df": 0, "u": {"docs": {"xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 5}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.verbose": {"tf": 1}}, "df": 1}}}}, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.version": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}}, "df": 2}}}}}}}, "p": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.port": {"tf": 1}}, "df": 1}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.arm_polar": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {"xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}}, "df": 4}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}}, "df": 2}}}}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.pace": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}}, "df": 2}}}}}, "r": {"docs": {}, "df": 0, "x": {"docs": {"xgolib.XGO.rx_FLAG": {"tf": 1}, "xgolib.XGO.rx_COUNT": {"tf": 1}, "xgolib.XGO.rx_ADDR": {"tf": 1}, "xgolib.XGO.rx_LEN": {"tf": 1}, "xgolib.XGO.rx_data": {"tf": 1}}, "df": 5}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.right": {"tf": 1}}, "df": 1}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 20}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}}, "df": 3}}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 15}}}, "o": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.periodic_rot": {"tf": 1}}, "df": 1}, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}}, "df": 5}}}}, "f": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.rx_FLAG": {"tf": 1}}, "df": 1}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.forward": {"tf": 1}}, "df": 1}}}}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}}, "df": 2}}}}}}}}, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.rx_ADDR": {"tf": 1}}, "df": 1}}}, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.attitude": {"tf": 1}}, "df": 1}}}}}}}, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}}}}, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}}, "df": 2}}}}}}}, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}}, "df": 5}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.output_analog": {"tf": 1}}, "df": 1}}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.rx_LEN": {"tf": 1}}, "df": 1}, "f": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.left": {"tf": 1}}, "df": 1}}, "g": {"docs": {"xgolib.XGO.leg": {"tf": 1}}, "df": 1}, "d": {"docs": {"xgolib.XGO.rider_led": {"tf": 1}}, "df": 1}}, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}}, "df": 2}}}, "i": {"docs": {}, "df": 0, "b": {"docs": {"xgolib.XGO.read_lib_version": {"tf": 1}}, "df": 1}}}, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.XGO.rx_data": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.output_digital": {"tf": 1}}, "df": 1}}}}}}}, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.mintime": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}}, "df": 2}}}}}}, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}}, "df": 9, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.moveToMid": {"tf": 1}}, "df": 1}}}}}}}, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}}, "df": 5}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.arm_mode": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {"xgolib.XGO.mark_time": {"tf": 1}}, "df": 1}}}}, "y": {"docs": {"xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}}, "df": 2, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGO.init_yaw": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}}, "df": 3}}}, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 4, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.turnleft": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.turnright": {"tf": 1}}, "df": 1}}}}}}}}, "o": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}}, "df": 2}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 1, "s": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.translation": {"tf": 1}}, "df": 1}}}}}}}}}}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.mark_time": {"tf": 1}}, "df": 1}}}, "y": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.gait_type": {"tf": 1}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}}, "df": 2}}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}}, "df": 2}}}}, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {"xgolib.XGO.unpack_imu": {"tf": 1}}, "df": 1}}}}}, "p": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}}, "df": 2}}}}}}}, "g": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.gait_type": {"tf": 1}}, "df": 1}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.set_origin": {"tf": 1}}, "df": 1}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}}, "df": 2}}}}}, "d": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.rider_reset_odom": {"tf": 1}}, "df": 1}}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.rider_height": {"tf": 1}}, "df": 1}}}}}}, "z": {"docs": {"xgolib.XGO.rider_periodic_z": {"tf": 1}}, "df": 1}}}, "fullname": {"root": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1, "x": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}}, "df": 3, "g": {"docs": {}, "df": 0, "o": {"docs": {"xgolib.XGO": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.verbose": {"tf": 1}, "xgolib.XGO.ser": {"tf": 1}, "xgolib.XGO.port": {"tf": 1}, "xgolib.XGO.rx_FLAG": {"tf": 1}, "xgolib.XGO.rx_COUNT": {"tf": 1}, "xgolib.XGO.rx_ADDR": {"tf": 1}, "xgolib.XGO.rx_LEN": {"tf": 1}, "xgolib.XGO.rx_data": {"tf": 1}, "xgolib.XGO.version": {"tf": 1}, "xgolib.XGO.mintime": {"tf": 1}, "xgolib.XGO.init_yaw": {"tf": 1}, "xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 94, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {"xgolib": {"tf": 1}, "xgolib.XGOorder": {"tf": 1}, "xgolib.XGOparam": {"tf": 1}, "xgolib.search": {"tf": 1}, "xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}, "xgolib.changePara": {"tf": 1}, "xgolib.XGO": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.verbose": {"tf": 1}, "xgolib.XGO.ser": {"tf": 1}, "xgolib.XGO.port": {"tf": 1}, "xgolib.XGO.rx_FLAG": {"tf": 1}, "xgolib.XGO.rx_COUNT": {"tf": 1}, "xgolib.XGO.rx_ADDR": {"tf": 1}, "xgolib.XGO.rx_LEN": {"tf": 1}, "xgolib.XGO.rx_data": {"tf": 1}, "xgolib.XGO.version": {"tf": 1}, "xgolib.XGO.mintime": {"tf": 1}, "xgolib.XGO.init_yaw": {"tf": 1}, "xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 103}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGOparam": {"tf": 1}}, "df": 1}}}}}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.search": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {"xgolib.XGO.ser": {"tf": 1}}, "df": 1}, "t": {"docs": {"xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}}, "df": 2}}, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "p": {"docs": {"xgolib.XGO.stop": {"tf": 1}}, "df": 1}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}}, "df": 2}}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"2": {"docs": {}, "df": 0, "u": {"8": {"docs": {"xgolib.conver2u8": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "f": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.conver2float": {"tf": 1}}, "df": 1}}}}}}, "docs": {}, "df": 0}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.rx_COUNT": {"tf": 1}}, "df": 1}}}}, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.changePara": {"tf": 1}}, "df": 1}}}}}}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 2}}}}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGO.claw": {"tf": 1}}, "df": 1}}}}, "b": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}}, "df": 4, "t": {"docs": {}, "df": 0, "e": {"2": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.Byte2Float": {"tf": 1}}, "df": 1}}}}}, "s": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.Byte2Short": {"tf": 1}}, "df": 1}}}}}}, "docs": {}, "df": 0}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {"xgolib.XGO.back": {"tf": 1}}, "df": 1}}, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}}, "df": 2}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.rider_balance_roll": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}}, "df": 1, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.btRename": {"tf": 1}}, "df": 1}}}}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.init_yaw": {"tf": 1}}, "df": 2}}, "t": {"1": {"6": {"docs": {"xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 2}, "docs": {}, "df": 0}, "docs": {}, "df": 0}}, "m": {"docs": {}, "df": 0, "u": {"docs": {"xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 5}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.verbose": {"tf": 1}}, "df": 1}}}}, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.version": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}}, "df": 2}}}}}}}, "p": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.port": {"tf": 1}}, "df": 1}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.arm_polar": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {"xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}}, "df": 4}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}}, "df": 2}}}}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.pace": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}}, "df": 2}}}}}, "r": {"docs": {}, "df": 0, "x": {"docs": {"xgolib.XGO.rx_FLAG": {"tf": 1}, "xgolib.XGO.rx_COUNT": {"tf": 1}, "xgolib.XGO.rx_ADDR": {"tf": 1}, "xgolib.XGO.rx_LEN": {"tf": 1}, "xgolib.XGO.rx_data": {"tf": 1}}, "df": 5}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.right": {"tf": 1}}, "df": 1}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 20}}}}, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}}, "df": 3}}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 15}}}, "o": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.periodic_rot": {"tf": 1}}, "df": 1}, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}}, "df": 5}}}}, "f": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.rx_FLAG": {"tf": 1}}, "df": 1}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.forward": {"tf": 1}}, "df": 1}}}}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}}, "df": 2}}}}}}}}, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.rx_ADDR": {"tf": 1}}, "df": 1}}}, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.attitude": {"tf": 1}}, "df": 1}}}}}}}, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}}}}, "l": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}}, "df": 2}}}}}}}, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}}, "df": 5}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.output_analog": {"tf": 1}}, "df": 1}}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.rx_LEN": {"tf": 1}}, "df": 1}, "f": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.left": {"tf": 1}}, "df": 1}}, "g": {"docs": {"xgolib.XGO.leg": {"tf": 1}}, "df": 1}, "d": {"docs": {"xgolib.XGO.rider_led": {"tf": 1}}, "df": 1}}, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}}, "df": 2}}}, "i": {"docs": {}, "df": 0, "b": {"docs": {"xgolib.XGO.read_lib_version": {"tf": 1}}, "df": 1}}}, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.XGO.rx_data": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.output_digital": {"tf": 1}}, "df": 1}}}}}}}, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.mintime": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}}, "df": 2}}}}}}, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}}, "df": 9, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.moveToMid": {"tf": 1}}, "df": 1}}}}}}}, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}}, "df": 5}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.arm_mode": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {"xgolib.XGO.mark_time": {"tf": 1}}, "df": 1}}}}, "y": {"docs": {"xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}}, "df": 2, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGO.init_yaw": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}}, "df": 3}}}, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 4, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.turnleft": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.turnright": {"tf": 1}}, "df": 1}}}}}}}}, "o": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}}, "df": 2}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 1, "s": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.translation": {"tf": 1}}, "df": 1}}}}}}}}}}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.mark_time": {"tf": 1}}, "df": 1}}}, "y": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.gait_type": {"tf": 1}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}}, "df": 2}}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}}, "df": 2}}}}, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {"xgolib.XGO.unpack_imu": {"tf": 1}}, "df": 1}}}}}, "p": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}}, "df": 2}}}}}}}, "g": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.gait_type": {"tf": 1}}, "df": 1}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.set_origin": {"tf": 1}}, "df": 1}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}}, "df": 2}}}}}, "d": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.rider_reset_odom": {"tf": 1}}, "df": 1}}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.rider_height": {"tf": 1}}, "df": 1}}}}}}, "z": {"docs": {"xgolib.XGO.rider_periodic_z": {"tf": 1}}, "df": 1}}}, "annotation": {"root": {"docs": {}, "df": 0}}, "default_value": {"root": {"0": {"docs": {"xgolib.XGOorder": {"tf": 8.06225774829855}}, "df": 1}, "1": {"0": {"0": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}}, "df": 1}, "5": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "1": {"3": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "4": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "5": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "6": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "7": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "8": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "9": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "2": {"8": {"docs": {"xgolib.XGOorder": {"tf": 4.358898943540674}}, "df": 1}, "docs": {}, "df": 0}, "4": {"4": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "5": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "9": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGOorder": {"tf": 2}}, "df": 1}, "3": {"2": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}}, "df": 1}, "3": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "4": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "5": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "6": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "4": {"8": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "9": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "5": {"0": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "1": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "4": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "7": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "6": {"0": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "1": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "3": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "4": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "7": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "8": {"0": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "9": {"2": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "5": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "7": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "8": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "9": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGOorder": {"tf": 6.6332495807108}, "xgolib.XGOparam": {"tf": 1}}, "df": 2, "x": {"2": {"7": {"docs": {"xgolib.XGOorder": {"tf": 9.273618495495704}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "b": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}, "t": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}, "o": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}}, "df": 1}}}}, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}, "u": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}, "n": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}, "x": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "y": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}, "g": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1, "s": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}}}}}, "o": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}}, "df": 1}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGOorder": {"tf": 2}}, "df": 1}}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGOorder": {"tf": 2}}, "df": 1}}}, "v": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1.7320508075688772}}, "df": 1}}, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}}, "i": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "d": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}}, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGOorder": {"tf": 2.8284271247461903}}, "df": 1}}}, "r": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1, "o": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "u": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}, "y": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}, "z": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}}}}}}}}, "signature": {"root": {"0": {"3": {"5": {"docs": {"xgolib.XGO.move_x_by": {"tf": 1}}, "df": 1}, "7": {"3": {"docs": {"xgolib.XGO.move_y_by": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "8": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}}, "df": 1}, "docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y_by": {"tf": 1.4142135623730951}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 9}, "1": {"0": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}}, "df": 1}, "1": {"5": {"2": {"0": {"0": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "6": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}}, "df": 1}, "8": {"docs": {"xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}}, "df": 2}, "docs": {}, "df": 0}, "3": {"9": {"docs": {"xgolib.XGO.__init__": {"tf": 1.4142135623730951}}, "df": 1}, "docs": {}, "df": 0}, "5": {"5": {"docs": {"xgolib.XGO.move_x_by": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGO.move_y_by": {"tf": 1}}, "df": 1}, "6": {"0": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {"xgolib.search": {"tf": 3.7416573867739413}, "xgolib.conver2u8": {"tf": 4.69041575982343}, "xgolib.conver2float": {"tf": 3.7416573867739413}, "xgolib.Byte2Float": {"tf": 3.1622776601683795}, "xgolib.Byte2Short": {"tf": 3.1622776601683795}, "xgolib.changePara": {"tf": 3.1622776601683795}, "xgolib.XGO.__init__": {"tf": 5.830951894845301}, "xgolib.XGO.stop": {"tf": 3.1622776601683795}, "xgolib.XGO.move": {"tf": 4.242640687119285}, "xgolib.XGO.move_x": {"tf": 4.69041575982343}, "xgolib.XGO.move_y": {"tf": 4.69041575982343}, "xgolib.XGO.turn": {"tf": 4.69041575982343}, "xgolib.XGO.forward": {"tf": 3.7416573867739413}, "xgolib.XGO.back": {"tf": 3.7416573867739413}, "xgolib.XGO.left": {"tf": 3.7416573867739413}, "xgolib.XGO.right": {"tf": 3.7416573867739413}, "xgolib.XGO.turnleft": {"tf": 3.7416573867739413}, "xgolib.XGO.turnright": {"tf": 3.7416573867739413}, "xgolib.XGO.move_by": {"tf": 5.477225575051661}, "xgolib.XGO.move_x_by": {"tf": 6.164414002968976}, "xgolib.XGO.move_y_by": {"tf": 6.164414002968976}, "xgolib.XGO.turn_by": {"tf": 5.830951894845301}, "xgolib.XGO.turn_to": {"tf": 5.477225575051661}, "xgolib.XGO.translation": {"tf": 4.242640687119285}, "xgolib.XGO.attitude": {"tf": 4.242640687119285}, "xgolib.XGO.action": {"tf": 4.69041575982343}, "xgolib.XGO.reset": {"tf": 3.1622776601683795}, "xgolib.XGO.leg": {"tf": 4.242640687119285}, "xgolib.XGO.motor": {"tf": 4.242640687119285}, "xgolib.XGO.unload_motor": {"tf": 3.7416573867739413}, "xgolib.XGO.unload_allmotor": {"tf": 3.1622776601683795}, "xgolib.XGO.load_motor": {"tf": 3.7416573867739413}, "xgolib.XGO.load_allmotor": {"tf": 3.1622776601683795}, "xgolib.XGO.periodic_rot": {"tf": 4.242640687119285}, "xgolib.XGO.periodic_tran": {"tf": 4.242640687119285}, "xgolib.XGO.mark_time": {"tf": 3.7416573867739413}, "xgolib.XGO.pace": {"tf": 3.7416573867739413}, "xgolib.XGO.gait_type": {"tf": 3.7416573867739413}, "xgolib.XGO.imu": {"tf": 3.7416573867739413}, "xgolib.XGO.perform": {"tf": 3.7416573867739413}, "xgolib.XGO.motor_speed": {"tf": 3.7416573867739413}, "xgolib.XGO.bt_rename": {"tf": 3.7416573867739413}, "xgolib.XGO.read_motor": {"tf": 3.1622776601683795}, "xgolib.XGO.read_battery": {"tf": 3.1622776601683795}, "xgolib.XGO.read_firmware": {"tf": 3.1622776601683795}, "xgolib.XGO.read_roll": {"tf": 3.1622776601683795}, "xgolib.XGO.read_pitch": {"tf": 3.1622776601683795}, "xgolib.XGO.read_yaw": {"tf": 3.1622776601683795}, "xgolib.XGO.set_move_mintime": {"tf": 3.7416573867739413}, "xgolib.XGO.upgrade": {"tf": 3.7416573867739413}, "xgolib.XGO.read_lib_version": {"tf": 3.1622776601683795}, "xgolib.XGO.calibration": {"tf": 3.7416573867739413}, "xgolib.XGO.arm": {"tf": 4.242640687119285}, "xgolib.XGO.arm_polar": {"tf": 4.242640687119285}, "xgolib.XGO.arm_mode": {"tf": 3.7416573867739413}, "xgolib.XGO.claw": {"tf": 3.7416573867739413}, "xgolib.XGO.btRename": {"tf": 3.7416573867739413}, "xgolib.XGO.moveToMid": {"tf": 3.1622776601683795}, "xgolib.XGO.teach": {"tf": 4.242640687119285}, "xgolib.XGO.teach_arm": {"tf": 4.242640687119285}, "xgolib.XGO.arm_speed": {"tf": 3.7416573867739413}, "xgolib.XGO.read_imu": {"tf": 3.1622776601683795}, "xgolib.XGO.read_imu_int16": {"tf": 3.7416573867739413}, "xgolib.XGO.unpack_imu": {"tf": 3.1622776601683795}, "xgolib.XGO.set_origin": {"tf": 3.1622776601683795}, "xgolib.XGO.move_to": {"tf": 3.7416573867739413}, "xgolib.XGO.output_analog": {"tf": 3.7416573867739413}, "xgolib.XGO.output_digital": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_move_x": {"tf": 4.69041575982343}, "xgolib.XGO.rider_turn": {"tf": 4.69041575982343}, "xgolib.XGO.rider_reset_odom": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_action": {"tf": 4.69041575982343}, "xgolib.XGO.rider_balance_roll": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_perform": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_calibration": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_height": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_roll": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_periodic_roll": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_periodic_z": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_read_battery": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_read_firmware": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_read_roll": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_read_pitch": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_read_yaw": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_read_imu_int16": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_reset": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_upgrade": {"tf": 3.7416573867739413}, "xgolib.XGO.rider_led": {"tf": 4.242640687119285}}, "df": 88, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.search": {"tf": 1}, "xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}}, "df": 13}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 7}}}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}}, "df": 3}}}}}}}}, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.search": {"tf": 1}}, "df": 1}}, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2}}}}, "e": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}}, "df": 3}}}, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.conver2u8": {"tf": 1}}, "df": 1, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}}, "df": 5}}}}}}, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}}, "df": 9}}}}, "v": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.conver2u8": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.changePara": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}}, "df": 2}}}}, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}}}}}, "x": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}}, "df": 2}, "y": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}}, "df": 2, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}}, "df": 2}}}}, "r": {"docs": {"xgolib.XGO.arm_polar": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}}, "df": 2}}}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 5}}}}}}}, "p": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}, "s": {"docs": {"xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}}, "df": 3}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}}, "df": 4}}}}}}, "b": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}}}, "x": {"docs": {"xgolib.XGO.arm": {"tf": 1}}, "df": 1, "g": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}}}}}}, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 3}}}}, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}}, "df": 2}}}}}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "f": {"docs": {"xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 81}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}}, "df": 10}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 2}}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 4}}}}}, "k": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}}, "df": 4}, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}}, "df": 3}}}}}, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "x": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}}, "df": 1}}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}}}}, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.arm": {"tf": 1.4142135623730951}, "xgolib.XGO.arm_polar": {"tf": 1.4142135623730951}}, "df": 2}}}, "i": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 8}, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {"xgolib.XGO.rider_led": {"tf": 1}}, "df": 1}}}}}, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}}}}, "z": {"docs": {"xgolib.XGO.arm": {"tf": 1}}, "df": 1}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.rider_led": {"tf": 1}}, "df": 1}}}}}}}, "bases": {"root": {"docs": {}, "df": 0}}, "doc": {"root": {"0": {"3": {"5": {"docs": {"xgolib.XGO.move_x_by": {"tf": 1}}, "df": 1}, "7": {"3": {"docs": {"xgolib.XGO.move_y_by": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "8": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}}, "df": 1}, "docs": {"xgolib.conver2u8": {"tf": 1.7320508075688772}, "xgolib.conver2float": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y_by": {"tf": 1.4142135623730951}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 19, "x": {"0": {"0": {"docs": {"xgolib.XGO.arm_mode": {"tf": 1}}, "df": 1}, "1": {"docs": {"xgolib.XGO.arm_mode": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}}, "1": {"0": {"0": {"docs": {"xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}}, "df": 2}, "docs": {"xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1.4142135623730951}}, "df": 2}, "1": {"5": {"2": {"0": {"0": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {}, "df": 0}, "docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "3": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "5": {"docs": {"xgolib.XGO.read_motor": {"tf": 1.4142135623730951}}, "df": 1}, "6": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1.4142135623730951}}, "df": 3}, "8": {"docs": {"xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}}, "df": 2}, "docs": {"xgolib.search": {"tf": 1.4142135623730951}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 13}, "2": {"0": {"docs": {"xgolib.XGO.btRename": {"tf": 1.4142135623730951}}, "df": 1}, "1": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "3": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "5": {"5": {"docs": {"xgolib.conver2u8": {"tf": 1.4142135623730951}, "xgolib.conver2float": {"tf": 1.4142135623730951}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 8}, "docs": {}, "df": 0}, "docs": {"xgolib.Byte2Short": {"tf": 1.4142135623730951}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}}, "df": 4}, "3": {"1": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "3": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}}, "df": 3}, "4": {"1": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "3": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "docs": {"xgolib.Byte2Float": {"tf": 1.4142135623730951}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 5}, "5": {"1": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "2": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "3": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "5": {"docs": {"xgolib.XGO.move_x_by": {"tf": 1}}, "df": 1}, "docs": {"xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}}, "df": 3}, "6": {"0": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}, "9": {"docs": {"xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}}, "df": 2}, "docs": {"xgolib": {"tf": 1.7320508075688772}, "xgolib.XGOorder": {"tf": 1.7320508075688772}, "xgolib.XGOparam": {"tf": 1.7320508075688772}, "xgolib.search": {"tf": 3.1622776601683795}, "xgolib.conver2u8": {"tf": 3.4641016151377544}, "xgolib.conver2float": {"tf": 3.3166247903554}, "xgolib.Byte2Float": {"tf": 3.1622776601683795}, "xgolib.Byte2Short": {"tf": 3.1622776601683795}, "xgolib.changePara": {"tf": 2.6457513110645907}, "xgolib.XGO": {"tf": 1.7320508075688772}, "xgolib.XGO.__init__": {"tf": 3.1622776601683795}, "xgolib.XGO.verbose": {"tf": 1.7320508075688772}, "xgolib.XGO.ser": {"tf": 1.7320508075688772}, "xgolib.XGO.port": {"tf": 1.7320508075688772}, "xgolib.XGO.rx_FLAG": {"tf": 1.7320508075688772}, "xgolib.XGO.rx_COUNT": {"tf": 1.7320508075688772}, "xgolib.XGO.rx_ADDR": {"tf": 1.7320508075688772}, "xgolib.XGO.rx_LEN": {"tf": 1.7320508075688772}, "xgolib.XGO.rx_data": {"tf": 1.7320508075688772}, "xgolib.XGO.version": {"tf": 1.7320508075688772}, "xgolib.XGO.mintime": {"tf": 1.7320508075688772}, "xgolib.XGO.init_yaw": {"tf": 1.7320508075688772}, "xgolib.XGO.stop": {"tf": 1.7320508075688772}, "xgolib.XGO.move": {"tf": 3.3166247903554}, "xgolib.XGO.move_x": {"tf": 2.8284271247461903}, "xgolib.XGO.move_y": {"tf": 2.8284271247461903}, "xgolib.XGO.turn": {"tf": 2.8284271247461903}, "xgolib.XGO.forward": {"tf": 2.6457513110645907}, "xgolib.XGO.back": {"tf": 2.6457513110645907}, "xgolib.XGO.left": {"tf": 2.6457513110645907}, "xgolib.XGO.right": {"tf": 2.6457513110645907}, "xgolib.XGO.turnleft": {"tf": 2.6457513110645907}, "xgolib.XGO.turnright": {"tf": 2.6457513110645907}, "xgolib.XGO.move_by": {"tf": 3.3166247903554}, "xgolib.XGO.move_x_by": {"tf": 3.1622776601683795}, "xgolib.XGO.move_y_by": {"tf": 3.1622776601683795}, "xgolib.XGO.turn_by": {"tf": 3.1622776601683795}, "xgolib.XGO.turn_to": {"tf": 3}, "xgolib.XGO.translation": {"tf": 3.3166247903554}, "xgolib.XGO.attitude": {"tf": 3.3166247903554}, "xgolib.XGO.action": {"tf": 3.3166247903554}, "xgolib.XGO.reset": {"tf": 1.7320508075688772}, "xgolib.XGO.leg": {"tf": 3.3166247903554}, "xgolib.XGO.motor": {"tf": 3.3166247903554}, "xgolib.XGO.unload_motor": {"tf": 3.1622776601683795}, "xgolib.XGO.unload_allmotor": {"tf": 1.7320508075688772}, "xgolib.XGO.load_motor": {"tf": 3.1622776601683795}, "xgolib.XGO.load_allmotor": {"tf": 1.7320508075688772}, "xgolib.XGO.periodic_rot": {"tf": 3.3166247903554}, "xgolib.XGO.periodic_tran": {"tf": 3.3166247903554}, "xgolib.XGO.mark_time": {"tf": 2.8284271247461903}, "xgolib.XGO.pace": {"tf": 3.1622776601683795}, "xgolib.XGO.gait_type": {"tf": 2.6457513110645907}, "xgolib.XGO.imu": {"tf": 3.1622776601683795}, "xgolib.XGO.perform": {"tf": 3.3166247903554}, "xgolib.XGO.motor_speed": {"tf": 3.1622776601683795}, "xgolib.XGO.bt_rename": {"tf": 3.1622776601683795}, "xgolib.XGO.read_motor": {"tf": 2.449489742783178}, "xgolib.XGO.read_battery": {"tf": 2.449489742783178}, "xgolib.XGO.read_firmware": {"tf": 2.449489742783178}, "xgolib.XGO.read_roll": {"tf": 2.449489742783178}, "xgolib.XGO.read_pitch": {"tf": 2.449489742783178}, "xgolib.XGO.read_yaw": {"tf": 2.449489742783178}, "xgolib.XGO.set_move_mintime": {"tf": 2.6457513110645907}, "xgolib.XGO.upgrade": {"tf": 2.6457513110645907}, "xgolib.XGO.read_lib_version": {"tf": 2.449489742783178}, "xgolib.XGO.calibration": {"tf": 3.1622776601683795}, "xgolib.XGO.arm": {"tf": 3.3166247903554}, "xgolib.XGO.arm_polar": {"tf": 3.3166247903554}, "xgolib.XGO.arm_mode": {"tf": 3.1622776601683795}, "xgolib.XGO.claw": {"tf": 3.1622776601683795}, "xgolib.XGO.btRename": {"tf": 3.1622776601683795}, "xgolib.XGO.moveToMid": {"tf": 1.7320508075688772}, "xgolib.XGO.teach": {"tf": 2.8284271247461903}, "xgolib.XGO.teach_arm": {"tf": 2.8284271247461903}, "xgolib.XGO.arm_speed": {"tf": 3.1622776601683795}, "xgolib.XGO.read_imu": {"tf": 2.449489742783178}, "xgolib.XGO.read_imu_int16": {"tf": 3.1622776601683795}, "xgolib.XGO.unpack_imu": {"tf": 2.449489742783178}, "xgolib.XGO.set_origin": {"tf": 1.7320508075688772}, "xgolib.XGO.move_to": {"tf": 2.6457513110645907}, "xgolib.XGO.output_analog": {"tf": 2.6457513110645907}, "xgolib.XGO.output_digital": {"tf": 2.6457513110645907}, "xgolib.XGO.rider_move_x": {"tf": 2.8284271247461903}, "xgolib.XGO.rider_turn": {"tf": 2.8284271247461903}, "xgolib.XGO.rider_reset_odom": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_action": {"tf": 3.3166247903554}, "xgolib.XGO.rider_balance_roll": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_perform": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_calibration": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_height": {"tf": 2.6457513110645907}, "xgolib.XGO.rider_roll": {"tf": 2.6457513110645907}, "xgolib.XGO.rider_periodic_roll": {"tf": 2.6457513110645907}, "xgolib.XGO.rider_periodic_z": {"tf": 2.6457513110645907}, "xgolib.XGO.rider_read_battery": {"tf": 2.449489742783178}, "xgolib.XGO.rider_read_firmware": {"tf": 2.449489742783178}, "xgolib.XGO.rider_read_roll": {"tf": 2.449489742783178}, "xgolib.XGO.rider_read_pitch": {"tf": 2.449489742783178}, "xgolib.XGO.rider_read_yaw": {"tf": 2.449489742783178}, "xgolib.XGO.rider_read_imu_int16": {"tf": 3.1622776601683795}, "xgolib.XGO.rider_reset": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_upgrade": {"tf": 2.6457513110645907}, "xgolib.XGO.rider_led": {"tf": 2.8284271247461903}}, "df": 103, "x": {"docs": {"xgolib.XGO.move": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.move_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x_by": {"tf": 1.7320508075688772}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.arm": {"tf": 2}, "xgolib.XGO.read_imu": {"tf": 1.4142135623730951}, "xgolib.XGO.unpack_imu": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_move_x": {"tf": 1.4142135623730951}}, "df": 11, "g": {"docs": {}, "df": 0, "o": {"docs": {"xgolib.XGO": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1.4142135623730951}, "xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 73, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGOorder": {"tf": 1}, "xgolib.changePara": {"tf": 1}}, "df": 2}}}}}, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {"xgolib.changePara": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1.4142135623730951}}, "df": 2}}}}, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.changePara": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}}, "df": 2}}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.changePara": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}}, "df": 2}}}}}}}}, "i": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGOorder": {"tf": 1}, "xgolib.conver2u8": {"tf": 1.7320508075688772}, "xgolib.conver2float": {"tf": 1.4142135623730951}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1.4142135623730951}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1.4142135623730951}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 25}, "n": {"docs": {"xgolib.search": {"tf": 1}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}}, "df": 19, "t": {"docs": {"xgolib.search": {"tf": 1}, "xgolib.conver2u8": {"tf": 1.4142135623730951}, "xgolib.conver2float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 28, "e": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.Byte2Short": {"tf": 1.4142135623730951}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 3, "s": {"docs": {"xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 3}}}}, "r": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO": {"tf": 1}}, "df": 1}}}}}}, "o": {"docs": {"xgolib.XGO.unpack_imu": {"tf": 1}}, "df": 1}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "x": {"docs": {"xgolib.search": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1.4142135623730951}}, "df": 2}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO": {"tf": 1}}, "df": 1}}}}}}}}}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.reset": {"tf": 1}}, "df": 1, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 2, "s": {"docs": {"xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}}, "df": 6}}}}}}}, "v": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 22}}}}}, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.read_imu": {"tf": 1}}, "df": 1}}}}}}}, "f": {"docs": {"xgolib.search": {"tf": 1}, "xgolib.conver2u8": {"tf": 1.7320508075688772}, "xgolib.conver2float": {"tf": 1.4142135623730951}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1.4142135623730951}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1.4142135623730951}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1.4142135623730951}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 36}, "t": {"docs": {"xgolib.conver2u8": {"tf": 1.4142135623730951}, "xgolib.conver2float": {"tf": 1.4142135623730951}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}}, "df": 6, "s": {"docs": {"xgolib.conver2float": {"tf": 1}, "xgolib.XGO.reset": {"tf": 1}}, "df": 2}}, "d": {"docs": {"xgolib.XGO.action": {"tf": 1.7320508075688772}, "xgolib.XGO.leg": {"tf": 1.7320508075688772}, "xgolib.XGO.motor": {"tf": 1.7320508075688772}, "xgolib.XGO.unload_motor": {"tf": 1.7320508075688772}, "xgolib.XGO.load_motor": {"tf": 1.7320508075688772}, "xgolib.XGO.teach": {"tf": 1.4142135623730951}, "xgolib.XGO.teach_arm": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_action": {"tf": 1.7320508075688772}}, "df": 8}, "m": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.btRename": {"tf": 1}}, "df": 1}}}}}}}}}}}}, "u": {"docs": {"xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1.4142135623730951}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1.4142135623730951}}, "df": 4}}}, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1, "d": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}}, "df": 6}}}}, "p": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO": {"tf": 1}}, "df": 1}}}, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}}, "df": 2}}}}}}}, "n": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}}, "df": 2}}}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.read_imu": {"tf": 1}}, "df": 1}}, "p": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "k": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.unpack_imu": {"tf": 1}}, "df": 1}}}}}}}, "t": {"docs": {"xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 4, "o": {"docs": {"xgolib.XGOorder": {"tf": 1}, "xgolib.search": {"tf": 1.4142135623730951}, "xgolib.conver2u8": {"tf": 2}, "xgolib.conver2float": {"tf": 1}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}, "xgolib.XGO": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 2}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 2}, "xgolib.XGO.move_y_by": {"tf": 2}, "xgolib.XGO.turn_by": {"tf": 1.7320508075688772}, "xgolib.XGO.turn_to": {"tf": 1.7320508075688772}, "xgolib.XGO.action": {"tf": 1.7320508075688772}, "xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1.4142135623730951}, "xgolib.XGO.imu": {"tf": 1.4142135623730951}, "xgolib.XGO.perform": {"tf": 1.4142135623730951}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1.4142135623730951}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1.7320508075688772}, "xgolib.XGO.teach_arm": {"tf": 1.7320508075688772}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_balance_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_perform": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_calibration": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}}, "df": 42, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}}, "df": 1}}}}}}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1.4142135623730951}, "xgolib.search": {"tf": 2.23606797749979}, "xgolib.conver2u8": {"tf": 2.8284271247461903}, "xgolib.conver2float": {"tf": 2.23606797749979}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}, "xgolib.changePara": {"tf": 1.7320508075688772}, "xgolib.XGO": {"tf": 1.7320508075688772}, "xgolib.XGO.__init__": {"tf": 2.23606797749979}, "xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.move": {"tf": 2}, "xgolib.XGO.move_x": {"tf": 2.8284271247461903}, "xgolib.XGO.move_y": {"tf": 2.8284271247461903}, "xgolib.XGO.turn": {"tf": 2.449489742783178}, "xgolib.XGO.forward": {"tf": 1.7320508075688772}, "xgolib.XGO.back": {"tf": 1.7320508075688772}, "xgolib.XGO.left": {"tf": 2}, "xgolib.XGO.right": {"tf": 2}, "xgolib.XGO.turnleft": {"tf": 2}, "xgolib.XGO.turnright": {"tf": 2}, "xgolib.XGO.move_by": {"tf": 3}, "xgolib.XGO.move_x_by": {"tf": 3}, "xgolib.XGO.move_y_by": {"tf": 3}, "xgolib.XGO.turn_by": {"tf": 2.449489742783178}, "xgolib.XGO.turn_to": {"tf": 2.23606797749979}, "xgolib.XGO.translation": {"tf": 2}, "xgolib.XGO.attitude": {"tf": 2}, "xgolib.XGO.action": {"tf": 2.23606797749979}, "xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.leg": {"tf": 2.449489742783178}, "xgolib.XGO.motor": {"tf": 2.23606797749979}, "xgolib.XGO.unload_motor": {"tf": 1.7320508075688772}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1.7320508075688772}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 2}, "xgolib.XGO.periodic_tran": {"tf": 2}, "xgolib.XGO.mark_time": {"tf": 1.7320508075688772}, "xgolib.XGO.pace": {"tf": 1.7320508075688772}, "xgolib.XGO.gait_type": {"tf": 1.7320508075688772}, "xgolib.XGO.imu": {"tf": 1.4142135623730951}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1.7320508075688772}, "xgolib.XGO.bt_rename": {"tf": 2.23606797749979}, "xgolib.XGO.read_motor": {"tf": 1.7320508075688772}, "xgolib.XGO.read_battery": {"tf": 1.7320508075688772}, "xgolib.XGO.read_firmware": {"tf": 1.7320508075688772}, "xgolib.XGO.read_roll": {"tf": 1.7320508075688772}, "xgolib.XGO.read_pitch": {"tf": 1.7320508075688772}, "xgolib.XGO.read_yaw": {"tf": 1.7320508075688772}, "xgolib.XGO.set_move_mintime": {"tf": 1.7320508075688772}, "xgolib.XGO.upgrade": {"tf": 2}, "xgolib.XGO.read_lib_version": {"tf": 1.7320508075688772}, "xgolib.XGO.calibration": {"tf": 1.4142135623730951}, "xgolib.XGO.arm": {"tf": 2.6457513110645907}, "xgolib.XGO.arm_polar": {"tf": 2.449489742783178}, "xgolib.XGO.arm_mode": {"tf": 1.7320508075688772}, "xgolib.XGO.claw": {"tf": 1.7320508075688772}, "xgolib.XGO.btRename": {"tf": 2.23606797749979}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1.7320508075688772}, "xgolib.XGO.teach_arm": {"tf": 1.7320508075688772}, "xgolib.XGO.arm_speed": {"tf": 1.7320508075688772}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1.4142135623730951}, "xgolib.XGO.set_origin": {"tf": 1.7320508075688772}, "xgolib.XGO.move_to": {"tf": 1.4142135623730951}, "xgolib.XGO.output_analog": {"tf": 1.4142135623730951}, "xgolib.XGO.output_digital": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_move_x": {"tf": 2.6457513110645907}, "xgolib.XGO.rider_turn": {"tf": 2.449489742783178}, "xgolib.XGO.rider_reset_odom": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_action": {"tf": 2.23606797749979}, "xgolib.XGO.rider_balance_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_height": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_roll": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_periodic_roll": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_periodic_z": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_read_battery": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_read_firmware": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_read_roll": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_read_pitch": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_read_yaw": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_reset": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 2}, "xgolib.XGO.rider_led": {"tf": 2.23606797749979}}, "df": 89, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1.7320508075688772}}, "df": 3}}, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 4}}, "i": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.moveToMid": {"tf": 1}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 5}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.leg": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 2}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2}}}}}, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.translation": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.translation": {"tf": 1.4142135623730951}, "xgolib.XGO.periodic_tran": {"tf": 1.7320508075688772}}, "df": 2}}}}}}}}}, "u": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}, "o": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.gait_type": {"tf": 1.4142135623730951}}, "df": 1}}}, "w": {"docs": {}, "df": 0, "o": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2}}, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1.7320508075688772}, "xgolib.XGO.imu": {"tf": 1.4142135623730951}, "xgolib.XGO.perform": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_turn": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_balance_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_perform": {"tf": 1.4142135623730951}}, "df": 8, "s": {"docs": {"xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}}, "df": 9}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.rider_turn": {"tf": 1}}, "df": 1}}}}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}}, "df": 3}}}}, "u": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}}, "df": 2}}}}}, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.mark_time": {"tf": 1.7320508075688772}, "xgolib.XGO.set_move_mintime": {"tf": 1.4142135623730951}}, "df": 2}}}, "y": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.gait_type": {"tf": 1.4142135623730951}}, "df": 1, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}}}}}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 2, "s": {"docs": {"xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 2}}}}}}}}}}, "s": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1.4142135623730951}, "xgolib.XGO.attitude": {"tf": 1.4142135623730951}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 2}, "xgolib.XGO.periodic_rot": {"tf": 1.4142135623730951}, "xgolib.XGO.periodic_tran": {"tf": 1.4142135623730951}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1.7320508075688772}, "xgolib.XGO.arm_polar": {"tf": 1.4142135623730951}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}}, "df": 17, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1}}, "df": 1}}, "p": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 6, "s": {"docs": {"xgolib.XGO.stop": {"tf": 1}}, "df": 1}}}, "r": {"docs": {"xgolib.changePara": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}}, "df": 22, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}}, "df": 6}}}}, "e": {"docs": {}, "df": 0, "p": {"docs": {"xgolib.XGO.move": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y": {"tf": 1.4142135623730951}, "xgolib.XGO.turn": {"tf": 1.4142135623730951}, "xgolib.XGO.forward": {"tf": 1.4142135623730951}, "xgolib.XGO.back": {"tf": 1.4142135623730951}, "xgolib.XGO.left": {"tf": 1.4142135623730951}, "xgolib.XGO.right": {"tf": 1.4142135623730951}, "xgolib.XGO.turnleft": {"tf": 1.4142135623730951}, "xgolib.XGO.turnright": {"tf": 1.4142135623730951}, "xgolib.XGO.pace": {"tf": 1}}, "df": 11}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_calibration": {"tf": 1.4142135623730951}}, "df": 3}}, "b": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "z": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.imu": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 2}}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.search": {"tf": 1.4142135623730951}}, "df": 1, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.search": {"tf": 1}}, "df": 1}}}}}}, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}}, "df": 2}}}}}}, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1.4142135623730951}}, "df": 2}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 6}}}}}, "t": {"docs": {"xgolib.XGO.mark_time": {"tf": 1}}, "df": 1, "s": {"docs": {"xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 7}}, "l": {"docs": {}, "df": 0, "f": {"docs": {"xgolib.XGO.imu": {"tf": 1.4142135623730951}}, "df": 1}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {"xgolib.search": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 8}, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}, "d": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}}, "df": 4}}}, "y": {"docs": {"xgolib.XGO": {"tf": 1}}, "df": 1}}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 2}, "xgolib.XGO.arm_speed": {"tf": 2}, "xgolib.XGO.rider_move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_turn": {"tf": 1.4142135623730951}}, "df": 14}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.conver2u8": {"tf": 1.7320508075688772}, "xgolib.conver2float": {"tf": 1.7320508075688772}, "xgolib.XGO.leg": {"tf": 1}}, "df": 3}}}}, "g": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.Byte2Short": {"tf": 1.4142135623730951}, "xgolib.XGO.read_imu_int16": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1.4142135623730951}}, "df": 3}}}}, "z": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}}, "df": 10}}}, "y": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2}}}}}}}}}}, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2}}}, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.Byte2Short": {"tf": 1.4142135623730951}}, "df": 1}}}}, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}}, "df": 4}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}}, "df": 2}}}}, "p": {"docs": {"xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}}, "df": 2, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGOorder": {"tf": 1}, "xgolib.conver2u8": {"tf": 1.4142135623730951}, "xgolib.conver2float": {"tf": 1}}, "df": 3, "s": {"docs": {"xgolib.search": {"tf": 1}, "xgolib.conver2u8": {"tf": 1.4142135623730951}, "xgolib.conver2float": {"tf": 1}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}, "xgolib.changePara": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 66}}}}}}}}, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.pace": {"tf": 1.4142135623730951}}, "df": 1}}, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}}, "df": 2}}}, "o": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}}, "df": 3, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.search": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1.7320508075688772}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 2}, "xgolib.XGO.teach_arm": {"tf": 2}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1.4142135623730951}}, "df": 7}}}}}}, "r": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.__init__": {"tf": 1.4142135623730951}}, "df": 1}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.arm_polar": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.conver2u8": {"tf": 1.4142135623730951}, "xgolib.conver2float": {"tf": 1.7320508075688772}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 29}}}}}, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}}}, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}}}}, "s": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 2}}}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}}}}}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.action": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_action": {"tf": 1.4142135623730951}}, "df": 2, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.perform": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_perform": {"tf": 1.4142135623730951}}, "df": 2}}}}}}}}, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.periodic_rot": {"tf": 1.7320508075688772}, "xgolib.XGO.periodic_tran": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_periodic_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_periodic_z": {"tf": 1.4142135623730951}}, "df": 4, "i": {"docs": {}, "df": 0, "c": {"docs": {"xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}}, "df": 4}}}}}}}, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.read_pitch": {"tf": 1.4142135623730951}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 6}}}}, "y": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.read_lib_version": {"tf": 1}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.teach": {"tf": 1.7320508075688772}, "xgolib.XGO.teach_arm": {"tf": 1.7320508075688772}}, "df": 2, "s": {"docs": {"xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}}, "df": 2}}}}}, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGOorder": {"tf": 1}, "xgolib.conver2u8": {"tf": 2.6457513110645907}, "xgolib.conver2float": {"tf": 2.6457513110645907}}, "df": 3}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.search": {"tf": 2}, "xgolib.conver2u8": {"tf": 1.4142135623730951}, "xgolib.conver2float": {"tf": 1.4142135623730951}, "xgolib.Byte2Float": {"tf": 1.4142135623730951}, "xgolib.Byte2Short": {"tf": 1.4142135623730951}, "xgolib.XGO.translation": {"tf": 2}, "xgolib.XGO.attitude": {"tf": 2}, "xgolib.XGO.leg": {"tf": 1.4142135623730951}, "xgolib.XGO.motor": {"tf": 1.4142135623730951}, "xgolib.XGO.periodic_rot": {"tf": 2}, "xgolib.XGO.periodic_tran": {"tf": 2}, "xgolib.XGO.read_motor": {"tf": 1.4142135623730951}, "xgolib.XGO.read_imu": {"tf": 1.4142135623730951}, "xgolib.XGO.unpack_imu": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_led": {"tf": 1.4142135623730951}}, "df": 15}}, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.Byte2Float": {"tf": 1}}, "df": 1}}}}, "b": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.read_lib_version": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.rider_led": {"tf": 1}}, "df": 1}}}}}, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1.4142135623730951}}, "df": 2, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.left": {"tf": 1}}, "df": 1}}}}}}, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 6}}}}, "g": {"docs": {"xgolib.XGO.leg": {"tf": 2.23606797749979}, "xgolib.XGO.unload_motor": {"tf": 2}, "xgolib.XGO.load_motor": {"tf": 2}}, "df": 3, "s": {"docs": {"xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}}, "df": 4}}, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.read_battery": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_battery": {"tf": 1.4142135623730951}}, "df": 2}}}, "d": {"docs": {"xgolib.XGO.rider_led": {"tf": 1.4142135623730951}}, "df": 1}}, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}}, "df": 2}}}, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}}}}}}, "r": {"docs": {"xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1.7320508075688772}}, "df": 3, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGOorder": {"tf": 1}, "xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 3}}}, "w": {"docs": {"xgolib.XGO.unpack_imu": {"tf": 1}}, "df": 1, "d": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}}, "df": 2}}}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 26}}}}, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.arm_polar": {"tf": 1}}, "df": 1}}}}}, "o": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGOorder": {"tf": 1}, "xgolib.changePara": {"tf": 1.4142135623730951}, "xgolib.XGO.__init__": {"tf": 1.4142135623730951}, "xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y": {"tf": 1.4142135623730951}, "xgolib.XGO.turn": {"tf": 1.4142135623730951}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 56}}}, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.turn": {"tf": 1}}, "df": 1}}, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.turn": {"tf": 1.4142135623730951}, "xgolib.XGO.periodic_rot": {"tf": 1.7320508075688772}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}}, "df": 4}}, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.turn": {"tf": 1}}, "df": 1}}}}}}, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.read_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_periodic_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 9}}}, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.conver2u8": {"tf": 1}}, "df": 1, "s": {"docs": {"xgolib.search": {"tf": 1}, "xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1.4142135623730951}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 21}}}}}, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.reset": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}}, "df": 3}}}}, "p": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 3}}}}}}}}}}, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}}}}}, "a": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 2, "s": {"docs": {"xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 14}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.teach": {"tf": 1.7320508075688772}, "xgolib.XGO.teach_arm": {"tf": 1.7320508075688772}}, "df": 2, "s": {"docs": {"xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}}, "df": 2}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}}, "df": 2}}}}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 5}}}}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1.4142135623730951}}, "df": 2, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.right": {"tf": 1}}, "df": 1}}}}}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_reset": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 20}}}}, "g": {"docs": {}, "df": 0, "b": {"docs": {"xgolib.XGO.rider_led": {"tf": 1}}, "df": 1}}}, "o": {"docs": {}, "df": 0, "f": {"docs": {"xgolib.XGOorder": {"tf": 1}, "xgolib.search": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.move": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y": {"tf": 1.4142135623730951}, "xgolib.XGO.turn": {"tf": 1.4142135623730951}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1.7320508075688772}, "xgolib.XGO.attitude": {"tf": 1.7320508075688772}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 2.23606797749979}, "xgolib.XGO.motor": {"tf": 1.4142135623730951}, "xgolib.XGO.unload_motor": {"tf": 1.4142135623730951}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1.4142135623730951}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 2.23606797749979}, "xgolib.XGO.periodic_tran": {"tf": 2.23606797749979}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1.7320508075688772}, "xgolib.XGO.read_battery": {"tf": 1}, "xgolib.XGO.read_firmware": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.read_lib_version": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1.7320508075688772}, "xgolib.XGO.arm_polar": {"tf": 1.7320508075688772}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_turn": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_reset_odom": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_periodic_z": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_battery": {"tf": 1}, "xgolib.XGO.rider_read_firmware": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1.7320508075688772}}, "df": 70, "f": {"docs": {"xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}}, "df": 4}}, "t": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.search": {"tf": 1}}, "df": 1}}}}}}}}, "r": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}, "xgolib.changePara": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.move": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1.7320508075688772}, "xgolib.XGO.attitude": {"tf": 1.7320508075688772}, "xgolib.XGO.leg": {"tf": 1.4142135623730951}, "xgolib.XGO.motor": {"tf": 2.23606797749979}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1.7320508075688772}, "xgolib.XGO.periodic_tran": {"tf": 1.7320508075688772}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1.4142135623730951}, "xgolib.XGO.teach_arm": {"tf": 1.4142135623730951}, "xgolib.XGO.read_imu_int16": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1.7320508075688772}}, "df": 35, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.set_origin": {"tf": 1}}, "df": 1}}}}}, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1.7320508075688772}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1.7320508075688772}, "xgolib.XGO.move_y_by": {"tf": 1.7320508075688772}, "xgolib.XGO.turn_by": {"tf": 1.4142135623730951}, "xgolib.XGO.turn_to": {"tf": 1.4142135623730951}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 13}}}}}}}, "n": {"docs": {"xgolib.conver2float": {"tf": 1}, "xgolib.changePara": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1.4142135623730951}}, "df": 8, "e": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}, "/": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "f": {"docs": {"xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}}, "df": 4}}}}, "l": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}}}, "b": {"docs": {}, "df": 0, "j": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}}}}, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1.4142135623730951}, "xgolib.XGO.output_digital": {"tf": 1.4142135623730951}}, "df": 3}}}}}, "d": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.rider_reset_odom": {"tf": 1}}, "df": 1}}}}}}}}, "d": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGOorder": {"tf": 1}, "xgolib.XGO": {"tf": 1}}, "df": 2}, "n": {"docs": {"xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 4}}, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {"xgolib.search": {"tf": 2}, "xgolib.conver2u8": {"tf": 2}, "xgolib.conver2float": {"tf": 1.7320508075688772}, "xgolib.XGO.translation": {"tf": 1.4142135623730951}, "xgolib.XGO.attitude": {"tf": 1.4142135623730951}, "xgolib.XGO.leg": {"tf": 1.4142135623730951}, "xgolib.XGO.motor": {"tf": 1.4142135623730951}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1}, "xgolib.XGO.output_digital": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 17}}}, "e": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1.7320508075688772}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1.7320508075688772}, "xgolib.XGO.move_y_by": {"tf": 1.7320508075688772}, "xgolib.XGO.turn_by": {"tf": 1.4142135623730951}, "xgolib.XGO.turn_to": {"tf": 1.4142135623730951}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 13}}}}}}, "v": {"docs": {}, "df": 0, "/": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "m": {"0": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0}}}}}}}}, "b": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}}}}}}, "g": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}}, "df": 8}}}}}, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}}, "df": 7}}}}}, "p": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.rider_led": {"tf": 1}}, "df": 1}}}}}}}}, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.changePara": {"tf": 1}}, "df": 1}}}}}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.move": {"tf": 2}, "xgolib.XGO.translation": {"tf": 1.4142135623730951}, "xgolib.XGO.attitude": {"tf": 1.4142135623730951}, "xgolib.XGO.periodic_rot": {"tf": 1.4142135623730951}, "xgolib.XGO.periodic_tran": {"tf": 1.4142135623730951}, "xgolib.XGO.read_imu_int16": {"tf": 2}, "xgolib.XGO.rider_read_imu_int16": {"tf": 2}}, "df": 7, "s": {"docs": {"xgolib.XGO.arm": {"tf": 1}}, "df": 1}}}}}}}}, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move_by": {"tf": 1.7320508075688772}, "xgolib.XGO.move_x_by": {"tf": 1.7320508075688772}, "xgolib.XGO.move_y_by": {"tf": 1.7320508075688772}, "xgolib.XGO.arm_polar": {"tf": 1}}, "df": 4}}}}}}, "g": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.output_digital": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y": {"tf": 1.4142135623730951}, "xgolib.XGO.turn": {"tf": 1.4142135623730951}, "xgolib.XGO.move_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y_by": {"tf": 1.4142135623730951}, "xgolib.XGO.turn_by": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_turn": {"tf": 1.4142135623730951}}, "df": 9}}}}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.search": {"tf": 1.4142135623730951}, "xgolib.XGO.__init__": {"tf": 1.7320508075688772}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 17, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}}, "df": 2}}}, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.forward": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.search": {"tf": 1}}, "df": 1}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}}, "df": 2}}, "e": {"docs": {}, "df": 0, "q": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.pace": {"tf": 1}}, "df": 1}}}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.conver2u8": {"tf": 1.7320508075688772}, "xgolib.conver2float": {"tf": 2.23606797749979}, "xgolib.Byte2Float": {"tf": 1.7320508075688772}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y": {"tf": 1.4142135623730951}, "xgolib.XGO.turn": {"tf": 1.4142135623730951}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.turnleft": {"tf": 1}, "xgolib.XGO.turnright": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 2.23606797749979}, "xgolib.XGO.move_x_by": {"tf": 2}, "xgolib.XGO.move_y_by": {"tf": 2}, "xgolib.XGO.turn_by": {"tf": 2}, "xgolib.XGO.turn_to": {"tf": 1.7320508075688772}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1}, "xgolib.XGO.read_pitch": {"tf": 1}, "xgolib.XGO.read_yaw": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1.4142135623730951}, "xgolib.XGO.arm_polar": {"tf": 1.4142135623730951}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_turn": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_roll": {"tf": 1}, "xgolib.XGO.rider_periodic_z": {"tf": 1}, "xgolib.XGO.rider_read_roll": {"tf": 1}, "xgolib.XGO.rider_read_pitch": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1}}, "df": 44}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 3}}}, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}}, "df": 4}}}}}, "i": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.read_firmware": {"tf": 1.4142135623730951}, "xgolib.XGO.upgrade": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_firmware": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_upgrade": {"tf": 1.4142135623730951}}, "df": 4}}}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}}, "df": 2, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.upgrade": {"tf": 1}, "xgolib.XGO.rider_upgrade": {"tf": 1}}, "df": 2}}}}}}}}, "a": {"docs": {"xgolib.search": {"tf": 1.4142135623730951}, "xgolib.conver2u8": {"tf": 1.7320508075688772}, "xgolib.conver2float": {"tf": 2}, "xgolib.Byte2Float": {"tf": 1.7320508075688772}, "xgolib.Byte2Short": {"tf": 1.7320508075688772}, "xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1.7320508075688772}, "xgolib.XGO.move_x_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y_by": {"tf": 1.4142135623730951}, "xgolib.XGO.turn_by": {"tf": 1.4142135623730951}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1.4142135623730951}, "xgolib.XGO.attitude": {"tf": 1.4142135623730951}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1.4142135623730951}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1.4142135623730951}, "xgolib.XGO.periodic_tran": {"tf": 1.4142135623730951}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.teach": {"tf": 1.7320508075688772}, "xgolib.XGO.teach_arm": {"tf": 1.7320508075688772}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1.4142135623730951}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 31, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.conver2u8": {"tf": 1.4142135623730951}}, "df": 1}}}, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.action": {"tf": 2.23606797749979}, "xgolib.XGO.rider_action": {"tf": 2.23606797749979}}, "df": 2}}}}, "c": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.read_imu": {"tf": 1.7320508075688772}, "xgolib.XGO.unpack_imu": {"tf": 1.7320508075688772}}, "df": 2}}}}}}}}}}}, "s": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1.4142135623730951}, "xgolib.XGO.set_origin": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1.4142135623730951}}, "df": 5, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "i": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1.4142135623730951}}, "df": 1}}}}, "n": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 21, "d": {"docs": {"xgolib.XGO": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}}, "df": 8}, "g": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.turn_by": {"tf": 1.4142135623730951}, "xgolib.XGO.turn_to": {"tf": 1.7320508075688772}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.read_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.read_pitch": {"tf": 1.4142135623730951}, "xgolib.XGO.read_yaw": {"tf": 1.4142135623730951}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_pitch": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_yaw": {"tf": 1.4142135623730951}}, "df": 11, "s": {"docs": {"xgolib.XGO.read_motor": {"tf": 1.4142135623730951}}, "df": 1}}}, "u": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}}, "df": 2}}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.output_analog": {"tf": 1.4142135623730951}}, "df": 1}}}}}, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}}, "df": 6}, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y": {"tf": 1.4142135623730951}, "xgolib.XGO.move_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x_by": {"tf": 1.7320508075688772}, "xgolib.XGO.move_y_by": {"tf": 1.7320508075688772}, "xgolib.XGO.rider_move_x": {"tf": 1.4142135623730951}}, "df": 6}}}, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.btRename": {"tf": 1}}, "df": 1}}}}}}}}}, "p": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {"xgolib.XGO.btRename": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}}, "x": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y": {"tf": 1.4142135623730951}, "xgolib.XGO.move_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x_by": {"tf": 1.7320508075688772}, "xgolib.XGO.move_y_by": {"tf": 1.7320508075688772}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1.4142135623730951}}, "df": 7, "/": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "x": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 4}}}}}}}}, "f": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}}, "df": 5}}}}, "b": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}}, "df": 1}}}}}}}, "m": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}}, "df": 2}}}}}, "d": {"docs": {}, "df": 0, "j": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1}, "xgolib.XGO.rider_roll": {"tf": 1}}, "df": 5}, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.attitude": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.attitude": {"tf": 1.7320508075688772}}, "df": 1}}}}}}}, "r": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.XGO.arm": {"tf": 2.6457513110645907}, "xgolib.XGO.arm_polar": {"tf": 2.6457513110645907}, "xgolib.XGO.arm_mode": {"tf": 1.4142135623730951}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1.4142135623730951}}, "df": 5}, "e": {"docs": {"xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}}, "df": 2}}}, "e": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.search": {"tf": 1.7320508075688772}}, "df": 1, "s": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2}}}}}}}, "n": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1.4142135623730951}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 5, "i": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}}, "df": 2}}}}, "a": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}}}}}}, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "x": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}}, "df": 1}}}, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.turn_to": {"tf": 1}}, "df": 1}}}}, "f": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1.4142135623730951}, "xgolib.XGO.arm_polar": {"tf": 1}}, "df": 3}}}}}}}, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.rider_led": {"tf": 1}}, "df": 1}}}}, "w": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.search": {"tf": 1.4142135623730951}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.turn": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}, "xgolib.XGO.rider_turn": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 7}}}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 5}}}, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.action": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_action": {"tf": 1.4142135623730951}}, "df": 2}}, "l": {"docs": {}, "df": 0, "k": {"docs": {"xgolib.XGO.gait_type": {"tf": 1.4142135623730951}}, "df": 1}}}}, "c": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}}, "df": 4}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}}, "df": 3}}}}}}, "t": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}}, "df": 4}}}, "s": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}}}}, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}}, "df": 2, "s": {"docs": {"xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}}, "df": 5}}}}}}, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "p": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.conver2float": {"tf": 1.4142135623730951}}, "df": 1}}}}}}}}}}}, "m": {"3": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1}, "docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO": {"tf": 1}, "xgolib.XGO.__init__": {"tf": 1.4142135623730951}}, "df": 2}}}}}}}}}}, "p": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO": {"tf": 1}}, "df": 1}}}}, "l": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}}}}, "b": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.move_by": {"tf": 1}}, "df": 1}}}}}}}}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.arm": {"tf": 1.4142135623730951}}, "df": 1, "s": {"docs": {"xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}}, "df": 2}}}}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.rider_led": {"tf": 1.7320508075688772}}, "df": 1}}}}, "h": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.changePara": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}}, "df": 2}}}}, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1.7320508075688772}, "xgolib.XGO.btRename": {"tf": 1.7320508075688772}}, "df": 2}}}}}}}}}, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "b": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO.calibration": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_calibration": {"tf": 1.4142135623730951}}, "df": 2}}}}}}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGO.claw": {"tf": 1.7320508075688772}}, "df": 1}}}, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.set_origin": {"tf": 1}}, "df": 1}}}}}}}, "b": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}}, "df": 1, "t": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.conver2u8": {"tf": 1.4142135623730951}, "xgolib.conver2float": {"tf": 1.4142135623730951}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}}, "df": 4, "s": {"docs": {"xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}}, "df": 2}}}}, "e": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.conver2u8": {"tf": 1}}, "df": 1}}}, "t": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.XGO": {"tf": 1}}, "df": 1}}}}}, "f": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 2}}}}}, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.conver2float": {"tf": 1}, "xgolib.changePara": {"tf": 1}}, "df": 2}}}, "u": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.__init__": {"tf": 1.4142135623730951}}, "df": 1}}, "c": {"docs": {}, "df": 0, "k": {"docs": {"xgolib.XGO.teach": {"tf": 1.7320508075688772}, "xgolib.XGO.teach_arm": {"tf": 1.7320508075688772}}, "df": 2, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO.back": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "t": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.read_battery": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_battery": {"tf": 1.4142135623730951}}, "df": 2}}}}}, "l": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.rider_balance_roll": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.Byte2Short": {"tf": 1}}, "df": 1}, "t": {"docs": {"xgolib.XGO.read_imu_int16": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1.4142135623730951}}, "df": 2}}, "o": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.__init__": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 3}}, "d": {"docs": {}, "df": 0, "y": {"docs": {"xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 4}}}, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1.4142135623730951}, "xgolib.XGO.btRename": {"tf": 1.4142135623730951}}, "df": 2}}}}}}}}}, "v": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.conver2u8": {"tf": 1.7320508075688772}, "xgolib.conver2float": {"tf": 1.4142135623730951}, "xgolib.Byte2Float": {"tf": 1}, "xgolib.Byte2Short": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.output_analog": {"tf": 1.4142135623730951}, "xgolib.XGO.output_digital": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 17, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1}, "xgolib.XGO.perform": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.calibration": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.arm_mode": {"tf": 1}, "xgolib.XGO.claw": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}, "xgolib.XGO.arm_speed": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1}, "xgolib.XGO.rider_perform": {"tf": 1}, "xgolib.XGO.rider_calibration": {"tf": 1}}, "df": 26}}}}}, "s": {"docs": {"xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_led": {"tf": 1}}, "df": 7}}}}}, "e": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.changePara": {"tf": 1.7320508075688772}, "xgolib.XGO.__init__": {"tf": 1.4142135623730951}, "xgolib.XGO.read_firmware": {"tf": 1.4142135623730951}, "xgolib.XGO.read_lib_version": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_firmware": {"tf": 1.4142135623730951}}, "df": 5}}}}, "b": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.__init__": {"tf": 1.4142135623730951}}, "df": 1}}}}, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.rider_periodic_z": {"tf": 1.4142135623730951}}, "df": 1}}}}}}, "l": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.move_by": {"tf": 1}}, "df": 1}}}, "y": {"docs": {"xgolib.XGO.move_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}}, "df": 5}}}}}}}, "x": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}}, "df": 2}, "y": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}}, "df": 2, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}}, "df": 2}}}}, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "x": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}, "xgolib.XGO.turn_to": {"tf": 1}, "xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 5}}}}}, "c": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO": {"tf": 1}}, "df": 1}}}}}, "t": {"docs": {}, "df": 0, "c": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}}, "df": 4}}}, "k": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "s": {"docs": {"xgolib.XGO.action": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.rider_action": {"tf": 1}}, "df": 3}}}, "r": {"docs": {}, "df": 0, "k": {"docs": {"xgolib.XGO.mark_time": {"tf": 1.4142135623730951}}, "df": 1, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.mark_time": {"tf": 1}}, "df": 1}}}}}}, "i": {"docs": {}, "df": 0, "n": {"docs": {"xgolib.conver2u8": {"tf": 1.4142135623730951}, "xgolib.conver2float": {"tf": 1}}, "df": 2, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "m": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1.4142135623730951}}, "df": 6}}}}, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1}}, "df": 5}}}}}, "d": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.moveToMid": {"tf": 1}}, "df": 1}}}}}, "o": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}}, "df": 3, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.stop": {"tf": 1}, "xgolib.XGO.move": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y": {"tf": 1.4142135623730951}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_x_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y_by": {"tf": 1.4142135623730951}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.set_move_mintime": {"tf": 1.4142135623730951}, "xgolib.XGO.arm": {"tf": 1}, "xgolib.XGO.arm_polar": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_periodic_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_periodic_z": {"tf": 1.4142135623730951}}, "df": 19}}}}, "s": {"docs": {"xgolib.XGO.move": {"tf": 1}, "xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.forward": {"tf": 1}, "xgolib.XGO.back": {"tf": 1}, "xgolib.XGO.left": {"tf": 1}, "xgolib.XGO.right": {"tf": 1}, "xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.moveToMid": {"tf": 1}, "xgolib.XGO.move_to": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}}, "df": 13}}, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {"xgolib.XGO.move_x": {"tf": 1}, "xgolib.XGO.move_y": {"tf": 1}, "xgolib.XGO.rider_move_x": {"tf": 1}}, "df": 3}}}}, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.motor": {"tf": 1}}, "df": 1}}, "t": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "r": {"docs": {"xgolib.XGO.motor": {"tf": 2}, "xgolib.XGO.motor_speed": {"tf": 1}}, "df": 2, "s": {"docs": {"xgolib.XGO.motor": {"tf": 1}, "xgolib.XGO.unload_motor": {"tf": 1}, "xgolib.XGO.unload_allmotor": {"tf": 1}, "xgolib.XGO.load_motor": {"tf": 1}, "xgolib.XGO.load_allmotor": {"tf": 1}, "xgolib.XGO.motor_speed": {"tf": 1}, "xgolib.XGO.read_motor": {"tf": 1.4142135623730951}}, "df": 7}}}}, "d": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.pace": {"tf": 1.4142135623730951}, "xgolib.XGO.gait_type": {"tf": 1}, "xgolib.XGO.imu": {"tf": 1.4142135623730951}, "xgolib.XGO.perform": {"tf": 2}, "xgolib.XGO.arm_mode": {"tf": 2}, "xgolib.XGO.teach": {"tf": 1}, "xgolib.XGO.teach_arm": {"tf": 1}, "xgolib.XGO.rider_balance_roll": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_perform": {"tf": 2}}, "df": 9}}}, "e": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "s": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.read_imu": {"tf": 1}}, "df": 1}}}}}}}}, "n": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "n": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "f": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.unpack_imu": {"tf": 1}}, "df": 1}}}}}}}}}}, "n": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "v": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.conver2u8": {"tf": 1}, "xgolib.conver2float": {"tf": 1}}, "df": 2}}}}}}, "e": {"docs": {}, "df": 0, "d": {"docs": {"xgolib.XGO": {"tf": 1}}, "df": 1}}, "w": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}}, "o": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "l": {"docs": {"xgolib.XGO.pace": {"tf": 1}}, "df": 1}}}}, "t": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2}, "n": {"docs": {"xgolib.XGO.bt_rename": {"tf": 1}, "xgolib.XGO.btRename": {"tf": 1}}, "df": 2, "e": {"docs": {"xgolib.XGO.read_imu_int16": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1.4142135623730951}}, "df": 2}}}, "a": {"docs": {}, "df": 0, "m": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.bt_rename": {"tf": 2}, "xgolib.XGO.btRename": {"tf": 2}}, "df": 2}}}}, "y": {"docs": {"xgolib.XGO.move": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y": {"tf": 1.4142135623730951}, "xgolib.XGO.move_by": {"tf": 1.4142135623730951}, "xgolib.XGO.move_y_by": {"tf": 1.7320508075688772}, "xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.attitude": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.periodic_rot": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.read_imu": {"tf": 1.4142135623730951}, "xgolib.XGO.unpack_imu": {"tf": 1.4142135623730951}}, "df": 11, "o": {"docs": {}, "df": 0, "u": {"docs": {"xgolib.XGO": {"tf": 1}}, "df": 1}}, "a": {"docs": {}, "df": 0, "w": {"docs": {"xgolib.XGO.read_yaw": {"tf": 1.4142135623730951}, "xgolib.XGO.read_imu": {"tf": 1}, "xgolib.XGO.read_imu_int16": {"tf": 1}, "xgolib.XGO.unpack_imu": {"tf": 1}, "xgolib.XGO.rider_read_yaw": {"tf": 1.4142135623730951}, "xgolib.XGO.rider_read_imu_int16": {"tf": 1}}, "df": 6}}}, "g": {"docs": {"xgolib.XGO.__init__": {"tf": 1}}, "df": 1, "a": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.gait_type": {"tf": 1.4142135623730951}}, "df": 1}}}, "y": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "o": {"docs": {"xgolib.XGO.read_imu": {"tf": 1.7320508075688772}, "xgolib.XGO.unpack_imu": {"tf": 1.7320508075688772}}, "df": 2}}}}, "k": {"docs": {"xgolib.XGO.move_by": {"tf": 1}, "xgolib.XGO.move_x_by": {"tf": 1}, "xgolib.XGO.move_y_by": {"tf": 1}, "xgolib.XGO.turn_by": {"tf": 1}}, "df": 4}, "z": {"docs": {"xgolib.XGO.translation": {"tf": 1}, "xgolib.XGO.leg": {"tf": 1}, "xgolib.XGO.periodic_tran": {"tf": 1}, "xgolib.XGO.arm": {"tf": 2}, "xgolib.XGO.read_imu": {"tf": 1.4142135623730951}, "xgolib.XGO.unpack_imu": {"tf": 1.4142135623730951}}, "df": 6}, "h": {"docs": {}, "df": 0, "e": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {}, "df": 0, "t": {"docs": {"xgolib.XGO.mark_time": {"tf": 1}, "xgolib.XGO.rider_height": {"tf": 1.4142135623730951}}, "df": 2}}}}}, "i": {"docs": {}, "df": 0, "g": {"docs": {}, "df": 0, "h": {"docs": {"xgolib.XGO.pace": {"tf": 1}, "xgolib.XGO.gait_type": {"tf": 1}}, "df": 2}}}, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "d": {"docs": {}, "df": 0, "w": {"docs": {}, "df": 0, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "e": {"docs": {"xgolib.XGO.rider_led": {"tf": 1}}, "df": 1}}}}}}}}}}}, "pipeline": ["trimmer"], "_isPrebuiltIndex": true}; + + // mirrored in build-search-index.js (part 1) + // Also split on html tags. this is a cheap heuristic, but good enough. + elasticlunr.tokenizer.setSeperator(/[\s\-.;&_'"=,()]+|<[^>]*>/); + + let searchIndex; + if (docs._isPrebuiltIndex) { + console.info("using precompiled search index"); + searchIndex = elasticlunr.Index.load(docs); + } else { + console.time("building search index"); + // mirrored in build-search-index.js (part 2) + searchIndex = elasticlunr(function () { + this.pipeline.remove(elasticlunr.stemmer); + this.pipeline.remove(elasticlunr.stopWordFilter); + this.addField("qualname"); + this.addField("fullname"); + this.addField("annotation"); + this.addField("default_value"); + this.addField("signature"); + this.addField("bases"); + this.addField("doc"); + this.setRef("fullname"); + }); + for (let doc of docs) { + searchIndex.addDoc(doc); + } + console.timeEnd("building search index"); + } + + return (term) => searchIndex.search(term, { + fields: { + qualname: {boost: 4}, + fullname: {boost: 2}, + annotation: {boost: 2}, + default_value: {boost: 2}, + signature: {boost: 2}, + bases: {boost: 2}, + doc: {boost: 1}, + }, + expand: true + }); +})(); \ No newline at end of file diff --git a/docs/xgolib/xgolib.html b/docs/xgolib/xgolib.html new file mode 100644 index 0000000..3e1c691 --- /dev/null +++ b/docs/xgolib/xgolib.html @@ -0,0 +1,7160 @@ + + + + + + + xgolib API documentation + + + + + + + + + +
+
+

+xgolib

+ + + + + + +
   1import serial
+   2import struct
+   3import time
+   4import math
+   5
+   6__version__ = '1.5'
+   7__last_modified__ = '2024/12/18'
+   8
+   9"""
+  10XGOorder is used to store the command address and corresponding data.
+  11"""
+  12
+  13XGOorder = {
+  14    "BATTERY": [0x01, 100],
+  15    "PERFORM": [0x03, 0],
+  16    "CALIBRATION": [0x04, 0],
+  17    "UPGRADE": [0x05, 0],
+  18    "SET_ORIGIN": [0x06, 1],
+  19    "FIRMWARE_VERSION": [0x07],
+  20    "GAIT_TYPE": [0x09, 0x00],
+  21    "BT_NAME": [0x13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+  22    "UNLOAD_MOTOR": [0x20, 0],
+  23    "LOAD_MOTOR": [0x20, 0],
+  24    "VX": [0x30, 128],
+  25    "VY": [0x31, 128],
+  26    "VYAW": [0x32, 128],
+  27    "TRANSLATION": [0x33, 0, 0, 0],
+  28    "ATTITUDE": [0x36, 0, 0, 0],
+  29    "PERIODIC_ROT": [0x39, 0, 0, 0],
+  30    "MarkTime": [0x3C, 0],
+  31    "MOVE_MODE": [0x3D, 0],
+  32    "ACTION": [0x3E, 0],
+  33    "MOVE_TO": [0x3F, 0, 0],
+  34    "PERIODIC_TRAN": [0x80, 0, 0, 0],
+  35    "MOTOR_ANGLE": [0x50, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],
+  36    "MOTOR_SPEED": [0x5C, 1],
+  37    "MOVE_TO_MID": [0x5F, 1],
+  38    "LEG_POS": [0x40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+  39    "IMU": [0x61, 0],
+  40    "ROLL": [0x62, 0],
+  41    "PITCH": [0x63, 0],
+  42    "TEACH_RECORD": [0x21, 0],
+  43    "TEACH_PLAY": [0x22, 0],
+  44    "TEACH_ARM_RECORD": [0x23, 0],
+  45    "TEACH_ARM_PLAY": [0x24, 0],
+  46    "YAW": [0x64, 0],
+  47    "CLAW": [0x71, 0],
+  48    "ARM_MODE": [0x72, 0],
+  49    "ARM_X": [0x73, 0],
+  50    "ARM_Z": [0x74, 0],
+  51    "ARM_SPEED": [0x75, 0],
+  52    "ARM_THETA": [0x76, 0],
+  53    "ARM_R": [0x77, 0],
+  54    "OUTPUT_ANALOG": [0x90, 0],
+  55    "OUTPUT_DIGITAL": [0x91, 0],
+  56    "LED_COLOR": [0x69, 0, 0, 0]
+  57}
+  58
+  59"""
+  60XGOparam is used to store the parameter limit range of the robot dog.
+  61"""
+  62XGOparam = {}
+  63
+  64def search(data, list):
+  65    """
+  66    Searches for a specific data element within a list.
+  67
+  68    Parameters:
+  69        data: The data element to search for.
+  70        list: The list to search within.
+  71
+  72    Returns:
+  73        int: The index (position + 1) of the data element in the list if found, otherwise -1.
+  74    """
+  75    for i in range(len(list)):
+  76        if data == list[i]:
+  77            return i + 1
+  78    return -1
+  79
+  80def conver2u8(data, limit, min_value=0):
+  81    """
+  82    Converts the actual parameters to single byte data from 0 to 255.
+  83
+  84    Parameters:
+  85        data (float): The actual parameter value.
+  86        limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit].
+  87        min_value (int, optional): The minimum value to return if the data is below the limit. Defaults to 0.
+  88
+  89    Returns:
+  90        int: The converted single byte data (0-255).
+  91    """
+  92    max_value = 0xff
+  93    if not isinstance(limit, list):
+  94        limit = [-limit, limit]
+  95    if data >= limit[1]:
+  96        return max_value
+  97    elif data <= limit[0]:
+  98        return min_value
+  99    else:
+ 100        return int(255 / (limit[1] - limit[0]) * (data - limit[0]))
+ 101
+ 102def conver2float(data, limit):
+ 103    """
+ 104    Converts a single byte data (0-255) to its corresponding float value based on the provided limit.
+ 105
+ 106    Parameters:
+ 107        data (int): The single byte data (0-255).
+ 108        limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit].
+ 109
+ 110    Returns:
+ 111        float: The corresponding float value.
+ 112    """
+ 113    if not isinstance(limit, list):
+ 114        return (data - 128.0) / 255.0 * limit
+ 115    else:
+ 116        return data / 255.0 * (limit[1] - limit[0]) + limit[0]
+ 117
+ 118def Byte2Float(rawdata):
+ 119    """
+ 120    Converts a 4-byte sequence (in little-endian format) to a float.
+ 121
+ 122    Parameters:
+ 123        rawdata (list): A list containing 4 bytes.
+ 124
+ 125    Returns:
+ 126        float: The converted float value.
+ 127    """
+ 128    a = bytearray()
+ 129    a.append(rawdata[3])
+ 130    a.append(rawdata[2])
+ 131    a.append(rawdata[1])
+ 132    a.append(rawdata[0])
+ 133    return struct.unpack("!f", a)[0]
+ 134
+ 135def Byte2Short(rawdata):
+ 136    """
+ 137    Converts a 2-byte sequence (in big-endian format) to a signed short integer.
+ 138
+ 139    Parameters:
+ 140        rawdata (list): A list containing 2 bytes.
+ 141
+ 142    Returns:
+ 143        int: The converted signed short integer value.
+ 144    """
+ 145    a = bytearray()
+ 146    a.append(rawdata[0])
+ 147    a.append(rawdata[1])
+ 148    return struct.unpack('>h', a)[0]
+ 149
+ 150def changePara(version):
+ 151    """
+ 152    Changes the XGOparam dictionary based on the robot version.
+ 153
+ 154    Parameters:
+ 155        version (str): The robot version ('xgomini', 'xgolite', or 'xgorider').
+ 156    """
+ 157    global XGOparam
+ 158    if version == 'xgomini':
+ 159        XGOparam = {
+ 160            "TRANSLATION_LIMIT": [35, 19.5, [75, 120]],  # X Y Z translation range
+ 161            "ATTITUDE_LIMIT": [20, 22, 16],  # Roll Pitch Yaw attitude range
+ 162            "LEG_LIMIT": [35, 18, [75, 115]],  # Leg length range
+ 163            "MOTOR_LIMIT": [[-73, 57], [-66, 93], [-31, 31], [-65, 65], [-85, 50], [-75, 90]],  # Lower, middle, upper servo range
+ 164            "PERIOD_LIMIT": [[1.5, 8]],
+ 165            "MARK_TIME_LIMIT": [10, 35],  # Mark time height range
+ 166            "VX_LIMIT": 25,  # X speed range
+ 167            "VY_LIMIT": 18,  # Y speed range
+ 168            "VYAW_LIMIT": 100,  # Rotation speed range
+ 169            "ARM_LIMIT": [[-80, 155], [-95, 155], [70, 270], [80, 140]],
+ 170            "ActionTime": {
+ 171                1: 3, 2: 3, 3: 5, 4: 5, 5: 4, 6: 4, 7: 4, 8: 4, 9: 4, 10: 7,
+ 172                11: 7, 12: 5, 13: 7, 14: 10, 15: 6, 16: 6, 17: 4, 18: 6, 19: 10, 20: 9,
+ 173                21: 8, 22: 7, 23: 6, 24: 7, 128: 10, 129: 10, 130: 10, 255: 1}
+ 174        }
+ 175    elif version == 'xgolite':
+ 176        XGOparam = {
+ 177            "TRANSLATION_LIMIT": [25, 18, [60, 110]],
+ 178            "ATTITUDE_LIMIT": [20, 10, 12],
+ 179            "LEG_LIMIT": [25, 18, [60, 110]],
+ 180            "MOTOR_LIMIT": [[-70, 50], [-70, 90], [-30, 30], [-65, 65], [-115, 70], [-85, 100]],
+ 181            "PERIOD_LIMIT": [[1.5, 8]],
+ 182            "MARK_TIME_LIMIT": [10, 25],
+ 183            "VX_LIMIT": 25,
+ 184            "VY_LIMIT": 18,
+ 185            "VYAW_LIMIT": 100,
+ 186            "ARM_LIMIT": [[-80, 155], [-95, 155], [70, 270], [80, 140]],
+ 187            "ActionTime": {
+ 188                1: 3, 2: 3, 3: 5, 4: 5, 5: 4, 6: 4, 7: 4, 8: 4, 9: 4, 10: 7,
+ 189                11: 7, 12: 5, 13: 7, 14: 10, 15: 6, 16: 6, 17: 4, 18: 6, 19: 10, 20: 9,
+ 190                21: 8, 22: 7, 23: 6, 24: 7, 128: 10, 129: 10, 130: 10, 255: 1}
+ 191        }
+ 192    elif version == "xgorider":
+ 193        XGOparam = {
+ 194            "TRANSLATION_LIMIT": [1, 1, [60, 120]],
+ 195            "ATTITUDE_LIMIT": [17, 1, 1],
+ 196            "LEG_LIMIT": [1, 1, [60, 120]],
+ 197            "MOTOR_LIMIT": [[-1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, 1]],
+ 198            "PERIOD_LIMIT": [[1, 2]],
+ 199            "MARK_TIME_LIMIT": [-1, 1],
+ 200            "VX_LIMIT": 1.5,
+ 201            "VY_LIMIT": 1.0,
+ 202            "VYAW_LIMIT": 360,
+ 203            "ARM_LIMIT": [[-1, 1], [-1, 1], [-1, 1], [-1, 1]],
+ 204            "ActionTime": {
+ 205                1: 3, 2: 3, 3: 5, 4: 5, 5: 4, 6: 4, 7: 4, 8: 4, 9: 4, 10: 7,
+ 206                11: 7, 12: 5, 13: 7, 14: 10, 15: 6, 16: 6, 17: 4, 18: 6, 19: 10, 20: 9,
+ 207                21: 8, 22: 7, 23: 6, 24: 7, 128: 10, 129: 10, 130: 10, 255: 1}
+ 208        }
+ 209
+ 210class XGO():
+ 211    """
+ 212    When instantiating XGO, you need to specify the serial communication interface between the upper computer and the machine dog.
+ 213    """
+ 214
+ 215    def __init__(self, port, baud=115200, version="xgomini", verbose=False):
+ 216        """
+ 217        Initializes the XGO robot object.
+ 218
+ 219        Parameters:
+ 220            port (str): The serial port to use for communication (e.g., '/dev/ttyACM0', 'COM3').
+ 221            baud (int, optional): The baud rate for serial communication. Defaults to 115200.
+ 222            version (string, optional): Specifies the version of the XGO robot. Accepts 'xgomini', 'xgolite', or 'xgorider'. Defaults to 'xgomini'.
+ 223            verbose (bool, optional): Enables verbose output for debugging. Defaults to False.
+ 224        """
+ 225        self.verbose = verbose
+ 226        self.ser = serial.Serial("/dev/ttyAMA0", baud, timeout=0.5)
+ 227        self.ser.flushOutput()
+ 228        self.ser.flushInput()
+ 229        self.port = port
+ 230        self.rx_FLAG = 0
+ 231        self.rx_COUNT = 0
+ 232        self.rx_ADDR = 0
+ 233        self.rx_LEN = 0
+ 234        self.rx_data = bytearray(50)
+ 235        time.sleep(0.25)
+ 236        self.version = self.read_firmware()
+ 237        if self.version[0] == 'M':
+ 238            changePara('xgomini')
+ 239        elif self.version[0] == 'L':
+ 240            changePara('xgolite')
+ 241        elif self.version[0] == 'R':
+ 242            changePara('xgorider')
+ 243        else:
+ 244            changePara('xgomini')
+ 245            print("ERROR!Can't read firmware version!")
+ 246        self.mintime = 0.65
+ 247        self.reset()
+ 248        self.init_yaw = self.read_yaw()
+ 249        time.sleep(1)
+ 250        pass
+ 251
+ 252    def __send(self, key, index=1, len=1):
+ 253        """
+ 254        Sends a command to the XGO robot.
+ 255
+ 256        Parameters:
+ 257            key (str): The command key (e.g., "VX", "VY", "TRANSLATION").
+ 258            index (int, optional): The starting index for the data within the XGOorder dictionary. Defaults to 1.
+ 259            len (int, optional): The number of data elements to send. Defaults to 1.
+ 260        """
+ 261        mode = 0x01
+ 262        order = XGOorder[key][0] + index - 1
+ 263        value = []
+ 264        value_sum = 0
+ 265        for i in range(0, len):
+ 266            value.append(XGOorder[key][index + i])
+ 267            value_sum = value_sum + XGOorder[key][index + i]
+ 268        sum_data = ((len + 0x08) + mode + order + value_sum) % 256
+ 269        sum_data = 255 - sum_data
+ 270        tx = [0x55, 0x00, (len + 0x08), mode, order]
+ 271        tx.extend(value)
+ 272        tx.extend([sum_data, 0x00, 0xAA])
+ 273        self.ser.write(tx)
+ 274        if self.verbose:
+ 275            print("tx_data: ", tx)
+ 276
+ 277    def __read(self, addr, read_len=1):
+ 278        """
+ 279        Sends a read request to the XGO robot.
+ 280
+ 281        Parameters:
+ 282            addr (int): The address to read from.
+ 283            read_len (int, optional): The number of bytes to read. Defaults to 1.
+ 284        """
+ 285        self.ser.flushInput()
+ 286        mode = 0x02
+ 287        sum_data = (0x09 + mode + addr + read_len) % 256
+ 288        sum_data = 255 - sum_data
+ 289        tx = [0x55, 0x00, 0x09, mode, addr, read_len, sum_data, 0x00, 0xAA]
+ 290        self.ser.flushInput()
+ 291        self.ser.write(tx)
+ 292        if self.verbose:
+ 293            print("tx_data: ", tx)
+ 294
+ 295    def __change_baud(self, baud):
+ 296        """
+ 297        Changes the baud rate of the serial connection.
+ 298
+ 299        Parameters:
+ 300            baud (int): The new baud rate.
+ 301        """
+ 302        self.ser.flush()
+ 303        self.ser.close()
+ 304        self.ser = serial.Serial(self.port, baud, timeout=0.5)
+ 305
+ 306    def stop(self):
+ 307        """
+ 308        Stops all movement of the XGO robot.
+ 309        """
+ 310        self.move_x(0)
+ 311        self.move_y(0)
+ 312        self.mark_time(0)
+ 313        self.turn(0)
+ 314
+ 315    def move(self, direction, step):
+ 316        """
+ 317        Moves the XGO robot in a specified direction.
+ 318
+ 319        Parameters:
+ 320            direction (str): The direction of movement ('x', 'X', 'y', or 'Y').
+ 321            step (float): The step size or speed of the movement.
+ 322
+ 323        Raises:
+ 324            ValueError: If an invalid direction is provided.
+ 325        """
+ 326        if direction in ['x', 'X']:
+ 327            self.move_x(step)
+ 328        elif direction in ['y', 'Y']:
+ 329            self.move_y(step)
+ 330        else:
+ 331            print("ERROR!Invalid direction!")
+ 332
+ 333    def move_x(self, step, runtime=0):
+ 334        """
+ 335        Moves the XGO robot along the x-axis.
+ 336
+ 337        Parameters:
+ 338            step (float): The step size or speed of the movement along the x-axis.
+ 339            runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.
+ 340        """
+ 341        XGOorder["VX"][1] = conver2u8(step, XGOparam["VX_LIMIT"])
+ 342        self.__send("VX")
+ 343        if runtime:
+ 344            time.sleep(runtime)
+ 345            XGOorder["VX"][1] = conver2u8(0, XGOparam["VX_LIMIT"])
+ 346            self.__send("VX")
+ 347
+ 348    def move_y(self, step, runtime=0):
+ 349        """
+ 350        Moves the XGO robot along the y-axis.
+ 351
+ 352        Parameters:
+ 353            step (float): The step size or speed of the movement along the y-axis.
+ 354            runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.
+ 355        """
+ 356        XGOorder["VY"][1] = conver2u8(step, XGOparam["VY_LIMIT"])
+ 357        self.__send("VY")
+ 358        if runtime:
+ 359            time.sleep(runtime)
+ 360            XGOorder["VY"][1] = conver2u8(0, XGOparam["VY_LIMIT"])
+ 361            self.__send("VY")
+ 362
+ 363    def turn(self, step, runtime=0):
+ 364        """
+ 365        Rotates the XGO robot.
+ 366
+ 367        Parameters:
+ 368            step (float): The step size or speed of the rotation.
+ 369            runtime (float, optional): The duration of the rotation in seconds. If provided, the robot will stop rotating after this duration. Defaults to 0.
+ 370        """
+ 371        XGOorder["VYAW"][1] = conver2u8(step, XGOparam["VYAW_LIMIT"])
+ 372        self.__send("VYAW")
+ 373        if runtime:
+ 374            time.sleep(runtime)
+ 375            XGOorder["VYAW"][1] = conver2u8(0, XGOparam["VYAW_LIMIT"])
+ 376            self.__send("VYAW")
+ 377
+ 378    def forward(self, step):
+ 379        """
+ 380        Moves the XGO robot forward.
+ 381
+ 382        Parameters:
+ 383            step (float): The step size or speed of the forward movement.
+ 384        """
+ 385        self.move_x(abs(step))
+ 386
+ 387    def back(self, step):
+ 388        """
+ 389        Moves the XGO robot backward.
+ 390
+ 391        Parameters:
+ 392            step (float): The step size or speed of the backward movement.
+ 393        """
+ 394        self.move_x(-abs(step))
+ 395
+ 396    def left(self, step):
+ 397        """
+ 398        Moves the XGO robot to the left.
+ 399
+ 400        Parameters:
+ 401            step (float): The step size or speed of the leftward movement.
+ 402        """
+ 403        self.move_y(abs(step))
+ 404
+ 405    def right(self, step):
+ 406        """
+ 407        Moves the XGO robot to the right.
+ 408
+ 409        Parameters:
+ 410            step (float): The step size or speed of the rightward movement.
+ 411        """
+ 412        self.move_y(-abs(step))
+ 413
+ 414    def turnleft(self, step):
+ 415        """
+ 416        Turns the XGO robot to the left.
+ 417
+ 418        Parameters:
+ 419            step (float): The step size or speed of the left turn.
+ 420        """
+ 421        self.turn(abs(step))
+ 422
+ 423    def turnright(self, step):
+ 424        """
+ 425        Turns the XGO robot to the right.
+ 426
+ 427        Parameters:
+ 428            step (float): The step size or speed of the right turn.
+ 429        """
+ 430        self.turn(-abs(step))
+ 431
+ 432    def move_by(self, distance, vx, vy, k, mintime):
+ 433        """
+ 434        Moves the XGO robot a specific distance using a combination of x and y velocities.
+ 435
+ 436        Parameters:
+ 437            distance (float): The distance to move.
+ 438            vx (float): The velocity along the x-axis.
+ 439            vy (float): The velocity along the y-axis.
+ 440            k (float): A scaling factor for the movement duration.
+ 441            mintime (float): The minimum duration of the movement.
+ 442        """
+ 443        runtime = k * abs(distance) + mintime
+ 444        self.move_x(math.copysign(vx, distance))
+ 445        self.move_y(math.copysign(vy, distance))
+ 446        time.sleep(runtime)
+ 447        self.move_x(0)
+ 448        self.move_y(0)
+ 449        time.sleep(0.2)
+ 450
+ 451    def move_x_by(self, distance, vx=18, k=0.035, mintime=0.55):
+ 452        """
+ 453        Moves the XGO robot a specific distance along the x-axis.
+ 454
+ 455        Parameters:
+ 456            distance (float): The distance to move along the x-axis.
+ 457            vx (float, optional): The velocity along the x-axis. Defaults to 18.
+ 458            k (float, optional): A scaling factor for the movement duration. Defaults to 0.035.
+ 459            mintime (float, optional): The minimum duration of the movement. Defaults to 0.55.
+ 460        """
+ 461        self.move_by(distance, vx, 0, k, mintime)
+ 462        pass
+ 463
+ 464    def move_y_by(self, distance, vy=18, k=0.0373, mintime=0.5):
+ 465        """
+ 466        Moves the XGO robot a specific distance along the y-axis.
+ 467
+ 468        Parameters:
+ 469            distance (float): The distance to move along the y-axis.
+ 470            vy (float, optional): The velocity along the y-axis. Defaults to 18.
+ 471            k (float, optional): A scaling factor for the movement duration. Defaults to 0.0373.
+ 472            mintime (float, optional): The minimum duration of the movement. Defaults to 0.5.
+ 473        """
+ 474        self.move_by(distance, 0, vy, k, mintime)
+ 475        pass
+ 476
+ 477    def turn_by(self, theta, mintime, vyaw=16, k=0.08):
+ 478        """
+ 479        Turns the XGO robot by a specific angle.
+ 480
+ 481        Parameters:
+ 482            theta (float): The angle to turn (in degrees).
+ 483            mintime (float): The minimum duration of the turn.
+ 484            vyaw (float, optional): The angular velocity. Defaults to 16.
+ 485            k (float, optional): A scaling factor for the turn duration. Defaults to 0.08.
+ 486        """
+ 487        runtime = abs(theta) * k + mintime
+ 488        self.turn(math.copysign(vyaw, theta))
+ 489        time.sleep(runtime)
+ 490        self.turn(0)
+ 491        pass
+ 492
+ 493    def turn_to(self, theta, vyaw=60, emax=10):
+ 494        """
+ 495        Turns the XGO robot to a specific absolute angle.
+ 496
+ 497        Parameters:
+ 498            theta (float): The target angle (in degrees).
+ 499            vyaw (float, optional): The angular velocity. Defaults to 60.
+ 500            emax (float, optional): The maximum error tolerance for the angle. Defaults to 10.
+ 501        """
+ 502        cur_yaw = self.read_yaw()
+ 503        des_yaw = self.init_yaw + theta
+ 504        while abs(des_yaw - cur_yaw) >= emax:
+ 505            self.turn(math.copysign(vyaw, des_yaw - cur_yaw))
+ 506            cur_yaw = self.read_yaw()
+ 507        self.turn(0)
+ 508        time.sleep(0.2)
+ 509        pass
+ 510
+ 511    def __translation(self, direction, data):
+ 512        """
+ 513        Translates the XGO robot's body along a specified axis.
+ 514
+ 515        Parameters:
+ 516            direction (str): The axis of translation ('x', 'y', or 'z').
+ 517            data (float): The translation amount.
+ 518        """
+ 519        index = search(direction, ['x', 'y', 'z'])
+ 520        if index == -1:
+ 521            print("ERROR!Direction must be 'x', 'y' or 'z'")
+ 522            return
+ 523        XGOorder["TRANSLATION"][index] = conver2u8(data, XGOparam["TRANSLATION_LIMIT"][index - 1])
+ 524        self.__send("TRANSLATION", index)
+ 525
+ 526    def translation(self, direction, data):
+ 527        """
+ 528        Translates the XGO robot's body.
+ 529
+ 530        Parameters:
+ 531            direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these).
+ 532            data (float or list): The translation amount(s).
+ 533
+ 534        Raises:
+ 535            ValueError: If the length of direction and data don't match when using a list.
+ 536        """
+ 537        if isinstance(direction, list):
+ 538            if len(direction) != len(data):
+ 539                print("ERROR!The length of direction and data don't match!")
+ 540                return
+ 541            for i in range(len(data)):
+ 542                self.__translation(direction[i], data[i])
+ 543        else:
+ 544            self.__translation(direction, data)
+ 545
+ 546    def __attitude(self, direction, data):
+ 547        """
+ 548        Adjusts the XGO robot's body attitude along a specified axis.
+ 549
+ 550        Parameters:
+ 551            direction (str): The axis of attitude adjustment ('r' for roll, 'p' for pitch, or 'y' for yaw).
+ 552            data (float): The attitude adjustment amount.
+ 553        """
+ 554        index = search(direction, ['r', 'p', 'y'])
+ 555        if index == -1:
+ 556            print("ERROR!Direction must be 'r', 'p' or 'y'")
+ 557            return
+ 558        XGOorder["ATTITUDE"][index] = conver2u8(data, XGOparam["ATTITUDE_LIMIT"][index - 1])
+ 559        self.__send("ATTITUDE", index)
+ 560
+ 561    def attitude(self, direction, data):
+ 562        """
+ 563        Adjusts the XGO robot's body attitude.
+ 564
+ 565        Parameters:
+ 566            direction (str or list): The axis/axes of attitude adjustment ('r', 'p', 'y', or a list of these).
+ 567            data (float or list): The attitude adjustment amount(s).
+ 568
+ 569        Raises:
+ 570            ValueError: If the length of direction and data don't match when using a list.
+ 571        """
+ 572        if isinstance(direction, list):
+ 573            if len(direction) != len(data):
+ 574                print("ERROR!The length of direction and data don't match!")
+ 575                return
+ 576            for i in range(len(data)):
+ 577                self.__attitude(direction[i], data[i])
+ 578        else:
+ 579            self.__attitude(direction, data)
+ 580
+ 581    def action(self, action_id, wait=False):
+ 582        """
+ 583        Makes the XGO robot perform a predefined action.
+ 584
+ 585        Parameters:
+ 586            action_id (int): The ID of the action to perform (1-255).
+ 587            wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.
+ 588
+ 589        Raises:
+ 590            ValueError: If an invalid action ID is provided.
+ 591        """
+ 592        if action_id <= 0 or action_id > 255:
+ 593            print("ERROR!Illegal Action ID!")
+ 594            return
+ 595        XGOorder["ACTION"][1] = action_id
+ 596        self.__send("ACTION")
+ 597        if wait:
+ 598            st = XGOparam["ActionTime"].get(action_id)
+ 599            if st:
+ 600                time.sleep(st)
+ 601
+ 602    def reset(self):
+ 603        """
+ 604        Resets the XGO robot to its initial state.
+ 605        """
+ 606        self.action(255)
+ 607        time.sleep(1)
+ 608
+ 609    def leg(self, leg_id, data):
+ 610        """
+ 611        Controls the three-axis movement of a single leg of the XGO robot.
+ 612
+ 613        Parameters:
+ 614            leg_id (int): The ID of the leg to control (1, 2, 3, or 4).
+ 615            data (list): A list of three float values representing the x, y, and z coordinates of the leg's end effector.
+ 616
+ 617        Raises:
+ 618            ValueError: If an invalid leg ID or data length is provided.
+ 619        """
+ 620        value = [0, 0, 0]
+ 621        if leg_id not in [1, 2, 3, 4]:
+ 622            print("Error!Illegal Index!")
+ 623            return
+ 624        if len(data) != 3:
+ 625            message = "Error!Illegal Value!"
+ 626            return
+ 627        for i in range(3):
+ 628            try:
+ 629                value[i] = conver2u8(data[i], XGOparam["LEG_LIMIT"][i])
+ 630            except:
+ 631                print("Error!Illegal Value!")
+ 632        for i in range(3):
+ 633            index = 3 * (leg_id - 1) + i + 1
+ 634            XGOorder["LEG_POS"][index] = value[i]
+ 635            self.__send("LEG_POS", index)
+ 636
+ 637    def __motor(self, index, data):
+ 638        """
+ 639        Controls a single motor of the XGO robot.
+ 640
+ 641        Parameters:
+ 642            index (int): The index of the motor to control (1-15).
+ 643            data (float): The target angle for the motor.
+ 644        """
+ 645        if index < 13:
+ 646            XGOorder["MOTOR_ANGLE"][index] = conver2u8(data, XGOparam["MOTOR_LIMIT"][(index - 1) % 3])
+ 647        elif index == 13:
+ 648            self.claw(conver2u8(data, XGOparam["MOTOR_LIMIT"][3]))
+ 649            return
+ 650        else:
+ 651            XGOorder["MOTOR_ANGLE"][index] = conver2u8(data, XGOparam["MOTOR_LIMIT"][index - 10])
+ 652        self.__send("MOTOR_ANGLE", index)
+ 653
+ 654    def motor(self, motor_id, data):
+ 655        """
+ 656        Controls one or more motors of the XGO robot.
+ 657
+ 658        Parameters:
+ 659            motor_id (int or list): The ID(s) of the motor(s) to control (11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, or 53).
+ 660            data (float or list): The target angle(s) for the motor(s).
+ 661
+ 662        Raises:
+ 663            ValueError: If an invalid motor ID or data length is provided.
+ 664        """
+ 665        MOTOR_ID = [11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, 53]
+ 666
+ 667        if isinstance(motor_id, list):
+ 668            if len(motor_id) != len(data):
+ 669                print("Error!Length Mismatching!")
+ 670                return
+ 671            index = []
+ 672            for i in range(len(motor_id)):
+ 673                temp_index = search(motor_id[i], MOTOR_ID)
+ 674                if temp_index == -1:
+ 675                    print("Error!Illegal Index!")
+ 676                    return
+ 677                index.append(temp_index)
+ 678            for i in range(len(index)):
+ 679                self.__motor(index[i], data[i])
+ 680        else:
+ 681            index = search(motor_id, MOTOR_ID)
+ 682            self.__motor(index, data)
+ 683
+ 684    def unload_motor(self, leg_id):
+ 685        """
+ 686        Unloads the motors of a specified leg.
+ 687
+ 688        Parameters:
+ 689            leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).
+ 690
+ 691        Raises:
+ 692            ValueError: If an invalid leg ID is provided.
+ 693        """
+ 694        if leg_id not in [1, 2, 3, 4, 5]:
+ 695            print('ERROR!leg_id must be 1, 2, 3 ,4 or 5')
+ 696            return
+ 697        XGOorder["UNLOAD_MOTOR"][1] = 0x10 + leg_id
+ 698        self.__send("UNLOAD_MOTOR")
+ 699
+ 700    def unload_allmotor(self):
+ 701        """
+ 702        Unloads all motors of the XGO robot.
+ 703        """
+ 704        XGOorder["UNLOAD_MOTOR"][1] = 0x01
+ 705        self.__send("UNLOAD_MOTOR")
+ 706
+ 707    def load_motor(self, leg_id):
+ 708        """
+ 709        Loads the motors of a specified leg.
+ 710
+ 711        Parameters:
+ 712            leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).
+ 713
+ 714        Raises:
+ 715            ValueError: If an invalid leg ID is provided.
+ 716        """
+ 717        if leg_id not in [1, 2, 3, 4, 5]:
+ 718            print('ERROR!leg_id must be 1, 2, 3 ,4 or 5')
+ 719            return
+ 720        XGOorder["LOAD_MOTOR"][1] = 0x20 + leg_id
+ 721        self.__send("LOAD_MOTOR")
+ 722
+ 723    def load_allmotor(self):
+ 724        """
+ 725        Loads all motors of the XGO robot.
+ 726        """
+ 727        XGOorder["LOAD_MOTOR"][1] = 0x00
+ 728        self.__send("LOAD_MOTOR")
+ 729
+ 730    def __periodic_rot(self, direction, period):
+ 731        """
+ 732        Initiates periodic rotation of the XGO robot's body along a specified axis.
+ 733
+ 734        Parameters:
+ 735            direction (str): The axis of rotation ('r' for roll, 'p' for pitch, or 'y' for yaw).
+ 736            period (float): The period of rotation.
+ 737        """
+ 738        index = search(direction, ['r', 'p', 'y'])
+ 739        if index == -1:
+ 740            print("ERROR!Direction must be 'r', 'p' or 'y'")
+ 741            return
+ 742        if period == 0:
+ 743            XGOorder["PERIODIC_ROT"][index] = 0
+ 744        else:
+ 745            XGOorder["PERIODIC_ROT"][index] = conver2u8(period, XGOparam["PERIOD_LIMIT"][0], min_value=1)
+ 746        self.__send("PERIODIC_ROT", index)
+ 747
+ 748    def periodic_rot(self, direction, period):
+ 749        """
+ 750        Initiates periodic rotation of the XGO robot's body.
+ 751
+ 752        Parameters:
+ 753            direction (str or list): The axis/axes of rotation ('r', 'p', 'y', or a list of these).
+ 754            period (float or list): The period(s) of rotation.
+ 755
+ 756        Raises:
+ 757            ValueError: If the length of direction and period don't match when using a list.
+ 758        """
+ 759        if (isinstance(direction, list)):
+ 760            if (len(direction) != len(period)):
+ 761                print("ERROR!The length of direction and data don't match!")
+ 762                return
+ 763            for i in range(len(period)):
+ 764                self.__periodic_rot(direction[i], period[i])
+ 765        else:
+ 766            self.__periodic_rot(direction, period)
+ 767
+ 768    def __periodic_tran(self, direction, period):
+ 769        """
+ 770        Initiates periodic translation of the XGO robot's body along a specified axis.
+ 771
+ 772        Parameters:
+ 773            direction (str): The axis of translation ('x', 'y', or 'z').
+ 774            period (float): The period of translation.
+ 775        """
+ 776        index = search(direction, ['x', 'y', 'z'])
+ 777        if index == -1:
+ 778            print("ERROR!Direction must be 'x', 'y' or 'z'")
+ 779            return
+ 780        if period == 0:
+ 781            XGOorder["PERIODIC_TRAN"][index] = 0
+ 782        else:
+ 783            XGOorder["PERIODIC_TRAN"][index] = conver2u8(period, XGOparam["PERIOD_LIMIT"][0], min_value=1)
+ 784        self.__send("PERIODIC_TRAN", index)
+ 785
+ 786    def periodic_tran(self, direction, period):
+ 787        """
+ 788        Initiates periodic translation of the XGO robot's body.
+ 789
+ 790        Parameters:
+ 791            direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these).
+ 792            period (float or list): The period(s) of translation.
+ 793
+ 794        Raises:
+ 795            ValueError: If the length of direction and period don't match when using a list.
+ 796        """
+ 797        if isinstance(direction, list):
+ 798            if len(direction) != len(period):
+ 799                print("ERROR!The length of direction and data don't match!")
+ 800                return
+ 801            for i in range(len(period)):
+ 802                self.__periodic_tran(direction[i], period[i])
+ 803        else:
+ 804            self.__periodic_tran(direction, period)
+ 805
+ 806    def mark_time(self, data):
+ 807        """
+ 808        Makes the XGO robot mark time (原地踏步).
+ 809
+ 810        Parameters:
+ 811            data (float): The height of the mark time movement. Set to 0 to stop marking time.
+ 812        """
+ 813        if data == 0:
+ 814            XGOorder["MarkTime"][1] = 0
+ 815        else:
+ 816            XGOorder["MarkTime"][1] = conver2u8(data, XGOparam["MARK_TIME_LIMIT"], min_value=1)
+ 817        self.__send("MarkTime")
+ 818
+ 819    def pace(self, mode):
+ 820        """
+ 821        Changes the step frequency of the XGO robot.
+ 822
+ 823        Parameters:
+ 824            mode (str): The desired pace ('normal', 'slow', or 'high').
+ 825
+ 826        Raises:
+ 827            ValueError: If an invalid pace mode is provided.
+ 828        """
+ 829        if mode == "normal":
+ 830            value = 0x00
+ 831        elif mode == "slow":
+ 832            value = 0x01
+ 833        elif mode == "high":
+ 834            value = 0x02
+ 835        else:
+ 836            print("ERROR!Illegal Value!")
+ 837            return
+ 838        XGOorder["MOVE_MODE"][1] = value
+ 839        self.__send("MOVE_MODE")
+ 840
+ 841    def gait_type(self, mode):
+ 842        """
+ 843        Sets the gait type of the XGO robot.
+ 844
+ 845        Parameters:
+ 846            mode (str): The desired gait type ('trot', 'walk', 'high_walk', or 'slow_trot').
+ 847        """
+ 848        if mode == "trot":
+ 849            value = 0x00
+ 850        elif mode == "walk":
+ 851            value = 0x01
+ 852        elif mode == "high_walk":
+ 853            value = 0x02
+ 854        elif mode == "slow_trot":
+ 855            value = 0x03
+ 856        XGOorder["GAIT_TYPE"][1] = value
+ 857        self.__send("GAIT_TYPE")
+ 858
+ 859    def imu(self, mode):
+ 860        """
+ 861        Turns on/off the self-stabilization of the XGO robot.
+ 862
+ 863        Parameters:
+ 864            mode (int): 1 to turn on self-stabilization, 0 to turn it off.
+ 865
+ 866        Raises:
+ 867            ValueError: If an invalid mode value is provided.
+ 868        """
+ 869        if mode != 0 and mode != 1:
+ 870            print("ERROR!Illegal Value!")
+ 871            return
+ 872        XGOorder["IMU"][1] = mode
+ 873        self.__send("IMU")
+ 874
+ 875    def perform(self, mode):
+ 876        """
+ 877        Turns on/off the XGO robot's performance mode (循环做动作状态).
+ 878
+ 879        Parameters:
+ 880            mode (int): 1 to turn on performance mode, 0 to turn it off.
+ 881
+ 882        Raises:
+ 883            ValueError: If an invalid mode value is provided.
+ 884        """
+ 885        if mode != 0 and mode != 1:
+ 886            print("ERROR!Illegal Value!")
+ 887            return
+ 888        XGOorder["PERFORM"][1] = mode
+ 889        self.__send("PERFORM")
+ 890
+ 891    def motor_speed(self, speed):
+ 892        """
+ 893        Adjusts the rotation speed of the motors.
+ 894
+ 895        Parameters:
+ 896            speed (int): The desired motor speed (1-255).
+ 897
+ 898        Raises:
+ 899            ValueError: If an invalid speed value is provided.
+ 900        """
+ 901        if speed < 0 or speed > 255:
+ 902            print("ERROR!Illegal Value!The speed parameter needs to be between 0 and 255!")
+ 903            return
+ 904        if speed == 0:
+ 905            speed = 1
+ 906        XGOorder["MOTOR_SPEED"][1] = speed
+ 907        self.__send("MOTOR_SPEED")
+ 908
+ 909    def bt_rename(self, name):
+ 910        """
+ 911        Renames the Bluetooth name of the XGO robot.
+ 912
+ 913        Parameters:
+ 914            name (str): The new Bluetooth name (maximum 10 characters, ASCII only).
+ 915
+ 916        Raises:
+ 917            TypeError: If the input is not a string.
+ 918            ValueError: If the name is longer than 10 characters or contains non-ASCII characters.
+ 919        """
+ 920        if type(name) != str:
+ 921            print("ERROR!The input value must be of string type!")
+ 922            return
+ 923        len_name = len(name)
+ 924        if len_name > 10:
+ 925            print("ERROR!The length of the input string cannot be longer than 10!")
+ 926            return
+ 927        try:
+ 928            XGOorder["BT_NAME"][1:len_name + 1] = list(name.encode('ascii'))
+ 929            self.__send("BT_NAME", len=len_name)
+ 930        except:
+ 931            print("ERROR!Name only supports characters in ASCII code!")
+ 932
+ 933    def read_motor(self):
+ 934        """
+ 935        Reads the angles of all 15 motors.
+ 936
+ 937        Returns:
+ 938            list: A list of 15 float values representing the angles of the motors.
+ 939        """
+ 940        self.__read(XGOorder["MOTOR_ANGLE"][0], 15)
+ 941        angle = []
+ 942        if self.__unpack():
+ 943            for i in range(self.rx_COUNT + 1):
+ 944                if i < 12:
+ 945                    angle.append(round(conver2float(self.rx_data[i], XGOparam["MOTOR_LIMIT"][i % 3]), 2))
+ 946                else:
+ 947                    angle.append(round(conver2float(self.rx_data[i], XGOparam["MOTOR_LIMIT"][i - 9]), 2))
+ 948        return angle
+ 949
+ 950    def read_battery(self):
+ 951        """
+ 952        Reads the battery level of the XGO robot.
+ 953
+ 954        Returns:
+ 955            int: The battery level (0-100).
+ 956        """
+ 957        self.__read(XGOorder["BATTERY"][0], 1)
+ 958        battery = 0
+ 959        if self.__unpack():
+ 960            battery = int(self.rx_data[0])
+ 961        return battery
+ 962
+ 963    def read_firmware(self):
+ 964        """
+ 965        Reads the firmware version of the XGO robot.
+ 966
+ 967        Returns:
+ 968            str: The firmware version string.
+ 969        """
+ 970        self.__read(XGOorder["FIRMWARE_VERSION"][0], 10)
+ 971        firmware_version = 'Null'
+ 972        if self.__unpack():
+ 973            data = self.rx_data[0:10]
+ 974            try:
+ 975                firmware_version = data.decode("ascii").strip('\0')
+ 976            except Exception as e:
+ 977                print(e)
+ 978        return firmware_version
+ 979
+ 980    def read_roll(self):
+ 981        """
+ 982        Reads the roll angle of the XGO robot.
+ 983
+ 984        Returns:
+ 985            float: The roll angle in degrees.
+ 986        """
+ 987        self.__read(XGOorder["ROLL"][0], 4)
+ 988        roll = 0
+ 989        if self.__unpack():
+ 990            roll = Byte2Float(self.rx_data)
+ 991        return round(roll, 2)
+ 992
+ 993    def read_pitch(self):
+ 994        """
+ 995        Reads the pitch angle of the XGO robot.
+ 996
+ 997        Returns:
+ 998            float: The pitch angle in degrees.
+ 999        """
+1000        self.__read(XGOorder["PITCH"][0], 4)
+1001        pitch = 0
+1002        if self.__unpack():
+1003            pitch = Byte2Float(self.rx_data)
+1004        return round(pitch, 2)
+1005
+1006    def read_yaw(self):
+1007        """
+1008        Reads the yaw angle of the XGO robot.
+1009
+1010        Returns:
+1011            float: The yaw angle in degrees.
+1012        """
+1013        self.__read(XGOorder["YAW"][0], 4)
+1014        yaw = 0
+1015        if self.__unpack():
+1016            yaw = Byte2Float(self.rx_data)
+1017        return round(yaw, 2)
+1018
+1019    def __unpack(self, timeout=1):
+1020        """
+1021        Unpacks received data from the XGO robot.
+1022
+1023        Parameters:
+1024            timeout (float, optional): The maximum time (in seconds) to wait for a complete data packet. Defaults to 1.
+1025
+1026        Returns:
+1027            bool: True if a complete data packet was received and unpacked successfully, False otherwise.
+1028        """
+1029        t = time.time()
+1030        rx_msg = []
+1031        while time.time() - t < timeout:
+1032            n = self.ser.inWaiting()
+1033            rx_CHECK = 0
+1034            if n:
+1035                data = self.ser.read(n)
+1036                for num in data:
+1037                    rx_msg.append(num)
+1038                    if self.rx_FLAG == 0:
+1039                        if num == 0x55:
+1040                            self.rx_FLAG = 1
+1041                        else:
+1042                            self.rx_FLAG = 0
+1043
+1044                    elif self.rx_FLAG == 1:
+1045                        if num == 0x00:
+1046                            self.rx_FLAG = 2
+1047                        else:
+1048                            self.rx_FLAG = 0
+1049
+1050                    elif self.rx_FLAG == 2:
+1051                        self.rx_LEN = num
+1052                        self.rx_FLAG = 3
+1053
+1054                    elif self.rx_FLAG == 3:
+1055                        self.rx_TYPE = num
+1056                        self.rx_FLAG = 4
+1057
+1058                    elif self.rx_FLAG == 4:
+1059                        self.rx_ADDR = num
+1060                        self.rx_FLAG = 5
+1061                        self.rx_COUNT = 0
+1062
+1063                    elif self.rx_FLAG == 5:
+1064                        if self.rx_COUNT == (self.rx_LEN - 9):
+1065                            self.rx_data[self.rx_COUNT] = num
+1066                            self.rx_FLAG = 6
+1067                        elif self.rx_COUNT < self.rx_LEN - 9:
+1068                            self.rx_data[self.rx_COUNT] = num
+1069                            self.rx_COUNT = self.rx_COUNT + 1
+1070
+1071                    elif self.rx_FLAG == 6:
+1072                        for i in self.rx_data[0:(self.rx_LEN - 8)]:
+1073                            rx_CHECK = rx_CHECK + i
+1074                        rx_CHECK = 255 - (self.rx_LEN + self.rx_TYPE + self.rx_ADDR + rx_CHECK) % 256
+1075                        if num == rx_CHECK:
+1076                            self.rx_FLAG = 7
+1077                        else:
+1078                            self.rx_FLAG = 0
+1079                            self.rx_COUNT = 0
+1080                            self.rx_ADDR = 0
+1081                            self.rx_LEN = 0
+1082
+1083                    elif self.rx_FLAG == 7:
+1084                        if num == 0x00:
+1085                            self.rx_FLAG = 8
+1086                        else:
+1087                            self.rx_FLAG = 0
+1088                            self.rx_COUNT = 0
+1089                            self.rx_ADDR = 0
+1090                            self.rx_LEN = 0
+1091
+1092                    elif self.rx_FLAG == 8:
+1093                        if num == 0xAA:
+1094                            self.rx_FLAG = 0
+1095                            if self.verbose:
+1096                                print("rx_data: ", rx_msg)
+1097                            return True
+1098                        else:
+1099                            self.rx_FLAG = 0
+1100                            self.rx_COUNT = 0
+1101                            self.rx_ADDR = 0
+1102                            self.rx_LEN = 0
+1103        return False
+1104
+1105    def set_move_mintime(self, mintime):
+1106        """
+1107        Sets the minimum movement time for the XGO robot.
+1108
+1109        Parameters:
+1110            mintime (float): The minimum movement time in seconds.
+1111        """
+1112        self.mintime = mintime
+1113
+1114    def upgrade(self, filename):
+1115        """
+1116        Upgrades the firmware of the XGO robot.
+1117
+1118        Parameters:
+1119            filename (str): The path to the firmware file.
+1120        """
+1121        XGOorder["UPGRADE"][1] = 1
+1122        self.ser.flush()
+1123        self.__send("UPGRADE")
+1124        if self.__unpack(10):
+1125            if self.rx_data[0] == 0x55:
+1126                time.sleep(1)
+1127                print("Start!")
+1128                self.__send_bin(filename)
+1129            else:
+1130                print("Upgrade Response Error!")
+1131        else:
+1132            print("Upgrade Timeout!")
+1133
+1134    def read_lib_version(self):
+1135        """
+1136        Returns the version of the XGO Python library.
+1137
+1138        Returns:
+1139            str: The library version string.
+1140        """
+1141        return __version__
+1142
+1143    def __send_bin(self, filename):
+1144        """
+1145        Sends a binary file to the XGO robot for firmware upgrade. (TESTING PHASE)
+1146
+1147        Parameters:
+1148            filename (str): The path to the binary file.
+1149        """
+1150        try:
+1151            self.__change_baud(350000)
+1152            with open(filename, 'rb') as f:
+1153                file = f.read()
+1154            print("The file size is", len(file), ' bytes.')
+1155            print("The expected upgrade time is", round(len(file) / 350000 * 8 * 1.3), ' s.')
+1156            self.ser.write(file)
+1157            print("Done!")
+1158            self.__change_baud(115200)
+1159        except Exception as e:
+1160            print("Send bin file error!")
+1161            print(e)
+1162
+1163    def calibration(self, state):
+1164        """
+1165        Initiates or terminates the calibration process of the XGO robot.
+1166
+1167        Parameters:
+1168            state (str): 'start' to initiate calibration, 'end' to terminate.
+1169
+1170        Raises:
+1171            ValueError: If an invalid state is provided.
+1172        """
+1173        if state == 'start':
+1174            XGOorder["CALIBRATION"][1] = 1
+1175        elif state == 'end':
+1176            XGOorder["CALIBRATION"][1] = 0
+1177        else:
+1178            print("ERROR!")
+1179        self.__send("CALIBRATION")
+1180        return
+1181
+1182    def arm(self, arm_x, arm_z):
+1183        """
+1184        Controls the movement of the XGO robot's arm in the x and z directions.
+1185
+1186        Parameters:
+1187            arm_x (float): The x-coordinate of the arm's end effector.
+1188            arm_z (float): The z-coordinate of the arm's end effector.
+1189
+1190        Raises:
+1191            ValueError: If invalid arm_x or arm_z values are provided.
+1192        """
+1193        try:
+1194            arm_x_u8 = conver2u8(arm_x, XGOparam["ARM_LIMIT"][0])
+1195            arm_z_u8 = conver2u8(arm_z, XGOparam["ARM_LIMIT"][1])
+1196        except:
+1197            print("Error!Illegal Value!")
+1198            return
+1199        XGOorder["ARM_X"][1] = arm_x_u8
+1200        XGOorder["ARM_Z"][1] = arm_z_u8
+1201        self.__send("ARM_X")
+1202        self.__send("ARM_Z")
+1203
+1204    def arm_polar(self, arm_theta, arm_r):
+1205        """
+1206        Controls the movement of the XGO robot's arm using polar coordinates.
+1207
+1208        Parameters:
+1209            arm_theta (float): The angle (theta) of the arm.
+1210            arm_r (float): The radial distance (r) of the arm's end effector.
+1211
+1212        Raises:
+1213            ValueError: If invalid arm_theta or arm_r values are provided.
+1214        """
+1215        try:
+1216            arm_theta_u8 = conver2u8(arm_theta, XGOparam["ARM_LIMIT"][2])
+1217            arm_r_u8 = conver2u8(arm_r, XGOparam["ARM_LIMIT"][3])
+1218        except:
+1219            print("Error!Illegal Value!")
+1220            return
+1221        XGOorder["ARM_THETA"][1] = arm_theta_u8
+1222        XGOorder["ARM_R"][1] = arm_r_u8
+1223        self.__send("ARM_THETA")
+1224        self.__send("ARM_R")
+1225
+1226    def arm_mode(self, mode):
+1227        """
+1228        Sets the mode of the XGO robot's arm.
+1229
+1230        Parameters:
+1231            mode (int): The arm mode (0x00 or 0x01).
+1232
+1233        Raises:
+1234            ValueError: If an invalid mode value is provided.
+1235        """
+1236        if mode != 0x01 and mode != 0x00:
+1237            print("Error!Illegal Value!")
+1238            return
+1239        XGOorder["ARM_MODE"][1] = mode
+1240        self.__send("ARM_MODE")
+1241
+1242    def claw(self, pos):
+1243        """
+1244        Controls the position of the XGO robot's claw.
+1245
+1246        Parameters:
+1247            pos (float): The desired claw position (0-255).
+1248
+1249        Raises:
+1250            ValueError: If an invalid claw position value is provided.
+1251        """
+1252        try:
+1253            claw_pos = conver2u8(pos, [0, 255])
+1254        except:
+1255            print("Error!Illegal Value!")
+1256            return
+1257        XGOorder["CLAW"][1] = claw_pos
+1258        self.__send("CLAW")
+1259
+1260    def btRename(self, name):
+1261        """
+1262        Renames the Bluetooth name of the XGO robot (alternative implementation).
+1263
+1264        Parameters:
+1265            name (str): The new Bluetooth name (maximum 20 characters, alphanumeric only).
+1266
+1267        Raises:
+1268            TypeError: If the input is not a string.
+1269            ValueError: If the name is longer than 20 characters or contains non-alphanumeric characters.
+1270        """
+1271        length = len(name)
+1272        if not isinstance(name, str):
+1273            print("Wrong type!")
+1274            return
+1275
+1276        if length > 20:
+1277            print("The length of the name needs to be less than 20")
+1278            return
+1279
+1280        if not name.isalnum():
+1281            print("The name can only contain numbers and letters")
+1282            return
+1283
+1284        XGOorder["BT_NAME"] = [0x13]
+1285        for c in list(name):
+1286            if ord(c) > 255:
+1287                print("The name can only contain numbers and letters")
+1288                return
+1289            else:
+1290                XGOorder["BT_NAME"].append(ord(c))
+1291        print(XGOorder["BT_NAME"])
+1292        self.__send("BT_NAME", len=length)
+1293
+1294    def moveToMid(self):
+1295        """
+1296        Moves the XGO robot's legs to their middle position.
+1297        """
+1298        self.__send("MOVE_TO_MID")
+1299
+1300    def teach(self, mode, pos_id):
+1301        """
+1302        Records or plays back a taught position for the XGO robot's legs.
+1303
+1304        Parameters:
+1305            mode (str): 'record' to record a position, 'play' to play back a recorded position.
+1306            pos_id (int): The ID of the position to record or play back.
+1307        """
+1308        if mode == "play":
+1309            XGOorder["TEACH_PLAY"][1] = pos_id
+1310            self.__send("TEACH_PLAY")
+1311        if mode == "record":
+1312            XGOorder["TEACH_RECORD"][1] = pos_id
+1313            self.__send("TEACH_RECORD")
+1314        else:
+1315            return
+1316
+1317    def teach_arm(self, mode, pos_id):
+1318        """
+1319        Records or plays back a taught position for the XGO robot's arm.
+1320
+1321        Parameters:
+1322            mode (str): 'record' to record a position, 'play' to play back a recorded position.
+1323            pos_id (int): The ID of the position to record or play back.
+1324        """
+1325        if mode == "play":
+1326            XGOorder["TEACH_ARM_PLAY"][1] = pos_id
+1327            self.__send("TEACH_ARM_PLAY")
+1328        if mode == "record":
+1329            XGOorder["TEACH_ARM_RECORD"][1] = pos_id
+1330            self.__send("TEACH_ARM_RECORD")
+1331        else:
+1332            return
+1333
+1334    def arm_speed(self, speed):
+1335        """
+1336        Adjusts the rotation speed of the arm.
+1337
+1338        Parameters:
+1339            speed (int): The desired arm speed (1-255).
+1340
+1341        Raises:
+1342            ValueError: If an invalid speed value is provided.
+1343        """
+1344        if speed < 0 or speed > 255:
+1345            print("ERROR!Illegal Value!The speed parameter needs to be between 0 and 255!")
+1346            return
+1347        if speed == 0:
+1348            speed = 1
+1349        XGOorder["ARM_SPEED"][1] = speed
+1350        self.__send("ARM_SPEED")
+1351
+1352    def read_imu(self):
+1353        """
+1354        Reads IMU (Inertial Measurement Unit) data from the XGO robot.
+1355
+1356        Returns:
+1357            list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].
+1358        """
+1359        self.__read(0x65, 24)
+1360        result = []
+1361        if self.__unpack():
+1362            result = self.unpack_imu()
+1363        return result
+1364
+1365    def read_imu_int16(self, direction):
+1366        """
+1367        Reads IMU data as signed 16-bit integers for a specific direction.
+1368
+1369        Parameters:
+1370            direction (str): The direction to read ('roll', 'pitch', or 'yaw').
+1371
+1372        Returns:
+1373            int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.
+1374        """
+1375        if direction == "roll":
+1376            self.__read(0x66, 2)
+1377        elif direction == "pitch":
+1378            self.__read(0x67, 2)
+1379        elif direction == "yaw":
+1380            self.__read(0x68, 2)
+1381        else:
+1382            return None
+1383        result = []
+1384        if self.__unpack():
+1385            result = Byte2Short(self.rx_data)
+1386        return result
+1387
+1388    def unpack_imu(self):
+1389        """
+1390        Unpacks raw IMU data into meaningful values.
+1391
+1392        Returns:
+1393            list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].
+1394        """
+1395        result = []
+1396        for i in range(9):
+1397            a = bytearray()
+1398            if i < 6:
+1399                a.append(self.rx_data[2 * i + 1])
+1400                a.append(self.rx_data[2 * i])
+1401                if i < 3:
+1402                    result.append(struct.unpack("!h", a)[0] / 16384 * 9.8)
+1403                else:
+1404                    result.append(struct.unpack("!h", a)[0] / 16.4)
+1405            else:
+1406                a.append(self.rx_data[4 * i - 9])
+1407                a.append(self.rx_data[4 * i - 10])
+1408                a.append(self.rx_data[4 * i - 11])
+1409                a.append(self.rx_data[4 * i - 12])
+1410                result.append(struct.unpack("!f", a)[0] / 180 * 3.14)
+1411        return result
+1412
+1413    def set_origin(self):
+1414        """
+1415        Sets the current position of the XGO robot as the origin.
+1416        """
+1417        XGOorder["SET_ORIGIN"][1] = 1
+1418        self.__send("SET_ORIGIN")
+1419
+1420    def move_to(self, data):
+1421        """
+1422        Moves the robot to a specified position.
+1423
+1424        Parameters:
+1425            data (int): The target position value.
+1426        """
+1427        packed_data = struct.pack('>h', data)
+1428        XGOorder["MOVE_TO"][1] = packed_data[0]
+1429        XGOorder["MOVE_TO"][2] = packed_data[1]
+1430        self.__send("MOVE_TO", len=2)
+1431
+1432    def output_analog(self, data):
+1433        """
+1434        Sets the analog output value.
+1435
+1436        Parameters:
+1437            data (int): The analog output value.
+1438        """
+1439        XGOorder["OUTPUT_ANALOG"][1] = data
+1440        self.__send("OUTPUT_ANALOG")
+1441        pass
+1442
+1443    def output_digital(self, data):
+1444        """
+1445        Sets the digital output value.
+1446
+1447        Parameters:
+1448            data (int): The digital output value.
+1449        """
+1450        XGOorder["OUTPUT_DIGITAL"][1] = data
+1451        self.__send("OUTPUT_DIGITAL")
+1452        pass
+1453
+1454    ############# RIDER ################
+1455
+1456    def rider_move_x(self, speed, runtime=0):
+1457        """
+1458        Moves the XGO Rider along the x-axis.
+1459
+1460        Parameters:
+1461            speed (float): The speed of movement along the x-axis.
+1462            runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.
+1463        """
+1464        XGOorder["VX"][1] = conver2u8(speed, XGOparam["VX_LIMIT"])
+1465        self.__send("VX")
+1466        if runtime:
+1467            time.sleep(runtime)
+1468            XGOorder["VX"][1] = conver2u8(0, XGOparam["VX_LIMIT"])
+1469            self.__send("VX")
+1470
+1471    def rider_turn(self, speed, runtime=0):
+1472        """
+1473        Turns the XGO Rider.
+1474
+1475        Parameters:
+1476            speed (float): The speed of the turn.
+1477            runtime (float, optional): The duration of the turn in seconds. If provided, the robot will stop turning after this duration. Defaults to 0.
+1478        """
+1479        XGOorder["VYAW"][1] = conver2u8(speed, XGOparam["VYAW_LIMIT"])
+1480        self.__send("VYAW")
+1481        if runtime:
+1482            time.sleep(runtime)
+1483            XGOorder["VYAW"][1] = conver2u8(0, XGOparam["VYAW_LIMIT"])
+1484            self.__send("VYAW")
+1485
+1486    def rider_reset_odom(self):
+1487        """
+1488        Resets the odometry of the XGO Rider.
+1489        """
+1490        XGOorder["SET_ORIGIN"][1] = 1
+1491        self.__send("SET_ORIGIN")
+1492
+1493    def rider_action(self, action_id, wait=False):
+1494        """
+1495        Makes the XGO Rider perform a predefined action.
+1496
+1497        Parameters:
+1498            action_id (int): The ID of the action to perform (1-255).
+1499            wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.
+1500
+1501        Raises:
+1502            ValueError: If an invalid action ID is provided.
+1503        """
+1504        if action_id <= 0 or action_id > 255:
+1505            print("ERROR!Illegal Action ID!")
+1506            return
+1507        XGOorder["ACTION"][1] = action_id
+1508        self.__send("ACTION")
+1509        if wait:
+1510            st = XGOparam["ActionTime"].get(action_id)
+1511            if st:
+1512                time.sleep(st)
+1513
+1514    def rider_balance_roll(self, mode):
+1515        """
+1516        Turns on/off the roll balance of the XGO Rider.
+1517
+1518        Parameters:
+1519            mode (int): 1 to turn on roll balance, 0 to turn it off.
+1520
+1521        Raises:
+1522            ValueError: If an invalid mode value is provided.
+1523        """
+1524        if mode != 0 and mode != 1:
+1525            print("ERROR!Illegal Value!")
+1526            return
+1527        XGOorder["IMU"][1] = mode
+1528        self.__send("IMU")
+1529
+1530    def rider_perform(self, mode):
+1531        """
+1532        Turns on/off the XGO Rider's performance mode.
+1533
+1534        Parameters:
+1535            mode (int): 1 to turn on performance mode, 0 to turn it off.
+1536
+1537        Raises:
+1538            ValueError: If an invalid mode value is provided.
+1539        """
+1540        if mode != 0 and mode != 1:
+1541            print("ERROR!Illegal Value!")
+1542            return
+1543        XGOorder["PERFORM"][1] = mode
+1544        self.__send("PERFORM")
+1545
+1546    def rider_calibration(self, state):
+1547        """
+1548        Initiates or terminates the calibration process of the XGO Rider.
+1549
+1550        Parameters:
+1551            state (str): 'start' to initiate calibration, 'end' to terminate.
+1552
+1553        Raises:
+1554            ValueError: If an invalid state is provided.
+1555        """
+1556        if state == 'start':
+1557            XGOorder["CALIBRATION"][1] = 1
+1558        elif state == 'end':
+1559            XGOorder["CALIBRATION"][1] = 0
+1560        else:
+1561            print("ERROR!")
+1562        self.__send("CALIBRATION")
+1563        return
+1564
+1565    def rider_height(self, data):
+1566        """
+1567        Adjusts the height of the XGO Rider.
+1568
+1569        Parameters:
+1570            data (float): The desired height.
+1571        """
+1572        self.__translation("z", data)
+1573
+1574    def rider_roll(self, data):
+1575        """
+1576        Adjusts the roll angle of the XGO Rider.
+1577
+1578        Parameters:
+1579            data (float): The desired roll angle.
+1580        """
+1581        self.__attitude("r", data)
+1582
+1583    def rider_periodic_roll(self, period):
+1584        """
+1585        Initiates periodic roll movement of the XGO Rider.
+1586
+1587        Parameters:
+1588            period (float): The period of the roll movement.
+1589        """
+1590        self.__periodic_rot("r", period)
+1591
+1592    def rider_periodic_z(self, period):
+1593        """
+1594        Initiates periodic vertical movement of the XGO Rider.
+1595
+1596        Parameters:
+1597            period (float): The period of the vertical movement.
+1598        """
+1599        self.__periodic_tran("z", period)
+1600
+1601    def rider_read_battery(self):
+1602        """
+1603        Reads the battery level of the XGO Rider.
+1604
+1605        Returns:
+1606            int: The battery level (0-100).
+1607        """
+1608        self.__read(XGOorder["BATTERY"][0], 1)
+1609        battery = 0
+1610        if self.__unpack():
+1611            battery = int(self.rx_data[0])
+1612        return battery
+1613
+1614    def rider_read_firmware(self):
+1615        """
+1616        Reads the firmware version of the XGO Rider.
+1617
+1618        Returns:
+1619            str: The firmware version string.
+1620        """
+1621        self.__read(XGOorder["FIRMWARE_VERSION"][0], 10)
+1622        firmware_version = 'Null'
+1623        if self.__unpack():
+1624            data = self.rx_data[0:10]
+1625            try:
+1626                firmware_version = data.decode("ascii").strip('\0')
+1627            except Exception as e:
+1628                print(e)
+1629        return firmware_version
+1630
+1631    def rider_read_roll(self):
+1632        """
+1633        Reads the roll angle of the XGO Rider.
+1634
+1635        Returns:
+1636            float: The roll angle in degrees.
+1637        """
+1638        self.__read(XGOorder["ROLL"][0], 4)
+1639        roll = 0
+1640        if self.__unpack():
+1641            roll = Byte2Float(self.rx_data)
+1642        return round(roll, 2)
+1643
+1644    def rider_read_pitch(self):
+1645        """
+1646        Reads the pitch angle of the XGO Rider.
+1647
+1648        Returns:
+1649            float: The pitch angle in degrees.
+1650        """
+1651        self.__read(XGOorder["PITCH"][0], 4)
+1652        pitch = 0
+1653        if self.__unpack():
+1654            pitch = Byte2Float(self.rx_data)
+1655        return round(pitch, 2)
+1656
+1657    def rider_read_yaw(self):
+1658        """
+1659        Reads the yaw angle of the XGO Rider.
+1660
+1661        Returns:
+1662            float: The yaw angle in degrees.
+1663        """
+1664        self.__read(XGOorder["YAW"][0], 4)
+1665        yaw = 0
+1666        if self.__unpack():
+1667            yaw = Byte2Float(self.rx_data)
+1668        return round(yaw, 2)
+1669
+1670    def rider_read_imu_int16(self, direction):
+1671        """
+1672        Reads IMU data as signed 16-bit integers for a specific direction on the XGO Rider.
+1673
+1674        Parameters:
+1675            direction (str): The direction to read ('roll', 'pitch', or 'yaw').
+1676
+1677        Returns:
+1678            int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.
+1679        """
+1680        if direction == "roll":
+1681            self.__read(0x66, 2)
+1682        elif direction == "pitch":
+1683            self.__read(0x67, 2)
+1684        elif direction == "yaw":
+1685            self.__read(0x68, 2)
+1686        else:
+1687            return None
+1688        result = []
+1689        if self.__unpack():
+1690            result = Byte2Short(self.rx_data)
+1691        return result
+1692
+1693    def rider_reset(self):
+1694        """
+1695        Resets the XGO Rider.
+1696        """
+1697        return self.reset()
+1698
+1699    def rider_upgrade(self, filename):
+1700        """
+1701        Upgrades the firmware of the XGO Rider.
+1702
+1703        Parameters:
+1704            filename (str): The path to the firmware file.
+1705        """
+1706        XGOorder["UPGRADE"][1] = 1
+1707        self.ser.flush()
+1708        self.__send("UPGRADE")
+1709        if self.__unpack(10):
+1710            if self.rx_data[0] == 0x55:
+1711                time.sleep(1)
+1712                print("Start!")
+1713                self.__send_bin(filename)
+1714            else:
+1715                print("Upgrade Response Error!")
+1716        else:
+1717            print("Upgrade Timeout!")
+1718
+1719    def rider_led(self, index, color):
+1720        """
+1721        Sets the color of an LED on the XGO Rider.
+1722
+1723        Parameters:
+1724            index (int): The index of the LED (likely 1-4 depending on hardware).
+1725            color (list): A list of three integers representing the RGB color values (0-255 each).
+1726        """
+1727        XGOorder["LED_COLOR"][0] = 0x68 + index
+1728        XGOorder["LED_COLOR"][1:4] = color
+1729        self.__send("LED_COLOR", len=3)
+
+ + +
+
+
+ XGOorder = + + {'BATTERY': [1, 100], 'PERFORM': [3, 0], 'CALIBRATION': [4, 0], 'UPGRADE': [5, 0], 'SET_ORIGIN': [6, 1], 'FIRMWARE_VERSION': [7], 'GAIT_TYPE': [9, 0], 'BT_NAME': [19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'UNLOAD_MOTOR': [32, 0], 'LOAD_MOTOR': [32, 0], 'VX': [48, 128], 'VY': [49, 128], 'VYAW': [50, 128], 'TRANSLATION': [51, 0, 0, 0], 'ATTITUDE': [54, 0, 0, 0], 'PERIODIC_ROT': [57, 0, 0, 0], 'MarkTime': [60, 0], 'MOVE_MODE': [61, 0], 'ACTION': [62, 0], 'MOVE_TO': [63, 0, 0], 'PERIODIC_TRAN': [128, 0, 0, 0], 'MOTOR_ANGLE': [80, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], 'MOTOR_SPEED': [92, 1], 'MOVE_TO_MID': [95, 1], 'LEG_POS': [64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'IMU': [97, 0], 'ROLL': [98, 0], 'PITCH': [99, 0], 'TEACH_RECORD': [33, 0], 'TEACH_PLAY': [34, 0], 'TEACH_ARM_RECORD': [35, 0], 'TEACH_ARM_PLAY': [36, 0], 'YAW': [100, 0], 'CLAW': [113, 0], 'ARM_MODE': [114, 0], 'ARM_X': [115, 0], 'ARM_Z': [116, 0], 'ARM_SPEED': [117, 0], 'ARM_THETA': [118, 0], 'ARM_R': [119, 0], 'OUTPUT_ANALOG': [144, 0], 'OUTPUT_DIGITAL': [145, 0], 'LED_COLOR': [105, 0, 0, 0]} + + +
+ + +

XGOparam is used to store the parameter limit range of the robot dog.

+
+ + +
+
+
+ XGOparam = +{} + + +
+ + + + +
+ +
+ +
+ + def + conver2u8(data, limit, min_value=0): + + + +
+ +
 81def conver2u8(data, limit, min_value=0):
+ 82    """
+ 83    Converts the actual parameters to single byte data from 0 to 255.
+ 84
+ 85    Parameters:
+ 86        data (float): The actual parameter value.
+ 87        limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit].
+ 88        min_value (int, optional): The minimum value to return if the data is below the limit. Defaults to 0.
+ 89
+ 90    Returns:
+ 91        int: The converted single byte data (0-255).
+ 92    """
+ 93    max_value = 0xff
+ 94    if not isinstance(limit, list):
+ 95        limit = [-limit, limit]
+ 96    if data >= limit[1]:
+ 97        return max_value
+ 98    elif data <= limit[0]:
+ 99        return min_value
+100    else:
+101        return int(255 / (limit[1] - limit[0]) * (data - limit[0]))
+
+ + +

Converts the actual parameters to single byte data from 0 to 255.

+ +

Parameters: + data (float): The actual parameter value. + limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit]. + min_value (int, optional): The minimum value to return if the data is below the limit. Defaults to 0.

+ +

Returns: + int: The converted single byte data (0-255).

+
+ + +
+
+ +
+ + def + conver2float(data, limit): + + + +
+ +
103def conver2float(data, limit):
+104    """
+105    Converts a single byte data (0-255) to its corresponding float value based on the provided limit.
+106
+107    Parameters:
+108        data (int): The single byte data (0-255).
+109        limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit].
+110
+111    Returns:
+112        float: The corresponding float value.
+113    """
+114    if not isinstance(limit, list):
+115        return (data - 128.0) / 255.0 * limit
+116    else:
+117        return data / 255.0 * (limit[1] - limit[0]) + limit[0]
+
+ + +

Converts a single byte data (0-255) to its corresponding float value based on the provided limit.

+ +

Parameters: + data (int): The single byte data (0-255). + limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit].

+ +

Returns: + float: The corresponding float value.

+
+ + +
+
+ +
+ + def + Byte2Float(rawdata): + + + +
+ +
119def Byte2Float(rawdata):
+120    """
+121    Converts a 4-byte sequence (in little-endian format) to a float.
+122
+123    Parameters:
+124        rawdata (list): A list containing 4 bytes.
+125
+126    Returns:
+127        float: The converted float value.
+128    """
+129    a = bytearray()
+130    a.append(rawdata[3])
+131    a.append(rawdata[2])
+132    a.append(rawdata[1])
+133    a.append(rawdata[0])
+134    return struct.unpack("!f", a)[0]
+
+ + +

Converts a 4-byte sequence (in little-endian format) to a float.

+ +

Parameters: + rawdata (list): A list containing 4 bytes.

+ +

Returns: + float: The converted float value.

+
+ + +
+
+ +
+ + def + Byte2Short(rawdata): + + + +
+ +
136def Byte2Short(rawdata):
+137    """
+138    Converts a 2-byte sequence (in big-endian format) to a signed short integer.
+139
+140    Parameters:
+141        rawdata (list): A list containing 2 bytes.
+142
+143    Returns:
+144        int: The converted signed short integer value.
+145    """
+146    a = bytearray()
+147    a.append(rawdata[0])
+148    a.append(rawdata[1])
+149    return struct.unpack('>h', a)[0]
+
+ + +

Converts a 2-byte sequence (in big-endian format) to a signed short integer.

+ +

Parameters: + rawdata (list): A list containing 2 bytes.

+ +

Returns: + int: The converted signed short integer value.

+
+ + +
+
+ +
+ + def + changePara(version): + + + +
+ +
151def changePara(version):
+152    """
+153    Changes the XGOparam dictionary based on the robot version.
+154
+155    Parameters:
+156        version (str): The robot version ('xgomini', 'xgolite', or 'xgorider').
+157    """
+158    global XGOparam
+159    if version == 'xgomini':
+160        XGOparam = {
+161            "TRANSLATION_LIMIT": [35, 19.5, [75, 120]],  # X Y Z translation range
+162            "ATTITUDE_LIMIT": [20, 22, 16],  # Roll Pitch Yaw attitude range
+163            "LEG_LIMIT": [35, 18, [75, 115]],  # Leg length range
+164            "MOTOR_LIMIT": [[-73, 57], [-66, 93], [-31, 31], [-65, 65], [-85, 50], [-75, 90]],  # Lower, middle, upper servo range
+165            "PERIOD_LIMIT": [[1.5, 8]],
+166            "MARK_TIME_LIMIT": [10, 35],  # Mark time height range
+167            "VX_LIMIT": 25,  # X speed range
+168            "VY_LIMIT": 18,  # Y speed range
+169            "VYAW_LIMIT": 100,  # Rotation speed range
+170            "ARM_LIMIT": [[-80, 155], [-95, 155], [70, 270], [80, 140]],
+171            "ActionTime": {
+172                1: 3, 2: 3, 3: 5, 4: 5, 5: 4, 6: 4, 7: 4, 8: 4, 9: 4, 10: 7,
+173                11: 7, 12: 5, 13: 7, 14: 10, 15: 6, 16: 6, 17: 4, 18: 6, 19: 10, 20: 9,
+174                21: 8, 22: 7, 23: 6, 24: 7, 128: 10, 129: 10, 130: 10, 255: 1}
+175        }
+176    elif version == 'xgolite':
+177        XGOparam = {
+178            "TRANSLATION_LIMIT": [25, 18, [60, 110]],
+179            "ATTITUDE_LIMIT": [20, 10, 12],
+180            "LEG_LIMIT": [25, 18, [60, 110]],
+181            "MOTOR_LIMIT": [[-70, 50], [-70, 90], [-30, 30], [-65, 65], [-115, 70], [-85, 100]],
+182            "PERIOD_LIMIT": [[1.5, 8]],
+183            "MARK_TIME_LIMIT": [10, 25],
+184            "VX_LIMIT": 25,
+185            "VY_LIMIT": 18,
+186            "VYAW_LIMIT": 100,
+187            "ARM_LIMIT": [[-80, 155], [-95, 155], [70, 270], [80, 140]],
+188            "ActionTime": {
+189                1: 3, 2: 3, 3: 5, 4: 5, 5: 4, 6: 4, 7: 4, 8: 4, 9: 4, 10: 7,
+190                11: 7, 12: 5, 13: 7, 14: 10, 15: 6, 16: 6, 17: 4, 18: 6, 19: 10, 20: 9,
+191                21: 8, 22: 7, 23: 6, 24: 7, 128: 10, 129: 10, 130: 10, 255: 1}
+192        }
+193    elif version == "xgorider":
+194        XGOparam = {
+195            "TRANSLATION_LIMIT": [1, 1, [60, 120]],
+196            "ATTITUDE_LIMIT": [17, 1, 1],
+197            "LEG_LIMIT": [1, 1, [60, 120]],
+198            "MOTOR_LIMIT": [[-1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, 1]],
+199            "PERIOD_LIMIT": [[1, 2]],
+200            "MARK_TIME_LIMIT": [-1, 1],
+201            "VX_LIMIT": 1.5,
+202            "VY_LIMIT": 1.0,
+203            "VYAW_LIMIT": 360,
+204            "ARM_LIMIT": [[-1, 1], [-1, 1], [-1, 1], [-1, 1]],
+205            "ActionTime": {
+206                1: 3, 2: 3, 3: 5, 4: 5, 5: 4, 6: 4, 7: 4, 8: 4, 9: 4, 10: 7,
+207                11: 7, 12: 5, 13: 7, 14: 10, 15: 6, 16: 6, 17: 4, 18: 6, 19: 10, 20: 9,
+208                21: 8, 22: 7, 23: 6, 24: 7, 128: 10, 129: 10, 130: 10, 255: 1}
+209        }
+
+ + +

Changes the XGOparam dictionary based on the robot version.

+ +

Parameters: + version (str): The robot version ('xgomini', 'xgolite', or 'xgorider').

+
+ + +
+
+ +
+ + class + XGO: + + + +
+ +
 211class XGO():
+ 212    """
+ 213    When instantiating XGO, you need to specify the serial communication interface between the upper computer and the machine dog.
+ 214    """
+ 215
+ 216    def __init__(self, port, baud=115200, version="xgomini", verbose=False):
+ 217        """
+ 218        Initializes the XGO robot object.
+ 219
+ 220        Parameters:
+ 221            port (str): The serial port to use for communication (e.g., '/dev/ttyACM0', 'COM3').
+ 222            baud (int, optional): The baud rate for serial communication. Defaults to 115200.
+ 223            version (string, optional): Specifies the version of the XGO robot. Accepts 'xgomini', 'xgolite', or 'xgorider'. Defaults to 'xgomini'.
+ 224            verbose (bool, optional): Enables verbose output for debugging. Defaults to False.
+ 225        """
+ 226        self.verbose = verbose
+ 227        self.ser = serial.Serial("/dev/ttyAMA0", baud, timeout=0.5)
+ 228        self.ser.flushOutput()
+ 229        self.ser.flushInput()
+ 230        self.port = port
+ 231        self.rx_FLAG = 0
+ 232        self.rx_COUNT = 0
+ 233        self.rx_ADDR = 0
+ 234        self.rx_LEN = 0
+ 235        self.rx_data = bytearray(50)
+ 236        time.sleep(0.25)
+ 237        self.version = self.read_firmware()
+ 238        if self.version[0] == 'M':
+ 239            changePara('xgomini')
+ 240        elif self.version[0] == 'L':
+ 241            changePara('xgolite')
+ 242        elif self.version[0] == 'R':
+ 243            changePara('xgorider')
+ 244        else:
+ 245            changePara('xgomini')
+ 246            print("ERROR!Can't read firmware version!")
+ 247        self.mintime = 0.65
+ 248        self.reset()
+ 249        self.init_yaw = self.read_yaw()
+ 250        time.sleep(1)
+ 251        pass
+ 252
+ 253    def __send(self, key, index=1, len=1):
+ 254        """
+ 255        Sends a command to the XGO robot.
+ 256
+ 257        Parameters:
+ 258            key (str): The command key (e.g., "VX", "VY", "TRANSLATION").
+ 259            index (int, optional): The starting index for the data within the XGOorder dictionary. Defaults to 1.
+ 260            len (int, optional): The number of data elements to send. Defaults to 1.
+ 261        """
+ 262        mode = 0x01
+ 263        order = XGOorder[key][0] + index - 1
+ 264        value = []
+ 265        value_sum = 0
+ 266        for i in range(0, len):
+ 267            value.append(XGOorder[key][index + i])
+ 268            value_sum = value_sum + XGOorder[key][index + i]
+ 269        sum_data = ((len + 0x08) + mode + order + value_sum) % 256
+ 270        sum_data = 255 - sum_data
+ 271        tx = [0x55, 0x00, (len + 0x08), mode, order]
+ 272        tx.extend(value)
+ 273        tx.extend([sum_data, 0x00, 0xAA])
+ 274        self.ser.write(tx)
+ 275        if self.verbose:
+ 276            print("tx_data: ", tx)
+ 277
+ 278    def __read(self, addr, read_len=1):
+ 279        """
+ 280        Sends a read request to the XGO robot.
+ 281
+ 282        Parameters:
+ 283            addr (int): The address to read from.
+ 284            read_len (int, optional): The number of bytes to read. Defaults to 1.
+ 285        """
+ 286        self.ser.flushInput()
+ 287        mode = 0x02
+ 288        sum_data = (0x09 + mode + addr + read_len) % 256
+ 289        sum_data = 255 - sum_data
+ 290        tx = [0x55, 0x00, 0x09, mode, addr, read_len, sum_data, 0x00, 0xAA]
+ 291        self.ser.flushInput()
+ 292        self.ser.write(tx)
+ 293        if self.verbose:
+ 294            print("tx_data: ", tx)
+ 295
+ 296    def __change_baud(self, baud):
+ 297        """
+ 298        Changes the baud rate of the serial connection.
+ 299
+ 300        Parameters:
+ 301            baud (int): The new baud rate.
+ 302        """
+ 303        self.ser.flush()
+ 304        self.ser.close()
+ 305        self.ser = serial.Serial(self.port, baud, timeout=0.5)
+ 306
+ 307    def stop(self):
+ 308        """
+ 309        Stops all movement of the XGO robot.
+ 310        """
+ 311        self.move_x(0)
+ 312        self.move_y(0)
+ 313        self.mark_time(0)
+ 314        self.turn(0)
+ 315
+ 316    def move(self, direction, step):
+ 317        """
+ 318        Moves the XGO robot in a specified direction.
+ 319
+ 320        Parameters:
+ 321            direction (str): The direction of movement ('x', 'X', 'y', or 'Y').
+ 322            step (float): The step size or speed of the movement.
+ 323
+ 324        Raises:
+ 325            ValueError: If an invalid direction is provided.
+ 326        """
+ 327        if direction in ['x', 'X']:
+ 328            self.move_x(step)
+ 329        elif direction in ['y', 'Y']:
+ 330            self.move_y(step)
+ 331        else:
+ 332            print("ERROR!Invalid direction!")
+ 333
+ 334    def move_x(self, step, runtime=0):
+ 335        """
+ 336        Moves the XGO robot along the x-axis.
+ 337
+ 338        Parameters:
+ 339            step (float): The step size or speed of the movement along the x-axis.
+ 340            runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.
+ 341        """
+ 342        XGOorder["VX"][1] = conver2u8(step, XGOparam["VX_LIMIT"])
+ 343        self.__send("VX")
+ 344        if runtime:
+ 345            time.sleep(runtime)
+ 346            XGOorder["VX"][1] = conver2u8(0, XGOparam["VX_LIMIT"])
+ 347            self.__send("VX")
+ 348
+ 349    def move_y(self, step, runtime=0):
+ 350        """
+ 351        Moves the XGO robot along the y-axis.
+ 352
+ 353        Parameters:
+ 354            step (float): The step size or speed of the movement along the y-axis.
+ 355            runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.
+ 356        """
+ 357        XGOorder["VY"][1] = conver2u8(step, XGOparam["VY_LIMIT"])
+ 358        self.__send("VY")
+ 359        if runtime:
+ 360            time.sleep(runtime)
+ 361            XGOorder["VY"][1] = conver2u8(0, XGOparam["VY_LIMIT"])
+ 362            self.__send("VY")
+ 363
+ 364    def turn(self, step, runtime=0):
+ 365        """
+ 366        Rotates the XGO robot.
+ 367
+ 368        Parameters:
+ 369            step (float): The step size or speed of the rotation.
+ 370            runtime (float, optional): The duration of the rotation in seconds. If provided, the robot will stop rotating after this duration. Defaults to 0.
+ 371        """
+ 372        XGOorder["VYAW"][1] = conver2u8(step, XGOparam["VYAW_LIMIT"])
+ 373        self.__send("VYAW")
+ 374        if runtime:
+ 375            time.sleep(runtime)
+ 376            XGOorder["VYAW"][1] = conver2u8(0, XGOparam["VYAW_LIMIT"])
+ 377            self.__send("VYAW")
+ 378
+ 379    def forward(self, step):
+ 380        """
+ 381        Moves the XGO robot forward.
+ 382
+ 383        Parameters:
+ 384            step (float): The step size or speed of the forward movement.
+ 385        """
+ 386        self.move_x(abs(step))
+ 387
+ 388    def back(self, step):
+ 389        """
+ 390        Moves the XGO robot backward.
+ 391
+ 392        Parameters:
+ 393            step (float): The step size or speed of the backward movement.
+ 394        """
+ 395        self.move_x(-abs(step))
+ 396
+ 397    def left(self, step):
+ 398        """
+ 399        Moves the XGO robot to the left.
+ 400
+ 401        Parameters:
+ 402            step (float): The step size or speed of the leftward movement.
+ 403        """
+ 404        self.move_y(abs(step))
+ 405
+ 406    def right(self, step):
+ 407        """
+ 408        Moves the XGO robot to the right.
+ 409
+ 410        Parameters:
+ 411            step (float): The step size or speed of the rightward movement.
+ 412        """
+ 413        self.move_y(-abs(step))
+ 414
+ 415    def turnleft(self, step):
+ 416        """
+ 417        Turns the XGO robot to the left.
+ 418
+ 419        Parameters:
+ 420            step (float): The step size or speed of the left turn.
+ 421        """
+ 422        self.turn(abs(step))
+ 423
+ 424    def turnright(self, step):
+ 425        """
+ 426        Turns the XGO robot to the right.
+ 427
+ 428        Parameters:
+ 429            step (float): The step size or speed of the right turn.
+ 430        """
+ 431        self.turn(-abs(step))
+ 432
+ 433    def move_by(self, distance, vx, vy, k, mintime):
+ 434        """
+ 435        Moves the XGO robot a specific distance using a combination of x and y velocities.
+ 436
+ 437        Parameters:
+ 438            distance (float): The distance to move.
+ 439            vx (float): The velocity along the x-axis.
+ 440            vy (float): The velocity along the y-axis.
+ 441            k (float): A scaling factor for the movement duration.
+ 442            mintime (float): The minimum duration of the movement.
+ 443        """
+ 444        runtime = k * abs(distance) + mintime
+ 445        self.move_x(math.copysign(vx, distance))
+ 446        self.move_y(math.copysign(vy, distance))
+ 447        time.sleep(runtime)
+ 448        self.move_x(0)
+ 449        self.move_y(0)
+ 450        time.sleep(0.2)
+ 451
+ 452    def move_x_by(self, distance, vx=18, k=0.035, mintime=0.55):
+ 453        """
+ 454        Moves the XGO robot a specific distance along the x-axis.
+ 455
+ 456        Parameters:
+ 457            distance (float): The distance to move along the x-axis.
+ 458            vx (float, optional): The velocity along the x-axis. Defaults to 18.
+ 459            k (float, optional): A scaling factor for the movement duration. Defaults to 0.035.
+ 460            mintime (float, optional): The minimum duration of the movement. Defaults to 0.55.
+ 461        """
+ 462        self.move_by(distance, vx, 0, k, mintime)
+ 463        pass
+ 464
+ 465    def move_y_by(self, distance, vy=18, k=0.0373, mintime=0.5):
+ 466        """
+ 467        Moves the XGO robot a specific distance along the y-axis.
+ 468
+ 469        Parameters:
+ 470            distance (float): The distance to move along the y-axis.
+ 471            vy (float, optional): The velocity along the y-axis. Defaults to 18.
+ 472            k (float, optional): A scaling factor for the movement duration. Defaults to 0.0373.
+ 473            mintime (float, optional): The minimum duration of the movement. Defaults to 0.5.
+ 474        """
+ 475        self.move_by(distance, 0, vy, k, mintime)
+ 476        pass
+ 477
+ 478    def turn_by(self, theta, mintime, vyaw=16, k=0.08):
+ 479        """
+ 480        Turns the XGO robot by a specific angle.
+ 481
+ 482        Parameters:
+ 483            theta (float): The angle to turn (in degrees).
+ 484            mintime (float): The minimum duration of the turn.
+ 485            vyaw (float, optional): The angular velocity. Defaults to 16.
+ 486            k (float, optional): A scaling factor for the turn duration. Defaults to 0.08.
+ 487        """
+ 488        runtime = abs(theta) * k + mintime
+ 489        self.turn(math.copysign(vyaw, theta))
+ 490        time.sleep(runtime)
+ 491        self.turn(0)
+ 492        pass
+ 493
+ 494    def turn_to(self, theta, vyaw=60, emax=10):
+ 495        """
+ 496        Turns the XGO robot to a specific absolute angle.
+ 497
+ 498        Parameters:
+ 499            theta (float): The target angle (in degrees).
+ 500            vyaw (float, optional): The angular velocity. Defaults to 60.
+ 501            emax (float, optional): The maximum error tolerance for the angle. Defaults to 10.
+ 502        """
+ 503        cur_yaw = self.read_yaw()
+ 504        des_yaw = self.init_yaw + theta
+ 505        while abs(des_yaw - cur_yaw) >= emax:
+ 506            self.turn(math.copysign(vyaw, des_yaw - cur_yaw))
+ 507            cur_yaw = self.read_yaw()
+ 508        self.turn(0)
+ 509        time.sleep(0.2)
+ 510        pass
+ 511
+ 512    def __translation(self, direction, data):
+ 513        """
+ 514        Translates the XGO robot's body along a specified axis.
+ 515
+ 516        Parameters:
+ 517            direction (str): The axis of translation ('x', 'y', or 'z').
+ 518            data (float): The translation amount.
+ 519        """
+ 520        index = search(direction, ['x', 'y', 'z'])
+ 521        if index == -1:
+ 522            print("ERROR!Direction must be 'x', 'y' or 'z'")
+ 523            return
+ 524        XGOorder["TRANSLATION"][index] = conver2u8(data, XGOparam["TRANSLATION_LIMIT"][index - 1])
+ 525        self.__send("TRANSLATION", index)
+ 526
+ 527    def translation(self, direction, data):
+ 528        """
+ 529        Translates the XGO robot's body.
+ 530
+ 531        Parameters:
+ 532            direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these).
+ 533            data (float or list): The translation amount(s).
+ 534
+ 535        Raises:
+ 536            ValueError: If the length of direction and data don't match when using a list.
+ 537        """
+ 538        if isinstance(direction, list):
+ 539            if len(direction) != len(data):
+ 540                print("ERROR!The length of direction and data don't match!")
+ 541                return
+ 542            for i in range(len(data)):
+ 543                self.__translation(direction[i], data[i])
+ 544        else:
+ 545            self.__translation(direction, data)
+ 546
+ 547    def __attitude(self, direction, data):
+ 548        """
+ 549        Adjusts the XGO robot's body attitude along a specified axis.
+ 550
+ 551        Parameters:
+ 552            direction (str): The axis of attitude adjustment ('r' for roll, 'p' for pitch, or 'y' for yaw).
+ 553            data (float): The attitude adjustment amount.
+ 554        """
+ 555        index = search(direction, ['r', 'p', 'y'])
+ 556        if index == -1:
+ 557            print("ERROR!Direction must be 'r', 'p' or 'y'")
+ 558            return
+ 559        XGOorder["ATTITUDE"][index] = conver2u8(data, XGOparam["ATTITUDE_LIMIT"][index - 1])
+ 560        self.__send("ATTITUDE", index)
+ 561
+ 562    def attitude(self, direction, data):
+ 563        """
+ 564        Adjusts the XGO robot's body attitude.
+ 565
+ 566        Parameters:
+ 567            direction (str or list): The axis/axes of attitude adjustment ('r', 'p', 'y', or a list of these).
+ 568            data (float or list): The attitude adjustment amount(s).
+ 569
+ 570        Raises:
+ 571            ValueError: If the length of direction and data don't match when using a list.
+ 572        """
+ 573        if isinstance(direction, list):
+ 574            if len(direction) != len(data):
+ 575                print("ERROR!The length of direction and data don't match!")
+ 576                return
+ 577            for i in range(len(data)):
+ 578                self.__attitude(direction[i], data[i])
+ 579        else:
+ 580            self.__attitude(direction, data)
+ 581
+ 582    def action(self, action_id, wait=False):
+ 583        """
+ 584        Makes the XGO robot perform a predefined action.
+ 585
+ 586        Parameters:
+ 587            action_id (int): The ID of the action to perform (1-255).
+ 588            wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.
+ 589
+ 590        Raises:
+ 591            ValueError: If an invalid action ID is provided.
+ 592        """
+ 593        if action_id <= 0 or action_id > 255:
+ 594            print("ERROR!Illegal Action ID!")
+ 595            return
+ 596        XGOorder["ACTION"][1] = action_id
+ 597        self.__send("ACTION")
+ 598        if wait:
+ 599            st = XGOparam["ActionTime"].get(action_id)
+ 600            if st:
+ 601                time.sleep(st)
+ 602
+ 603    def reset(self):
+ 604        """
+ 605        Resets the XGO robot to its initial state.
+ 606        """
+ 607        self.action(255)
+ 608        time.sleep(1)
+ 609
+ 610    def leg(self, leg_id, data):
+ 611        """
+ 612        Controls the three-axis movement of a single leg of the XGO robot.
+ 613
+ 614        Parameters:
+ 615            leg_id (int): The ID of the leg to control (1, 2, 3, or 4).
+ 616            data (list): A list of three float values representing the x, y, and z coordinates of the leg's end effector.
+ 617
+ 618        Raises:
+ 619            ValueError: If an invalid leg ID or data length is provided.
+ 620        """
+ 621        value = [0, 0, 0]
+ 622        if leg_id not in [1, 2, 3, 4]:
+ 623            print("Error!Illegal Index!")
+ 624            return
+ 625        if len(data) != 3:
+ 626            message = "Error!Illegal Value!"
+ 627            return
+ 628        for i in range(3):
+ 629            try:
+ 630                value[i] = conver2u8(data[i], XGOparam["LEG_LIMIT"][i])
+ 631            except:
+ 632                print("Error!Illegal Value!")
+ 633        for i in range(3):
+ 634            index = 3 * (leg_id - 1) + i + 1
+ 635            XGOorder["LEG_POS"][index] = value[i]
+ 636            self.__send("LEG_POS", index)
+ 637
+ 638    def __motor(self, index, data):
+ 639        """
+ 640        Controls a single motor of the XGO robot.
+ 641
+ 642        Parameters:
+ 643            index (int): The index of the motor to control (1-15).
+ 644            data (float): The target angle for the motor.
+ 645        """
+ 646        if index < 13:
+ 647            XGOorder["MOTOR_ANGLE"][index] = conver2u8(data, XGOparam["MOTOR_LIMIT"][(index - 1) % 3])
+ 648        elif index == 13:
+ 649            self.claw(conver2u8(data, XGOparam["MOTOR_LIMIT"][3]))
+ 650            return
+ 651        else:
+ 652            XGOorder["MOTOR_ANGLE"][index] = conver2u8(data, XGOparam["MOTOR_LIMIT"][index - 10])
+ 653        self.__send("MOTOR_ANGLE", index)
+ 654
+ 655    def motor(self, motor_id, data):
+ 656        """
+ 657        Controls one or more motors of the XGO robot.
+ 658
+ 659        Parameters:
+ 660            motor_id (int or list): The ID(s) of the motor(s) to control (11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, or 53).
+ 661            data (float or list): The target angle(s) for the motor(s).
+ 662
+ 663        Raises:
+ 664            ValueError: If an invalid motor ID or data length is provided.
+ 665        """
+ 666        MOTOR_ID = [11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, 53]
+ 667
+ 668        if isinstance(motor_id, list):
+ 669            if len(motor_id) != len(data):
+ 670                print("Error!Length Mismatching!")
+ 671                return
+ 672            index = []
+ 673            for i in range(len(motor_id)):
+ 674                temp_index = search(motor_id[i], MOTOR_ID)
+ 675                if temp_index == -1:
+ 676                    print("Error!Illegal Index!")
+ 677                    return
+ 678                index.append(temp_index)
+ 679            for i in range(len(index)):
+ 680                self.__motor(index[i], data[i])
+ 681        else:
+ 682            index = search(motor_id, MOTOR_ID)
+ 683            self.__motor(index, data)
+ 684
+ 685    def unload_motor(self, leg_id):
+ 686        """
+ 687        Unloads the motors of a specified leg.
+ 688
+ 689        Parameters:
+ 690            leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).
+ 691
+ 692        Raises:
+ 693            ValueError: If an invalid leg ID is provided.
+ 694        """
+ 695        if leg_id not in [1, 2, 3, 4, 5]:
+ 696            print('ERROR!leg_id must be 1, 2, 3 ,4 or 5')
+ 697            return
+ 698        XGOorder["UNLOAD_MOTOR"][1] = 0x10 + leg_id
+ 699        self.__send("UNLOAD_MOTOR")
+ 700
+ 701    def unload_allmotor(self):
+ 702        """
+ 703        Unloads all motors of the XGO robot.
+ 704        """
+ 705        XGOorder["UNLOAD_MOTOR"][1] = 0x01
+ 706        self.__send("UNLOAD_MOTOR")
+ 707
+ 708    def load_motor(self, leg_id):
+ 709        """
+ 710        Loads the motors of a specified leg.
+ 711
+ 712        Parameters:
+ 713            leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).
+ 714
+ 715        Raises:
+ 716            ValueError: If an invalid leg ID is provided.
+ 717        """
+ 718        if leg_id not in [1, 2, 3, 4, 5]:
+ 719            print('ERROR!leg_id must be 1, 2, 3 ,4 or 5')
+ 720            return
+ 721        XGOorder["LOAD_MOTOR"][1] = 0x20 + leg_id
+ 722        self.__send("LOAD_MOTOR")
+ 723
+ 724    def load_allmotor(self):
+ 725        """
+ 726        Loads all motors of the XGO robot.
+ 727        """
+ 728        XGOorder["LOAD_MOTOR"][1] = 0x00
+ 729        self.__send("LOAD_MOTOR")
+ 730
+ 731    def __periodic_rot(self, direction, period):
+ 732        """
+ 733        Initiates periodic rotation of the XGO robot's body along a specified axis.
+ 734
+ 735        Parameters:
+ 736            direction (str): The axis of rotation ('r' for roll, 'p' for pitch, or 'y' for yaw).
+ 737            period (float): The period of rotation.
+ 738        """
+ 739        index = search(direction, ['r', 'p', 'y'])
+ 740        if index == -1:
+ 741            print("ERROR!Direction must be 'r', 'p' or 'y'")
+ 742            return
+ 743        if period == 0:
+ 744            XGOorder["PERIODIC_ROT"][index] = 0
+ 745        else:
+ 746            XGOorder["PERIODIC_ROT"][index] = conver2u8(period, XGOparam["PERIOD_LIMIT"][0], min_value=1)
+ 747        self.__send("PERIODIC_ROT", index)
+ 748
+ 749    def periodic_rot(self, direction, period):
+ 750        """
+ 751        Initiates periodic rotation of the XGO robot's body.
+ 752
+ 753        Parameters:
+ 754            direction (str or list): The axis/axes of rotation ('r', 'p', 'y', or a list of these).
+ 755            period (float or list): The period(s) of rotation.
+ 756
+ 757        Raises:
+ 758            ValueError: If the length of direction and period don't match when using a list.
+ 759        """
+ 760        if (isinstance(direction, list)):
+ 761            if (len(direction) != len(period)):
+ 762                print("ERROR!The length of direction and data don't match!")
+ 763                return
+ 764            for i in range(len(period)):
+ 765                self.__periodic_rot(direction[i], period[i])
+ 766        else:
+ 767            self.__periodic_rot(direction, period)
+ 768
+ 769    def __periodic_tran(self, direction, period):
+ 770        """
+ 771        Initiates periodic translation of the XGO robot's body along a specified axis.
+ 772
+ 773        Parameters:
+ 774            direction (str): The axis of translation ('x', 'y', or 'z').
+ 775            period (float): The period of translation.
+ 776        """
+ 777        index = search(direction, ['x', 'y', 'z'])
+ 778        if index == -1:
+ 779            print("ERROR!Direction must be 'x', 'y' or 'z'")
+ 780            return
+ 781        if period == 0:
+ 782            XGOorder["PERIODIC_TRAN"][index] = 0
+ 783        else:
+ 784            XGOorder["PERIODIC_TRAN"][index] = conver2u8(period, XGOparam["PERIOD_LIMIT"][0], min_value=1)
+ 785        self.__send("PERIODIC_TRAN", index)
+ 786
+ 787    def periodic_tran(self, direction, period):
+ 788        """
+ 789        Initiates periodic translation of the XGO robot's body.
+ 790
+ 791        Parameters:
+ 792            direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these).
+ 793            period (float or list): The period(s) of translation.
+ 794
+ 795        Raises:
+ 796            ValueError: If the length of direction and period don't match when using a list.
+ 797        """
+ 798        if isinstance(direction, list):
+ 799            if len(direction) != len(period):
+ 800                print("ERROR!The length of direction and data don't match!")
+ 801                return
+ 802            for i in range(len(period)):
+ 803                self.__periodic_tran(direction[i], period[i])
+ 804        else:
+ 805            self.__periodic_tran(direction, period)
+ 806
+ 807    def mark_time(self, data):
+ 808        """
+ 809        Makes the XGO robot mark time (原地踏步).
+ 810
+ 811        Parameters:
+ 812            data (float): The height of the mark time movement. Set to 0 to stop marking time.
+ 813        """
+ 814        if data == 0:
+ 815            XGOorder["MarkTime"][1] = 0
+ 816        else:
+ 817            XGOorder["MarkTime"][1] = conver2u8(data, XGOparam["MARK_TIME_LIMIT"], min_value=1)
+ 818        self.__send("MarkTime")
+ 819
+ 820    def pace(self, mode):
+ 821        """
+ 822        Changes the step frequency of the XGO robot.
+ 823
+ 824        Parameters:
+ 825            mode (str): The desired pace ('normal', 'slow', or 'high').
+ 826
+ 827        Raises:
+ 828            ValueError: If an invalid pace mode is provided.
+ 829        """
+ 830        if mode == "normal":
+ 831            value = 0x00
+ 832        elif mode == "slow":
+ 833            value = 0x01
+ 834        elif mode == "high":
+ 835            value = 0x02
+ 836        else:
+ 837            print("ERROR!Illegal Value!")
+ 838            return
+ 839        XGOorder["MOVE_MODE"][1] = value
+ 840        self.__send("MOVE_MODE")
+ 841
+ 842    def gait_type(self, mode):
+ 843        """
+ 844        Sets the gait type of the XGO robot.
+ 845
+ 846        Parameters:
+ 847            mode (str): The desired gait type ('trot', 'walk', 'high_walk', or 'slow_trot').
+ 848        """
+ 849        if mode == "trot":
+ 850            value = 0x00
+ 851        elif mode == "walk":
+ 852            value = 0x01
+ 853        elif mode == "high_walk":
+ 854            value = 0x02
+ 855        elif mode == "slow_trot":
+ 856            value = 0x03
+ 857        XGOorder["GAIT_TYPE"][1] = value
+ 858        self.__send("GAIT_TYPE")
+ 859
+ 860    def imu(self, mode):
+ 861        """
+ 862        Turns on/off the self-stabilization of the XGO robot.
+ 863
+ 864        Parameters:
+ 865            mode (int): 1 to turn on self-stabilization, 0 to turn it off.
+ 866
+ 867        Raises:
+ 868            ValueError: If an invalid mode value is provided.
+ 869        """
+ 870        if mode != 0 and mode != 1:
+ 871            print("ERROR!Illegal Value!")
+ 872            return
+ 873        XGOorder["IMU"][1] = mode
+ 874        self.__send("IMU")
+ 875
+ 876    def perform(self, mode):
+ 877        """
+ 878        Turns on/off the XGO robot's performance mode (循环做动作状态).
+ 879
+ 880        Parameters:
+ 881            mode (int): 1 to turn on performance mode, 0 to turn it off.
+ 882
+ 883        Raises:
+ 884            ValueError: If an invalid mode value is provided.
+ 885        """
+ 886        if mode != 0 and mode != 1:
+ 887            print("ERROR!Illegal Value!")
+ 888            return
+ 889        XGOorder["PERFORM"][1] = mode
+ 890        self.__send("PERFORM")
+ 891
+ 892    def motor_speed(self, speed):
+ 893        """
+ 894        Adjusts the rotation speed of the motors.
+ 895
+ 896        Parameters:
+ 897            speed (int): The desired motor speed (1-255).
+ 898
+ 899        Raises:
+ 900            ValueError: If an invalid speed value is provided.
+ 901        """
+ 902        if speed < 0 or speed > 255:
+ 903            print("ERROR!Illegal Value!The speed parameter needs to be between 0 and 255!")
+ 904            return
+ 905        if speed == 0:
+ 906            speed = 1
+ 907        XGOorder["MOTOR_SPEED"][1] = speed
+ 908        self.__send("MOTOR_SPEED")
+ 909
+ 910    def bt_rename(self, name):
+ 911        """
+ 912        Renames the Bluetooth name of the XGO robot.
+ 913
+ 914        Parameters:
+ 915            name (str): The new Bluetooth name (maximum 10 characters, ASCII only).
+ 916
+ 917        Raises:
+ 918            TypeError: If the input is not a string.
+ 919            ValueError: If the name is longer than 10 characters or contains non-ASCII characters.
+ 920        """
+ 921        if type(name) != str:
+ 922            print("ERROR!The input value must be of string type!")
+ 923            return
+ 924        len_name = len(name)
+ 925        if len_name > 10:
+ 926            print("ERROR!The length of the input string cannot be longer than 10!")
+ 927            return
+ 928        try:
+ 929            XGOorder["BT_NAME"][1:len_name + 1] = list(name.encode('ascii'))
+ 930            self.__send("BT_NAME", len=len_name)
+ 931        except:
+ 932            print("ERROR!Name only supports characters in ASCII code!")
+ 933
+ 934    def read_motor(self):
+ 935        """
+ 936        Reads the angles of all 15 motors.
+ 937
+ 938        Returns:
+ 939            list: A list of 15 float values representing the angles of the motors.
+ 940        """
+ 941        self.__read(XGOorder["MOTOR_ANGLE"][0], 15)
+ 942        angle = []
+ 943        if self.__unpack():
+ 944            for i in range(self.rx_COUNT + 1):
+ 945                if i < 12:
+ 946                    angle.append(round(conver2float(self.rx_data[i], XGOparam["MOTOR_LIMIT"][i % 3]), 2))
+ 947                else:
+ 948                    angle.append(round(conver2float(self.rx_data[i], XGOparam["MOTOR_LIMIT"][i - 9]), 2))
+ 949        return angle
+ 950
+ 951    def read_battery(self):
+ 952        """
+ 953        Reads the battery level of the XGO robot.
+ 954
+ 955        Returns:
+ 956            int: The battery level (0-100).
+ 957        """
+ 958        self.__read(XGOorder["BATTERY"][0], 1)
+ 959        battery = 0
+ 960        if self.__unpack():
+ 961            battery = int(self.rx_data[0])
+ 962        return battery
+ 963
+ 964    def read_firmware(self):
+ 965        """
+ 966        Reads the firmware version of the XGO robot.
+ 967
+ 968        Returns:
+ 969            str: The firmware version string.
+ 970        """
+ 971        self.__read(XGOorder["FIRMWARE_VERSION"][0], 10)
+ 972        firmware_version = 'Null'
+ 973        if self.__unpack():
+ 974            data = self.rx_data[0:10]
+ 975            try:
+ 976                firmware_version = data.decode("ascii").strip('\0')
+ 977            except Exception as e:
+ 978                print(e)
+ 979        return firmware_version
+ 980
+ 981    def read_roll(self):
+ 982        """
+ 983        Reads the roll angle of the XGO robot.
+ 984
+ 985        Returns:
+ 986            float: The roll angle in degrees.
+ 987        """
+ 988        self.__read(XGOorder["ROLL"][0], 4)
+ 989        roll = 0
+ 990        if self.__unpack():
+ 991            roll = Byte2Float(self.rx_data)
+ 992        return round(roll, 2)
+ 993
+ 994    def read_pitch(self):
+ 995        """
+ 996        Reads the pitch angle of the XGO robot.
+ 997
+ 998        Returns:
+ 999            float: The pitch angle in degrees.
+1000        """
+1001        self.__read(XGOorder["PITCH"][0], 4)
+1002        pitch = 0
+1003        if self.__unpack():
+1004            pitch = Byte2Float(self.rx_data)
+1005        return round(pitch, 2)
+1006
+1007    def read_yaw(self):
+1008        """
+1009        Reads the yaw angle of the XGO robot.
+1010
+1011        Returns:
+1012            float: The yaw angle in degrees.
+1013        """
+1014        self.__read(XGOorder["YAW"][0], 4)
+1015        yaw = 0
+1016        if self.__unpack():
+1017            yaw = Byte2Float(self.rx_data)
+1018        return round(yaw, 2)
+1019
+1020    def __unpack(self, timeout=1):
+1021        """
+1022        Unpacks received data from the XGO robot.
+1023
+1024        Parameters:
+1025            timeout (float, optional): The maximum time (in seconds) to wait for a complete data packet. Defaults to 1.
+1026
+1027        Returns:
+1028            bool: True if a complete data packet was received and unpacked successfully, False otherwise.
+1029        """
+1030        t = time.time()
+1031        rx_msg = []
+1032        while time.time() - t < timeout:
+1033            n = self.ser.inWaiting()
+1034            rx_CHECK = 0
+1035            if n:
+1036                data = self.ser.read(n)
+1037                for num in data:
+1038                    rx_msg.append(num)
+1039                    if self.rx_FLAG == 0:
+1040                        if num == 0x55:
+1041                            self.rx_FLAG = 1
+1042                        else:
+1043                            self.rx_FLAG = 0
+1044
+1045                    elif self.rx_FLAG == 1:
+1046                        if num == 0x00:
+1047                            self.rx_FLAG = 2
+1048                        else:
+1049                            self.rx_FLAG = 0
+1050
+1051                    elif self.rx_FLAG == 2:
+1052                        self.rx_LEN = num
+1053                        self.rx_FLAG = 3
+1054
+1055                    elif self.rx_FLAG == 3:
+1056                        self.rx_TYPE = num
+1057                        self.rx_FLAG = 4
+1058
+1059                    elif self.rx_FLAG == 4:
+1060                        self.rx_ADDR = num
+1061                        self.rx_FLAG = 5
+1062                        self.rx_COUNT = 0
+1063
+1064                    elif self.rx_FLAG == 5:
+1065                        if self.rx_COUNT == (self.rx_LEN - 9):
+1066                            self.rx_data[self.rx_COUNT] = num
+1067                            self.rx_FLAG = 6
+1068                        elif self.rx_COUNT < self.rx_LEN - 9:
+1069                            self.rx_data[self.rx_COUNT] = num
+1070                            self.rx_COUNT = self.rx_COUNT + 1
+1071
+1072                    elif self.rx_FLAG == 6:
+1073                        for i in self.rx_data[0:(self.rx_LEN - 8)]:
+1074                            rx_CHECK = rx_CHECK + i
+1075                        rx_CHECK = 255 - (self.rx_LEN + self.rx_TYPE + self.rx_ADDR + rx_CHECK) % 256
+1076                        if num == rx_CHECK:
+1077                            self.rx_FLAG = 7
+1078                        else:
+1079                            self.rx_FLAG = 0
+1080                            self.rx_COUNT = 0
+1081                            self.rx_ADDR = 0
+1082                            self.rx_LEN = 0
+1083
+1084                    elif self.rx_FLAG == 7:
+1085                        if num == 0x00:
+1086                            self.rx_FLAG = 8
+1087                        else:
+1088                            self.rx_FLAG = 0
+1089                            self.rx_COUNT = 0
+1090                            self.rx_ADDR = 0
+1091                            self.rx_LEN = 0
+1092
+1093                    elif self.rx_FLAG == 8:
+1094                        if num == 0xAA:
+1095                            self.rx_FLAG = 0
+1096                            if self.verbose:
+1097                                print("rx_data: ", rx_msg)
+1098                            return True
+1099                        else:
+1100                            self.rx_FLAG = 0
+1101                            self.rx_COUNT = 0
+1102                            self.rx_ADDR = 0
+1103                            self.rx_LEN = 0
+1104        return False
+1105
+1106    def set_move_mintime(self, mintime):
+1107        """
+1108        Sets the minimum movement time for the XGO robot.
+1109
+1110        Parameters:
+1111            mintime (float): The minimum movement time in seconds.
+1112        """
+1113        self.mintime = mintime
+1114
+1115    def upgrade(self, filename):
+1116        """
+1117        Upgrades the firmware of the XGO robot.
+1118
+1119        Parameters:
+1120            filename (str): The path to the firmware file.
+1121        """
+1122        XGOorder["UPGRADE"][1] = 1
+1123        self.ser.flush()
+1124        self.__send("UPGRADE")
+1125        if self.__unpack(10):
+1126            if self.rx_data[0] == 0x55:
+1127                time.sleep(1)
+1128                print("Start!")
+1129                self.__send_bin(filename)
+1130            else:
+1131                print("Upgrade Response Error!")
+1132        else:
+1133            print("Upgrade Timeout!")
+1134
+1135    def read_lib_version(self):
+1136        """
+1137        Returns the version of the XGO Python library.
+1138
+1139        Returns:
+1140            str: The library version string.
+1141        """
+1142        return __version__
+1143
+1144    def __send_bin(self, filename):
+1145        """
+1146        Sends a binary file to the XGO robot for firmware upgrade. (TESTING PHASE)
+1147
+1148        Parameters:
+1149            filename (str): The path to the binary file.
+1150        """
+1151        try:
+1152            self.__change_baud(350000)
+1153            with open(filename, 'rb') as f:
+1154                file = f.read()
+1155            print("The file size is", len(file), ' bytes.')
+1156            print("The expected upgrade time is", round(len(file) / 350000 * 8 * 1.3), ' s.')
+1157            self.ser.write(file)
+1158            print("Done!")
+1159            self.__change_baud(115200)
+1160        except Exception as e:
+1161            print("Send bin file error!")
+1162            print(e)
+1163
+1164    def calibration(self, state):
+1165        """
+1166        Initiates or terminates the calibration process of the XGO robot.
+1167
+1168        Parameters:
+1169            state (str): 'start' to initiate calibration, 'end' to terminate.
+1170
+1171        Raises:
+1172            ValueError: If an invalid state is provided.
+1173        """
+1174        if state == 'start':
+1175            XGOorder["CALIBRATION"][1] = 1
+1176        elif state == 'end':
+1177            XGOorder["CALIBRATION"][1] = 0
+1178        else:
+1179            print("ERROR!")
+1180        self.__send("CALIBRATION")
+1181        return
+1182
+1183    def arm(self, arm_x, arm_z):
+1184        """
+1185        Controls the movement of the XGO robot's arm in the x and z directions.
+1186
+1187        Parameters:
+1188            arm_x (float): The x-coordinate of the arm's end effector.
+1189            arm_z (float): The z-coordinate of the arm's end effector.
+1190
+1191        Raises:
+1192            ValueError: If invalid arm_x or arm_z values are provided.
+1193        """
+1194        try:
+1195            arm_x_u8 = conver2u8(arm_x, XGOparam["ARM_LIMIT"][0])
+1196            arm_z_u8 = conver2u8(arm_z, XGOparam["ARM_LIMIT"][1])
+1197        except:
+1198            print("Error!Illegal Value!")
+1199            return
+1200        XGOorder["ARM_X"][1] = arm_x_u8
+1201        XGOorder["ARM_Z"][1] = arm_z_u8
+1202        self.__send("ARM_X")
+1203        self.__send("ARM_Z")
+1204
+1205    def arm_polar(self, arm_theta, arm_r):
+1206        """
+1207        Controls the movement of the XGO robot's arm using polar coordinates.
+1208
+1209        Parameters:
+1210            arm_theta (float): The angle (theta) of the arm.
+1211            arm_r (float): The radial distance (r) of the arm's end effector.
+1212
+1213        Raises:
+1214            ValueError: If invalid arm_theta or arm_r values are provided.
+1215        """
+1216        try:
+1217            arm_theta_u8 = conver2u8(arm_theta, XGOparam["ARM_LIMIT"][2])
+1218            arm_r_u8 = conver2u8(arm_r, XGOparam["ARM_LIMIT"][3])
+1219        except:
+1220            print("Error!Illegal Value!")
+1221            return
+1222        XGOorder["ARM_THETA"][1] = arm_theta_u8
+1223        XGOorder["ARM_R"][1] = arm_r_u8
+1224        self.__send("ARM_THETA")
+1225        self.__send("ARM_R")
+1226
+1227    def arm_mode(self, mode):
+1228        """
+1229        Sets the mode of the XGO robot's arm.
+1230
+1231        Parameters:
+1232            mode (int): The arm mode (0x00 or 0x01).
+1233
+1234        Raises:
+1235            ValueError: If an invalid mode value is provided.
+1236        """
+1237        if mode != 0x01 and mode != 0x00:
+1238            print("Error!Illegal Value!")
+1239            return
+1240        XGOorder["ARM_MODE"][1] = mode
+1241        self.__send("ARM_MODE")
+1242
+1243    def claw(self, pos):
+1244        """
+1245        Controls the position of the XGO robot's claw.
+1246
+1247        Parameters:
+1248            pos (float): The desired claw position (0-255).
+1249
+1250        Raises:
+1251            ValueError: If an invalid claw position value is provided.
+1252        """
+1253        try:
+1254            claw_pos = conver2u8(pos, [0, 255])
+1255        except:
+1256            print("Error!Illegal Value!")
+1257            return
+1258        XGOorder["CLAW"][1] = claw_pos
+1259        self.__send("CLAW")
+1260
+1261    def btRename(self, name):
+1262        """
+1263        Renames the Bluetooth name of the XGO robot (alternative implementation).
+1264
+1265        Parameters:
+1266            name (str): The new Bluetooth name (maximum 20 characters, alphanumeric only).
+1267
+1268        Raises:
+1269            TypeError: If the input is not a string.
+1270            ValueError: If the name is longer than 20 characters or contains non-alphanumeric characters.
+1271        """
+1272        length = len(name)
+1273        if not isinstance(name, str):
+1274            print("Wrong type!")
+1275            return
+1276
+1277        if length > 20:
+1278            print("The length of the name needs to be less than 20")
+1279            return
+1280
+1281        if not name.isalnum():
+1282            print("The name can only contain numbers and letters")
+1283            return
+1284
+1285        XGOorder["BT_NAME"] = [0x13]
+1286        for c in list(name):
+1287            if ord(c) > 255:
+1288                print("The name can only contain numbers and letters")
+1289                return
+1290            else:
+1291                XGOorder["BT_NAME"].append(ord(c))
+1292        print(XGOorder["BT_NAME"])
+1293        self.__send("BT_NAME", len=length)
+1294
+1295    def moveToMid(self):
+1296        """
+1297        Moves the XGO robot's legs to their middle position.
+1298        """
+1299        self.__send("MOVE_TO_MID")
+1300
+1301    def teach(self, mode, pos_id):
+1302        """
+1303        Records or plays back a taught position for the XGO robot's legs.
+1304
+1305        Parameters:
+1306            mode (str): 'record' to record a position, 'play' to play back a recorded position.
+1307            pos_id (int): The ID of the position to record or play back.
+1308        """
+1309        if mode == "play":
+1310            XGOorder["TEACH_PLAY"][1] = pos_id
+1311            self.__send("TEACH_PLAY")
+1312        if mode == "record":
+1313            XGOorder["TEACH_RECORD"][1] = pos_id
+1314            self.__send("TEACH_RECORD")
+1315        else:
+1316            return
+1317
+1318    def teach_arm(self, mode, pos_id):
+1319        """
+1320        Records or plays back a taught position for the XGO robot's arm.
+1321
+1322        Parameters:
+1323            mode (str): 'record' to record a position, 'play' to play back a recorded position.
+1324            pos_id (int): The ID of the position to record or play back.
+1325        """
+1326        if mode == "play":
+1327            XGOorder["TEACH_ARM_PLAY"][1] = pos_id
+1328            self.__send("TEACH_ARM_PLAY")
+1329        if mode == "record":
+1330            XGOorder["TEACH_ARM_RECORD"][1] = pos_id
+1331            self.__send("TEACH_ARM_RECORD")
+1332        else:
+1333            return
+1334
+1335    def arm_speed(self, speed):
+1336        """
+1337        Adjusts the rotation speed of the arm.
+1338
+1339        Parameters:
+1340            speed (int): The desired arm speed (1-255).
+1341
+1342        Raises:
+1343            ValueError: If an invalid speed value is provided.
+1344        """
+1345        if speed < 0 or speed > 255:
+1346            print("ERROR!Illegal Value!The speed parameter needs to be between 0 and 255!")
+1347            return
+1348        if speed == 0:
+1349            speed = 1
+1350        XGOorder["ARM_SPEED"][1] = speed
+1351        self.__send("ARM_SPEED")
+1352
+1353    def read_imu(self):
+1354        """
+1355        Reads IMU (Inertial Measurement Unit) data from the XGO robot.
+1356
+1357        Returns:
+1358            list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].
+1359        """
+1360        self.__read(0x65, 24)
+1361        result = []
+1362        if self.__unpack():
+1363            result = self.unpack_imu()
+1364        return result
+1365
+1366    def read_imu_int16(self, direction):
+1367        """
+1368        Reads IMU data as signed 16-bit integers for a specific direction.
+1369
+1370        Parameters:
+1371            direction (str): The direction to read ('roll', 'pitch', or 'yaw').
+1372
+1373        Returns:
+1374            int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.
+1375        """
+1376        if direction == "roll":
+1377            self.__read(0x66, 2)
+1378        elif direction == "pitch":
+1379            self.__read(0x67, 2)
+1380        elif direction == "yaw":
+1381            self.__read(0x68, 2)
+1382        else:
+1383            return None
+1384        result = []
+1385        if self.__unpack():
+1386            result = Byte2Short(self.rx_data)
+1387        return result
+1388
+1389    def unpack_imu(self):
+1390        """
+1391        Unpacks raw IMU data into meaningful values.
+1392
+1393        Returns:
+1394            list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].
+1395        """
+1396        result = []
+1397        for i in range(9):
+1398            a = bytearray()
+1399            if i < 6:
+1400                a.append(self.rx_data[2 * i + 1])
+1401                a.append(self.rx_data[2 * i])
+1402                if i < 3:
+1403                    result.append(struct.unpack("!h", a)[0] / 16384 * 9.8)
+1404                else:
+1405                    result.append(struct.unpack("!h", a)[0] / 16.4)
+1406            else:
+1407                a.append(self.rx_data[4 * i - 9])
+1408                a.append(self.rx_data[4 * i - 10])
+1409                a.append(self.rx_data[4 * i - 11])
+1410                a.append(self.rx_data[4 * i - 12])
+1411                result.append(struct.unpack("!f", a)[0] / 180 * 3.14)
+1412        return result
+1413
+1414    def set_origin(self):
+1415        """
+1416        Sets the current position of the XGO robot as the origin.
+1417        """
+1418        XGOorder["SET_ORIGIN"][1] = 1
+1419        self.__send("SET_ORIGIN")
+1420
+1421    def move_to(self, data):
+1422        """
+1423        Moves the robot to a specified position.
+1424
+1425        Parameters:
+1426            data (int): The target position value.
+1427        """
+1428        packed_data = struct.pack('>h', data)
+1429        XGOorder["MOVE_TO"][1] = packed_data[0]
+1430        XGOorder["MOVE_TO"][2] = packed_data[1]
+1431        self.__send("MOVE_TO", len=2)
+1432
+1433    def output_analog(self, data):
+1434        """
+1435        Sets the analog output value.
+1436
+1437        Parameters:
+1438            data (int): The analog output value.
+1439        """
+1440        XGOorder["OUTPUT_ANALOG"][1] = data
+1441        self.__send("OUTPUT_ANALOG")
+1442        pass
+1443
+1444    def output_digital(self, data):
+1445        """
+1446        Sets the digital output value.
+1447
+1448        Parameters:
+1449            data (int): The digital output value.
+1450        """
+1451        XGOorder["OUTPUT_DIGITAL"][1] = data
+1452        self.__send("OUTPUT_DIGITAL")
+1453        pass
+1454
+1455    ############# RIDER ################
+1456
+1457    def rider_move_x(self, speed, runtime=0):
+1458        """
+1459        Moves the XGO Rider along the x-axis.
+1460
+1461        Parameters:
+1462            speed (float): The speed of movement along the x-axis.
+1463            runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.
+1464        """
+1465        XGOorder["VX"][1] = conver2u8(speed, XGOparam["VX_LIMIT"])
+1466        self.__send("VX")
+1467        if runtime:
+1468            time.sleep(runtime)
+1469            XGOorder["VX"][1] = conver2u8(0, XGOparam["VX_LIMIT"])
+1470            self.__send("VX")
+1471
+1472    def rider_turn(self, speed, runtime=0):
+1473        """
+1474        Turns the XGO Rider.
+1475
+1476        Parameters:
+1477            speed (float): The speed of the turn.
+1478            runtime (float, optional): The duration of the turn in seconds. If provided, the robot will stop turning after this duration. Defaults to 0.
+1479        """
+1480        XGOorder["VYAW"][1] = conver2u8(speed, XGOparam["VYAW_LIMIT"])
+1481        self.__send("VYAW")
+1482        if runtime:
+1483            time.sleep(runtime)
+1484            XGOorder["VYAW"][1] = conver2u8(0, XGOparam["VYAW_LIMIT"])
+1485            self.__send("VYAW")
+1486
+1487    def rider_reset_odom(self):
+1488        """
+1489        Resets the odometry of the XGO Rider.
+1490        """
+1491        XGOorder["SET_ORIGIN"][1] = 1
+1492        self.__send("SET_ORIGIN")
+1493
+1494    def rider_action(self, action_id, wait=False):
+1495        """
+1496        Makes the XGO Rider perform a predefined action.
+1497
+1498        Parameters:
+1499            action_id (int): The ID of the action to perform (1-255).
+1500            wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.
+1501
+1502        Raises:
+1503            ValueError: If an invalid action ID is provided.
+1504        """
+1505        if action_id <= 0 or action_id > 255:
+1506            print("ERROR!Illegal Action ID!")
+1507            return
+1508        XGOorder["ACTION"][1] = action_id
+1509        self.__send("ACTION")
+1510        if wait:
+1511            st = XGOparam["ActionTime"].get(action_id)
+1512            if st:
+1513                time.sleep(st)
+1514
+1515    def rider_balance_roll(self, mode):
+1516        """
+1517        Turns on/off the roll balance of the XGO Rider.
+1518
+1519        Parameters:
+1520            mode (int): 1 to turn on roll balance, 0 to turn it off.
+1521
+1522        Raises:
+1523            ValueError: If an invalid mode value is provided.
+1524        """
+1525        if mode != 0 and mode != 1:
+1526            print("ERROR!Illegal Value!")
+1527            return
+1528        XGOorder["IMU"][1] = mode
+1529        self.__send("IMU")
+1530
+1531    def rider_perform(self, mode):
+1532        """
+1533        Turns on/off the XGO Rider's performance mode.
+1534
+1535        Parameters:
+1536            mode (int): 1 to turn on performance mode, 0 to turn it off.
+1537
+1538        Raises:
+1539            ValueError: If an invalid mode value is provided.
+1540        """
+1541        if mode != 0 and mode != 1:
+1542            print("ERROR!Illegal Value!")
+1543            return
+1544        XGOorder["PERFORM"][1] = mode
+1545        self.__send("PERFORM")
+1546
+1547    def rider_calibration(self, state):
+1548        """
+1549        Initiates or terminates the calibration process of the XGO Rider.
+1550
+1551        Parameters:
+1552            state (str): 'start' to initiate calibration, 'end' to terminate.
+1553
+1554        Raises:
+1555            ValueError: If an invalid state is provided.
+1556        """
+1557        if state == 'start':
+1558            XGOorder["CALIBRATION"][1] = 1
+1559        elif state == 'end':
+1560            XGOorder["CALIBRATION"][1] = 0
+1561        else:
+1562            print("ERROR!")
+1563        self.__send("CALIBRATION")
+1564        return
+1565
+1566    def rider_height(self, data):
+1567        """
+1568        Adjusts the height of the XGO Rider.
+1569
+1570        Parameters:
+1571            data (float): The desired height.
+1572        """
+1573        self.__translation("z", data)
+1574
+1575    def rider_roll(self, data):
+1576        """
+1577        Adjusts the roll angle of the XGO Rider.
+1578
+1579        Parameters:
+1580            data (float): The desired roll angle.
+1581        """
+1582        self.__attitude("r", data)
+1583
+1584    def rider_periodic_roll(self, period):
+1585        """
+1586        Initiates periodic roll movement of the XGO Rider.
+1587
+1588        Parameters:
+1589            period (float): The period of the roll movement.
+1590        """
+1591        self.__periodic_rot("r", period)
+1592
+1593    def rider_periodic_z(self, period):
+1594        """
+1595        Initiates periodic vertical movement of the XGO Rider.
+1596
+1597        Parameters:
+1598            period (float): The period of the vertical movement.
+1599        """
+1600        self.__periodic_tran("z", period)
+1601
+1602    def rider_read_battery(self):
+1603        """
+1604        Reads the battery level of the XGO Rider.
+1605
+1606        Returns:
+1607            int: The battery level (0-100).
+1608        """
+1609        self.__read(XGOorder["BATTERY"][0], 1)
+1610        battery = 0
+1611        if self.__unpack():
+1612            battery = int(self.rx_data[0])
+1613        return battery
+1614
+1615    def rider_read_firmware(self):
+1616        """
+1617        Reads the firmware version of the XGO Rider.
+1618
+1619        Returns:
+1620            str: The firmware version string.
+1621        """
+1622        self.__read(XGOorder["FIRMWARE_VERSION"][0], 10)
+1623        firmware_version = 'Null'
+1624        if self.__unpack():
+1625            data = self.rx_data[0:10]
+1626            try:
+1627                firmware_version = data.decode("ascii").strip('\0')
+1628            except Exception as e:
+1629                print(e)
+1630        return firmware_version
+1631
+1632    def rider_read_roll(self):
+1633        """
+1634        Reads the roll angle of the XGO Rider.
+1635
+1636        Returns:
+1637            float: The roll angle in degrees.
+1638        """
+1639        self.__read(XGOorder["ROLL"][0], 4)
+1640        roll = 0
+1641        if self.__unpack():
+1642            roll = Byte2Float(self.rx_data)
+1643        return round(roll, 2)
+1644
+1645    def rider_read_pitch(self):
+1646        """
+1647        Reads the pitch angle of the XGO Rider.
+1648
+1649        Returns:
+1650            float: The pitch angle in degrees.
+1651        """
+1652        self.__read(XGOorder["PITCH"][0], 4)
+1653        pitch = 0
+1654        if self.__unpack():
+1655            pitch = Byte2Float(self.rx_data)
+1656        return round(pitch, 2)
+1657
+1658    def rider_read_yaw(self):
+1659        """
+1660        Reads the yaw angle of the XGO Rider.
+1661
+1662        Returns:
+1663            float: The yaw angle in degrees.
+1664        """
+1665        self.__read(XGOorder["YAW"][0], 4)
+1666        yaw = 0
+1667        if self.__unpack():
+1668            yaw = Byte2Float(self.rx_data)
+1669        return round(yaw, 2)
+1670
+1671    def rider_read_imu_int16(self, direction):
+1672        """
+1673        Reads IMU data as signed 16-bit integers for a specific direction on the XGO Rider.
+1674
+1675        Parameters:
+1676            direction (str): The direction to read ('roll', 'pitch', or 'yaw').
+1677
+1678        Returns:
+1679            int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.
+1680        """
+1681        if direction == "roll":
+1682            self.__read(0x66, 2)
+1683        elif direction == "pitch":
+1684            self.__read(0x67, 2)
+1685        elif direction == "yaw":
+1686            self.__read(0x68, 2)
+1687        else:
+1688            return None
+1689        result = []
+1690        if self.__unpack():
+1691            result = Byte2Short(self.rx_data)
+1692        return result
+1693
+1694    def rider_reset(self):
+1695        """
+1696        Resets the XGO Rider.
+1697        """
+1698        return self.reset()
+1699
+1700    def rider_upgrade(self, filename):
+1701        """
+1702        Upgrades the firmware of the XGO Rider.
+1703
+1704        Parameters:
+1705            filename (str): The path to the firmware file.
+1706        """
+1707        XGOorder["UPGRADE"][1] = 1
+1708        self.ser.flush()
+1709        self.__send("UPGRADE")
+1710        if self.__unpack(10):
+1711            if self.rx_data[0] == 0x55:
+1712                time.sleep(1)
+1713                print("Start!")
+1714                self.__send_bin(filename)
+1715            else:
+1716                print("Upgrade Response Error!")
+1717        else:
+1718            print("Upgrade Timeout!")
+1719
+1720    def rider_led(self, index, color):
+1721        """
+1722        Sets the color of an LED on the XGO Rider.
+1723
+1724        Parameters:
+1725            index (int): The index of the LED (likely 1-4 depending on hardware).
+1726            color (list): A list of three integers representing the RGB color values (0-255 each).
+1727        """
+1728        XGOorder["LED_COLOR"][0] = 0x68 + index
+1729        XGOorder["LED_COLOR"][1:4] = color
+1730        self.__send("LED_COLOR", len=3)
+
+ + +

When instantiating XGO, you need to specify the serial communication interface between the upper computer and the machine dog.

+
+ + +
+ +
+ + XGO(port, baud=115200, version='xgomini', verbose=False) + + + +
+ +
216    def __init__(self, port, baud=115200, version="xgomini", verbose=False):
+217        """
+218        Initializes the XGO robot object.
+219
+220        Parameters:
+221            port (str): The serial port to use for communication (e.g., '/dev/ttyACM0', 'COM3').
+222            baud (int, optional): The baud rate for serial communication. Defaults to 115200.
+223            version (string, optional): Specifies the version of the XGO robot. Accepts 'xgomini', 'xgolite', or 'xgorider'. Defaults to 'xgomini'.
+224            verbose (bool, optional): Enables verbose output for debugging. Defaults to False.
+225        """
+226        self.verbose = verbose
+227        self.ser = serial.Serial("/dev/ttyAMA0", baud, timeout=0.5)
+228        self.ser.flushOutput()
+229        self.ser.flushInput()
+230        self.port = port
+231        self.rx_FLAG = 0
+232        self.rx_COUNT = 0
+233        self.rx_ADDR = 0
+234        self.rx_LEN = 0
+235        self.rx_data = bytearray(50)
+236        time.sleep(0.25)
+237        self.version = self.read_firmware()
+238        if self.version[0] == 'M':
+239            changePara('xgomini')
+240        elif self.version[0] == 'L':
+241            changePara('xgolite')
+242        elif self.version[0] == 'R':
+243            changePara('xgorider')
+244        else:
+245            changePara('xgomini')
+246            print("ERROR!Can't read firmware version!")
+247        self.mintime = 0.65
+248        self.reset()
+249        self.init_yaw = self.read_yaw()
+250        time.sleep(1)
+251        pass
+
+ + +

Initializes the XGO robot object.

+ +

Parameters: + port (str): The serial port to use for communication (e.g., '/dev/ttyACM0', 'COM3'). + baud (int, optional): The baud rate for serial communication. Defaults to 115200. + version (string, optional): Specifies the version of the XGO robot. Accepts 'xgomini', 'xgolite', or 'xgorider'. Defaults to 'xgomini'. + verbose (bool, optional): Enables verbose output for debugging. Defaults to False.

+
+ + +
+
+
+ verbose + + +
+ + + + +
+
+
+ ser + + +
+ + + + +
+
+
+ port + + +
+ + + + +
+
+
+ rx_FLAG + + +
+ + + + +
+
+
+ rx_COUNT + + +
+ + + + +
+
+
+ rx_ADDR + + +
+ + + + +
+
+
+ rx_LEN + + +
+ + + + +
+
+
+ rx_data + + +
+ + + + +
+
+
+ version + + +
+ + + + +
+
+
+ mintime + + +
+ + + + +
+
+
+ init_yaw + + +
+ + + + +
+
+ +
+ + def + stop(self): + + + +
+ +
307    def stop(self):
+308        """
+309        Stops all movement of the XGO robot.
+310        """
+311        self.move_x(0)
+312        self.move_y(0)
+313        self.mark_time(0)
+314        self.turn(0)
+
+ + +

Stops all movement of the XGO robot.

+
+ + +
+
+ +
+ + def + move(self, direction, step): + + + +
+ +
316    def move(self, direction, step):
+317        """
+318        Moves the XGO robot in a specified direction.
+319
+320        Parameters:
+321            direction (str): The direction of movement ('x', 'X', 'y', or 'Y').
+322            step (float): The step size or speed of the movement.
+323
+324        Raises:
+325            ValueError: If an invalid direction is provided.
+326        """
+327        if direction in ['x', 'X']:
+328            self.move_x(step)
+329        elif direction in ['y', 'Y']:
+330            self.move_y(step)
+331        else:
+332            print("ERROR!Invalid direction!")
+
+ + +

Moves the XGO robot in a specified direction.

+ +

Parameters: + direction (str): The direction of movement ('x', 'X', 'y', or 'Y'). + step (float): The step size or speed of the movement.

+ +

Raises: + ValueError: If an invalid direction is provided.

+
+ + +
+
+ +
+ + def + move_x(self, step, runtime=0): + + + +
+ +
334    def move_x(self, step, runtime=0):
+335        """
+336        Moves the XGO robot along the x-axis.
+337
+338        Parameters:
+339            step (float): The step size or speed of the movement along the x-axis.
+340            runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.
+341        """
+342        XGOorder["VX"][1] = conver2u8(step, XGOparam["VX_LIMIT"])
+343        self.__send("VX")
+344        if runtime:
+345            time.sleep(runtime)
+346            XGOorder["VX"][1] = conver2u8(0, XGOparam["VX_LIMIT"])
+347            self.__send("VX")
+
+ + +

Moves the XGO robot along the x-axis.

+ +

Parameters: + step (float): The step size or speed of the movement along the x-axis. + runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.

+
+ + +
+
+ +
+ + def + move_y(self, step, runtime=0): + + + +
+ +
349    def move_y(self, step, runtime=0):
+350        """
+351        Moves the XGO robot along the y-axis.
+352
+353        Parameters:
+354            step (float): The step size or speed of the movement along the y-axis.
+355            runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.
+356        """
+357        XGOorder["VY"][1] = conver2u8(step, XGOparam["VY_LIMIT"])
+358        self.__send("VY")
+359        if runtime:
+360            time.sleep(runtime)
+361            XGOorder["VY"][1] = conver2u8(0, XGOparam["VY_LIMIT"])
+362            self.__send("VY")
+
+ + +

Moves the XGO robot along the y-axis.

+ +

Parameters: + step (float): The step size or speed of the movement along the y-axis. + runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.

+
+ + +
+
+ +
+ + def + turn(self, step, runtime=0): + + + +
+ +
364    def turn(self, step, runtime=0):
+365        """
+366        Rotates the XGO robot.
+367
+368        Parameters:
+369            step (float): The step size or speed of the rotation.
+370            runtime (float, optional): The duration of the rotation in seconds. If provided, the robot will stop rotating after this duration. Defaults to 0.
+371        """
+372        XGOorder["VYAW"][1] = conver2u8(step, XGOparam["VYAW_LIMIT"])
+373        self.__send("VYAW")
+374        if runtime:
+375            time.sleep(runtime)
+376            XGOorder["VYAW"][1] = conver2u8(0, XGOparam["VYAW_LIMIT"])
+377            self.__send("VYAW")
+
+ + +

Rotates the XGO robot.

+ +

Parameters: + step (float): The step size or speed of the rotation. + runtime (float, optional): The duration of the rotation in seconds. If provided, the robot will stop rotating after this duration. Defaults to 0.

+
+ + +
+
+ +
+ + def + forward(self, step): + + + +
+ +
379    def forward(self, step):
+380        """
+381        Moves the XGO robot forward.
+382
+383        Parameters:
+384            step (float): The step size or speed of the forward movement.
+385        """
+386        self.move_x(abs(step))
+
+ + +

Moves the XGO robot forward.

+ +

Parameters: + step (float): The step size or speed of the forward movement.

+
+ + +
+
+ +
+ + def + back(self, step): + + + +
+ +
388    def back(self, step):
+389        """
+390        Moves the XGO robot backward.
+391
+392        Parameters:
+393            step (float): The step size or speed of the backward movement.
+394        """
+395        self.move_x(-abs(step))
+
+ + +

Moves the XGO robot backward.

+ +

Parameters: + step (float): The step size or speed of the backward movement.

+
+ + +
+
+ +
+ + def + left(self, step): + + + +
+ +
397    def left(self, step):
+398        """
+399        Moves the XGO robot to the left.
+400
+401        Parameters:
+402            step (float): The step size or speed of the leftward movement.
+403        """
+404        self.move_y(abs(step))
+
+ + +

Moves the XGO robot to the left.

+ +

Parameters: + step (float): The step size or speed of the leftward movement.

+
+ + +
+
+ +
+ + def + right(self, step): + + + +
+ +
406    def right(self, step):
+407        """
+408        Moves the XGO robot to the right.
+409
+410        Parameters:
+411            step (float): The step size or speed of the rightward movement.
+412        """
+413        self.move_y(-abs(step))
+
+ + +

Moves the XGO robot to the right.

+ +

Parameters: + step (float): The step size or speed of the rightward movement.

+
+ + +
+
+ +
+ + def + turnleft(self, step): + + + +
+ +
415    def turnleft(self, step):
+416        """
+417        Turns the XGO robot to the left.
+418
+419        Parameters:
+420            step (float): The step size or speed of the left turn.
+421        """
+422        self.turn(abs(step))
+
+ + +

Turns the XGO robot to the left.

+ +

Parameters: + step (float): The step size or speed of the left turn.

+
+ + +
+
+ +
+ + def + turnright(self, step): + + + +
+ +
424    def turnright(self, step):
+425        """
+426        Turns the XGO robot to the right.
+427
+428        Parameters:
+429            step (float): The step size or speed of the right turn.
+430        """
+431        self.turn(-abs(step))
+
+ + +

Turns the XGO robot to the right.

+ +

Parameters: + step (float): The step size or speed of the right turn.

+
+ + +
+
+ +
+ + def + move_by(self, distance, vx, vy, k, mintime): + + + +
+ +
433    def move_by(self, distance, vx, vy, k, mintime):
+434        """
+435        Moves the XGO robot a specific distance using a combination of x and y velocities.
+436
+437        Parameters:
+438            distance (float): The distance to move.
+439            vx (float): The velocity along the x-axis.
+440            vy (float): The velocity along the y-axis.
+441            k (float): A scaling factor for the movement duration.
+442            mintime (float): The minimum duration of the movement.
+443        """
+444        runtime = k * abs(distance) + mintime
+445        self.move_x(math.copysign(vx, distance))
+446        self.move_y(math.copysign(vy, distance))
+447        time.sleep(runtime)
+448        self.move_x(0)
+449        self.move_y(0)
+450        time.sleep(0.2)
+
+ + +

Moves the XGO robot a specific distance using a combination of x and y velocities.

+ +

Parameters: + distance (float): The distance to move. + vx (float): The velocity along the x-axis. + vy (float): The velocity along the y-axis. + k (float): A scaling factor for the movement duration. + mintime (float): The minimum duration of the movement.

+
+ + +
+
+ +
+ + def + move_x_by(self, distance, vx=18, k=0.035, mintime=0.55): + + + +
+ +
452    def move_x_by(self, distance, vx=18, k=0.035, mintime=0.55):
+453        """
+454        Moves the XGO robot a specific distance along the x-axis.
+455
+456        Parameters:
+457            distance (float): The distance to move along the x-axis.
+458            vx (float, optional): The velocity along the x-axis. Defaults to 18.
+459            k (float, optional): A scaling factor for the movement duration. Defaults to 0.035.
+460            mintime (float, optional): The minimum duration of the movement. Defaults to 0.55.
+461        """
+462        self.move_by(distance, vx, 0, k, mintime)
+463        pass
+
+ + +

Moves the XGO robot a specific distance along the x-axis.

+ +

Parameters: + distance (float): The distance to move along the x-axis. + vx (float, optional): The velocity along the x-axis. Defaults to 18. + k (float, optional): A scaling factor for the movement duration. Defaults to 0.035. + mintime (float, optional): The minimum duration of the movement. Defaults to 0.55.

+
+ + +
+
+ +
+ + def + move_y_by(self, distance, vy=18, k=0.0373, mintime=0.5): + + + +
+ +
465    def move_y_by(self, distance, vy=18, k=0.0373, mintime=0.5):
+466        """
+467        Moves the XGO robot a specific distance along the y-axis.
+468
+469        Parameters:
+470            distance (float): The distance to move along the y-axis.
+471            vy (float, optional): The velocity along the y-axis. Defaults to 18.
+472            k (float, optional): A scaling factor for the movement duration. Defaults to 0.0373.
+473            mintime (float, optional): The minimum duration of the movement. Defaults to 0.5.
+474        """
+475        self.move_by(distance, 0, vy, k, mintime)
+476        pass
+
+ + +

Moves the XGO robot a specific distance along the y-axis.

+ +

Parameters: + distance (float): The distance to move along the y-axis. + vy (float, optional): The velocity along the y-axis. Defaults to 18. + k (float, optional): A scaling factor for the movement duration. Defaults to 0.0373. + mintime (float, optional): The minimum duration of the movement. Defaults to 0.5.

+
+ + +
+
+ +
+ + def + turn_by(self, theta, mintime, vyaw=16, k=0.08): + + + +
+ +
478    def turn_by(self, theta, mintime, vyaw=16, k=0.08):
+479        """
+480        Turns the XGO robot by a specific angle.
+481
+482        Parameters:
+483            theta (float): The angle to turn (in degrees).
+484            mintime (float): The minimum duration of the turn.
+485            vyaw (float, optional): The angular velocity. Defaults to 16.
+486            k (float, optional): A scaling factor for the turn duration. Defaults to 0.08.
+487        """
+488        runtime = abs(theta) * k + mintime
+489        self.turn(math.copysign(vyaw, theta))
+490        time.sleep(runtime)
+491        self.turn(0)
+492        pass
+
+ + +

Turns the XGO robot by a specific angle.

+ +

Parameters: + theta (float): The angle to turn (in degrees). + mintime (float): The minimum duration of the turn. + vyaw (float, optional): The angular velocity. Defaults to 16. + k (float, optional): A scaling factor for the turn duration. Defaults to 0.08.

+
+ + +
+
+ +
+ + def + turn_to(self, theta, vyaw=60, emax=10): + + + +
+ +
494    def turn_to(self, theta, vyaw=60, emax=10):
+495        """
+496        Turns the XGO robot to a specific absolute angle.
+497
+498        Parameters:
+499            theta (float): The target angle (in degrees).
+500            vyaw (float, optional): The angular velocity. Defaults to 60.
+501            emax (float, optional): The maximum error tolerance for the angle. Defaults to 10.
+502        """
+503        cur_yaw = self.read_yaw()
+504        des_yaw = self.init_yaw + theta
+505        while abs(des_yaw - cur_yaw) >= emax:
+506            self.turn(math.copysign(vyaw, des_yaw - cur_yaw))
+507            cur_yaw = self.read_yaw()
+508        self.turn(0)
+509        time.sleep(0.2)
+510        pass
+
+ + +

Turns the XGO robot to a specific absolute angle.

+ +

Parameters: + theta (float): The target angle (in degrees). + vyaw (float, optional): The angular velocity. Defaults to 60. + emax (float, optional): The maximum error tolerance for the angle. Defaults to 10.

+
+ + +
+
+ +
+ + def + translation(self, direction, data): + + + +
+ +
527    def translation(self, direction, data):
+528        """
+529        Translates the XGO robot's body.
+530
+531        Parameters:
+532            direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these).
+533            data (float or list): The translation amount(s).
+534
+535        Raises:
+536            ValueError: If the length of direction and data don't match when using a list.
+537        """
+538        if isinstance(direction, list):
+539            if len(direction) != len(data):
+540                print("ERROR!The length of direction and data don't match!")
+541                return
+542            for i in range(len(data)):
+543                self.__translation(direction[i], data[i])
+544        else:
+545            self.__translation(direction, data)
+
+ + +

Translates the XGO robot's body.

+ +

Parameters: + direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these). + data (float or list): The translation amount(s).

+ +

Raises: + ValueError: If the length of direction and data don't match when using a list.

+
+ + +
+
+ +
+ + def + attitude(self, direction, data): + + + +
+ +
562    def attitude(self, direction, data):
+563        """
+564        Adjusts the XGO robot's body attitude.
+565
+566        Parameters:
+567            direction (str or list): The axis/axes of attitude adjustment ('r', 'p', 'y', or a list of these).
+568            data (float or list): The attitude adjustment amount(s).
+569
+570        Raises:
+571            ValueError: If the length of direction and data don't match when using a list.
+572        """
+573        if isinstance(direction, list):
+574            if len(direction) != len(data):
+575                print("ERROR!The length of direction and data don't match!")
+576                return
+577            for i in range(len(data)):
+578                self.__attitude(direction[i], data[i])
+579        else:
+580            self.__attitude(direction, data)
+
+ + +

Adjusts the XGO robot's body attitude.

+ +

Parameters: + direction (str or list): The axis/axes of attitude adjustment ('r', 'p', 'y', or a list of these). + data (float or list): The attitude adjustment amount(s).

+ +

Raises: + ValueError: If the length of direction and data don't match when using a list.

+
+ + +
+
+ +
+ + def + action(self, action_id, wait=False): + + + +
+ +
582    def action(self, action_id, wait=False):
+583        """
+584        Makes the XGO robot perform a predefined action.
+585
+586        Parameters:
+587            action_id (int): The ID of the action to perform (1-255).
+588            wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.
+589
+590        Raises:
+591            ValueError: If an invalid action ID is provided.
+592        """
+593        if action_id <= 0 or action_id > 255:
+594            print("ERROR!Illegal Action ID!")
+595            return
+596        XGOorder["ACTION"][1] = action_id
+597        self.__send("ACTION")
+598        if wait:
+599            st = XGOparam["ActionTime"].get(action_id)
+600            if st:
+601                time.sleep(st)
+
+ + +

Makes the XGO robot perform a predefined action.

+ +

Parameters: + action_id (int): The ID of the action to perform (1-255). + wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.

+ +

Raises: + ValueError: If an invalid action ID is provided.

+
+ + +
+
+ +
+ + def + reset(self): + + + +
+ +
603    def reset(self):
+604        """
+605        Resets the XGO robot to its initial state.
+606        """
+607        self.action(255)
+608        time.sleep(1)
+
+ + +

Resets the XGO robot to its initial state.

+
+ + +
+
+ +
+ + def + leg(self, leg_id, data): + + + +
+ +
610    def leg(self, leg_id, data):
+611        """
+612        Controls the three-axis movement of a single leg of the XGO robot.
+613
+614        Parameters:
+615            leg_id (int): The ID of the leg to control (1, 2, 3, or 4).
+616            data (list): A list of three float values representing the x, y, and z coordinates of the leg's end effector.
+617
+618        Raises:
+619            ValueError: If an invalid leg ID or data length is provided.
+620        """
+621        value = [0, 0, 0]
+622        if leg_id not in [1, 2, 3, 4]:
+623            print("Error!Illegal Index!")
+624            return
+625        if len(data) != 3:
+626            message = "Error!Illegal Value!"
+627            return
+628        for i in range(3):
+629            try:
+630                value[i] = conver2u8(data[i], XGOparam["LEG_LIMIT"][i])
+631            except:
+632                print("Error!Illegal Value!")
+633        for i in range(3):
+634            index = 3 * (leg_id - 1) + i + 1
+635            XGOorder["LEG_POS"][index] = value[i]
+636            self.__send("LEG_POS", index)
+
+ + +

Controls the three-axis movement of a single leg of the XGO robot.

+ +

Parameters: + leg_id (int): The ID of the leg to control (1, 2, 3, or 4). + data (list): A list of three float values representing the x, y, and z coordinates of the leg's end effector.

+ +

Raises: + ValueError: If an invalid leg ID or data length is provided.

+
+ + +
+
+ +
+ + def + motor(self, motor_id, data): + + + +
+ +
655    def motor(self, motor_id, data):
+656        """
+657        Controls one or more motors of the XGO robot.
+658
+659        Parameters:
+660            motor_id (int or list): The ID(s) of the motor(s) to control (11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, or 53).
+661            data (float or list): The target angle(s) for the motor(s).
+662
+663        Raises:
+664            ValueError: If an invalid motor ID or data length is provided.
+665        """
+666        MOTOR_ID = [11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, 53]
+667
+668        if isinstance(motor_id, list):
+669            if len(motor_id) != len(data):
+670                print("Error!Length Mismatching!")
+671                return
+672            index = []
+673            for i in range(len(motor_id)):
+674                temp_index = search(motor_id[i], MOTOR_ID)
+675                if temp_index == -1:
+676                    print("Error!Illegal Index!")
+677                    return
+678                index.append(temp_index)
+679            for i in range(len(index)):
+680                self.__motor(index[i], data[i])
+681        else:
+682            index = search(motor_id, MOTOR_ID)
+683            self.__motor(index, data)
+
+ + +

Controls one or more motors of the XGO robot.

+ +

Parameters: + motor_id (int or list): The ID(s) of the motor(s) to control (11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, or 53). + data (float or list): The target angle(s) for the motor(s).

+ +

Raises: + ValueError: If an invalid motor ID or data length is provided.

+
+ + +
+
+ +
+ + def + unload_motor(self, leg_id): + + + +
+ +
685    def unload_motor(self, leg_id):
+686        """
+687        Unloads the motors of a specified leg.
+688
+689        Parameters:
+690            leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).
+691
+692        Raises:
+693            ValueError: If an invalid leg ID is provided.
+694        """
+695        if leg_id not in [1, 2, 3, 4, 5]:
+696            print('ERROR!leg_id must be 1, 2, 3 ,4 or 5')
+697            return
+698        XGOorder["UNLOAD_MOTOR"][1] = 0x10 + leg_id
+699        self.__send("UNLOAD_MOTOR")
+
+ + +

Unloads the motors of a specified leg.

+ +

Parameters: + leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).

+ +

Raises: + ValueError: If an invalid leg ID is provided.

+
+ + +
+
+ +
+ + def + unload_allmotor(self): + + + +
+ +
701    def unload_allmotor(self):
+702        """
+703        Unloads all motors of the XGO robot.
+704        """
+705        XGOorder["UNLOAD_MOTOR"][1] = 0x01
+706        self.__send("UNLOAD_MOTOR")
+
+ + +

Unloads all motors of the XGO robot.

+
+ + +
+
+ +
+ + def + load_motor(self, leg_id): + + + +
+ +
708    def load_motor(self, leg_id):
+709        """
+710        Loads the motors of a specified leg.
+711
+712        Parameters:
+713            leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).
+714
+715        Raises:
+716            ValueError: If an invalid leg ID is provided.
+717        """
+718        if leg_id not in [1, 2, 3, 4, 5]:
+719            print('ERROR!leg_id must be 1, 2, 3 ,4 or 5')
+720            return
+721        XGOorder["LOAD_MOTOR"][1] = 0x20 + leg_id
+722        self.__send("LOAD_MOTOR")
+
+ + +

Loads the motors of a specified leg.

+ +

Parameters: + leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs).

+ +

Raises: + ValueError: If an invalid leg ID is provided.

+
+ + +
+
+ +
+ + def + load_allmotor(self): + + + +
+ +
724    def load_allmotor(self):
+725        """
+726        Loads all motors of the XGO robot.
+727        """
+728        XGOorder["LOAD_MOTOR"][1] = 0x00
+729        self.__send("LOAD_MOTOR")
+
+ + +

Loads all motors of the XGO robot.

+
+ + +
+
+ +
+ + def + periodic_rot(self, direction, period): + + + +
+ +
749    def periodic_rot(self, direction, period):
+750        """
+751        Initiates periodic rotation of the XGO robot's body.
+752
+753        Parameters:
+754            direction (str or list): The axis/axes of rotation ('r', 'p', 'y', or a list of these).
+755            period (float or list): The period(s) of rotation.
+756
+757        Raises:
+758            ValueError: If the length of direction and period don't match when using a list.
+759        """
+760        if (isinstance(direction, list)):
+761            if (len(direction) != len(period)):
+762                print("ERROR!The length of direction and data don't match!")
+763                return
+764            for i in range(len(period)):
+765                self.__periodic_rot(direction[i], period[i])
+766        else:
+767            self.__periodic_rot(direction, period)
+
+ + +

Initiates periodic rotation of the XGO robot's body.

+ +

Parameters: + direction (str or list): The axis/axes of rotation ('r', 'p', 'y', or a list of these). + period (float or list): The period(s) of rotation.

+ +

Raises: + ValueError: If the length of direction and period don't match when using a list.

+
+ + +
+
+ +
+ + def + periodic_tran(self, direction, period): + + + +
+ +
787    def periodic_tran(self, direction, period):
+788        """
+789        Initiates periodic translation of the XGO robot's body.
+790
+791        Parameters:
+792            direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these).
+793            period (float or list): The period(s) of translation.
+794
+795        Raises:
+796            ValueError: If the length of direction and period don't match when using a list.
+797        """
+798        if isinstance(direction, list):
+799            if len(direction) != len(period):
+800                print("ERROR!The length of direction and data don't match!")
+801                return
+802            for i in range(len(period)):
+803                self.__periodic_tran(direction[i], period[i])
+804        else:
+805            self.__periodic_tran(direction, period)
+
+ + +

Initiates periodic translation of the XGO robot's body.

+ +

Parameters: + direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these). + period (float or list): The period(s) of translation.

+ +

Raises: + ValueError: If the length of direction and period don't match when using a list.

+
+ + +
+
+ +
+ + def + mark_time(self, data): + + + +
+ +
807    def mark_time(self, data):
+808        """
+809        Makes the XGO robot mark time (原地踏步).
+810
+811        Parameters:
+812            data (float): The height of the mark time movement. Set to 0 to stop marking time.
+813        """
+814        if data == 0:
+815            XGOorder["MarkTime"][1] = 0
+816        else:
+817            XGOorder["MarkTime"][1] = conver2u8(data, XGOparam["MARK_TIME_LIMIT"], min_value=1)
+818        self.__send("MarkTime")
+
+ + +

Makes the XGO robot mark time (原地踏步).

+ +

Parameters: + data (float): The height of the mark time movement. Set to 0 to stop marking time.

+
+ + +
+
+ +
+ + def + pace(self, mode): + + + +
+ +
820    def pace(self, mode):
+821        """
+822        Changes the step frequency of the XGO robot.
+823
+824        Parameters:
+825            mode (str): The desired pace ('normal', 'slow', or 'high').
+826
+827        Raises:
+828            ValueError: If an invalid pace mode is provided.
+829        """
+830        if mode == "normal":
+831            value = 0x00
+832        elif mode == "slow":
+833            value = 0x01
+834        elif mode == "high":
+835            value = 0x02
+836        else:
+837            print("ERROR!Illegal Value!")
+838            return
+839        XGOorder["MOVE_MODE"][1] = value
+840        self.__send("MOVE_MODE")
+
+ + +

Changes the step frequency of the XGO robot.

+ +

Parameters: + mode (str): The desired pace ('normal', 'slow', or 'high').

+ +

Raises: + ValueError: If an invalid pace mode is provided.

+
+ + +
+
+ +
+ + def + gait_type(self, mode): + + + +
+ +
842    def gait_type(self, mode):
+843        """
+844        Sets the gait type of the XGO robot.
+845
+846        Parameters:
+847            mode (str): The desired gait type ('trot', 'walk', 'high_walk', or 'slow_trot').
+848        """
+849        if mode == "trot":
+850            value = 0x00
+851        elif mode == "walk":
+852            value = 0x01
+853        elif mode == "high_walk":
+854            value = 0x02
+855        elif mode == "slow_trot":
+856            value = 0x03
+857        XGOorder["GAIT_TYPE"][1] = value
+858        self.__send("GAIT_TYPE")
+
+ + +

Sets the gait type of the XGO robot.

+ +

Parameters: + mode (str): The desired gait type ('trot', 'walk', 'high_walk', or 'slow_trot').

+
+ + +
+
+ +
+ + def + imu(self, mode): + + + +
+ +
860    def imu(self, mode):
+861        """
+862        Turns on/off the self-stabilization of the XGO robot.
+863
+864        Parameters:
+865            mode (int): 1 to turn on self-stabilization, 0 to turn it off.
+866
+867        Raises:
+868            ValueError: If an invalid mode value is provided.
+869        """
+870        if mode != 0 and mode != 1:
+871            print("ERROR!Illegal Value!")
+872            return
+873        XGOorder["IMU"][1] = mode
+874        self.__send("IMU")
+
+ + +

Turns on/off the self-stabilization of the XGO robot.

+ +

Parameters: + mode (int): 1 to turn on self-stabilization, 0 to turn it off.

+ +

Raises: + ValueError: If an invalid mode value is provided.

+
+ + +
+
+ +
+ + def + perform(self, mode): + + + +
+ +
876    def perform(self, mode):
+877        """
+878        Turns on/off the XGO robot's performance mode (循环做动作状态).
+879
+880        Parameters:
+881            mode (int): 1 to turn on performance mode, 0 to turn it off.
+882
+883        Raises:
+884            ValueError: If an invalid mode value is provided.
+885        """
+886        if mode != 0 and mode != 1:
+887            print("ERROR!Illegal Value!")
+888            return
+889        XGOorder["PERFORM"][1] = mode
+890        self.__send("PERFORM")
+
+ + +

Turns on/off the XGO robot's performance mode (循环做动作状态).

+ +

Parameters: + mode (int): 1 to turn on performance mode, 0 to turn it off.

+ +

Raises: + ValueError: If an invalid mode value is provided.

+
+ + +
+
+ +
+ + def + motor_speed(self, speed): + + + +
+ +
892    def motor_speed(self, speed):
+893        """
+894        Adjusts the rotation speed of the motors.
+895
+896        Parameters:
+897            speed (int): The desired motor speed (1-255).
+898
+899        Raises:
+900            ValueError: If an invalid speed value is provided.
+901        """
+902        if speed < 0 or speed > 255:
+903            print("ERROR!Illegal Value!The speed parameter needs to be between 0 and 255!")
+904            return
+905        if speed == 0:
+906            speed = 1
+907        XGOorder["MOTOR_SPEED"][1] = speed
+908        self.__send("MOTOR_SPEED")
+
+ + +

Adjusts the rotation speed of the motors.

+ +

Parameters: + speed (int): The desired motor speed (1-255).

+ +

Raises: + ValueError: If an invalid speed value is provided.

+
+ + +
+
+ +
+ + def + bt_rename(self, name): + + + +
+ +
910    def bt_rename(self, name):
+911        """
+912        Renames the Bluetooth name of the XGO robot.
+913
+914        Parameters:
+915            name (str): The new Bluetooth name (maximum 10 characters, ASCII only).
+916
+917        Raises:
+918            TypeError: If the input is not a string.
+919            ValueError: If the name is longer than 10 characters or contains non-ASCII characters.
+920        """
+921        if type(name) != str:
+922            print("ERROR!The input value must be of string type!")
+923            return
+924        len_name = len(name)
+925        if len_name > 10:
+926            print("ERROR!The length of the input string cannot be longer than 10!")
+927            return
+928        try:
+929            XGOorder["BT_NAME"][1:len_name + 1] = list(name.encode('ascii'))
+930            self.__send("BT_NAME", len=len_name)
+931        except:
+932            print("ERROR!Name only supports characters in ASCII code!")
+
+ + +

Renames the Bluetooth name of the XGO robot.

+ +

Parameters: + name (str): The new Bluetooth name (maximum 10 characters, ASCII only).

+ +

Raises: + TypeError: If the input is not a string. + ValueError: If the name is longer than 10 characters or contains non-ASCII characters.

+
+ + +
+
+ +
+ + def + read_motor(self): + + + +
+ +
934    def read_motor(self):
+935        """
+936        Reads the angles of all 15 motors.
+937
+938        Returns:
+939            list: A list of 15 float values representing the angles of the motors.
+940        """
+941        self.__read(XGOorder["MOTOR_ANGLE"][0], 15)
+942        angle = []
+943        if self.__unpack():
+944            for i in range(self.rx_COUNT + 1):
+945                if i < 12:
+946                    angle.append(round(conver2float(self.rx_data[i], XGOparam["MOTOR_LIMIT"][i % 3]), 2))
+947                else:
+948                    angle.append(round(conver2float(self.rx_data[i], XGOparam["MOTOR_LIMIT"][i - 9]), 2))
+949        return angle
+
+ + +

Reads the angles of all 15 motors.

+ +

Returns: + list: A list of 15 float values representing the angles of the motors.

+
+ + +
+
+ +
+ + def + read_battery(self): + + + +
+ +
951    def read_battery(self):
+952        """
+953        Reads the battery level of the XGO robot.
+954
+955        Returns:
+956            int: The battery level (0-100).
+957        """
+958        self.__read(XGOorder["BATTERY"][0], 1)
+959        battery = 0
+960        if self.__unpack():
+961            battery = int(self.rx_data[0])
+962        return battery
+
+ + +

Reads the battery level of the XGO robot.

+ +

Returns: + int: The battery level (0-100).

+
+ + +
+
+ +
+ + def + read_firmware(self): + + + +
+ +
964    def read_firmware(self):
+965        """
+966        Reads the firmware version of the XGO robot.
+967
+968        Returns:
+969            str: The firmware version string.
+970        """
+971        self.__read(XGOorder["FIRMWARE_VERSION"][0], 10)
+972        firmware_version = 'Null'
+973        if self.__unpack():
+974            data = self.rx_data[0:10]
+975            try:
+976                firmware_version = data.decode("ascii").strip('\0')
+977            except Exception as e:
+978                print(e)
+979        return firmware_version
+
+ + +

Reads the firmware version of the XGO robot.

+ +

Returns: + str: The firmware version string.

+
+ + +
+
+ +
+ + def + read_roll(self): + + + +
+ +
981    def read_roll(self):
+982        """
+983        Reads the roll angle of the XGO robot.
+984
+985        Returns:
+986            float: The roll angle in degrees.
+987        """
+988        self.__read(XGOorder["ROLL"][0], 4)
+989        roll = 0
+990        if self.__unpack():
+991            roll = Byte2Float(self.rx_data)
+992        return round(roll, 2)
+
+ + +

Reads the roll angle of the XGO robot.

+ +

Returns: + float: The roll angle in degrees.

+
+ + +
+
+ +
+ + def + read_pitch(self): + + + +
+ +
 994    def read_pitch(self):
+ 995        """
+ 996        Reads the pitch angle of the XGO robot.
+ 997
+ 998        Returns:
+ 999            float: The pitch angle in degrees.
+1000        """
+1001        self.__read(XGOorder["PITCH"][0], 4)
+1002        pitch = 0
+1003        if self.__unpack():
+1004            pitch = Byte2Float(self.rx_data)
+1005        return round(pitch, 2)
+
+ + +

Reads the pitch angle of the XGO robot.

+ +

Returns: + float: The pitch angle in degrees.

+
+ + +
+
+ +
+ + def + read_yaw(self): + + + +
+ +
1007    def read_yaw(self):
+1008        """
+1009        Reads the yaw angle of the XGO robot.
+1010
+1011        Returns:
+1012            float: The yaw angle in degrees.
+1013        """
+1014        self.__read(XGOorder["YAW"][0], 4)
+1015        yaw = 0
+1016        if self.__unpack():
+1017            yaw = Byte2Float(self.rx_data)
+1018        return round(yaw, 2)
+
+ + +

Reads the yaw angle of the XGO robot.

+ +

Returns: + float: The yaw angle in degrees.

+
+ + +
+
+ +
+ + def + set_move_mintime(self, mintime): + + + +
+ +
1106    def set_move_mintime(self, mintime):
+1107        """
+1108        Sets the minimum movement time for the XGO robot.
+1109
+1110        Parameters:
+1111            mintime (float): The minimum movement time in seconds.
+1112        """
+1113        self.mintime = mintime
+
+ + +

Sets the minimum movement time for the XGO robot.

+ +

Parameters: + mintime (float): The minimum movement time in seconds.

+
+ + +
+
+ +
+ + def + upgrade(self, filename): + + + +
+ +
1115    def upgrade(self, filename):
+1116        """
+1117        Upgrades the firmware of the XGO robot.
+1118
+1119        Parameters:
+1120            filename (str): The path to the firmware file.
+1121        """
+1122        XGOorder["UPGRADE"][1] = 1
+1123        self.ser.flush()
+1124        self.__send("UPGRADE")
+1125        if self.__unpack(10):
+1126            if self.rx_data[0] == 0x55:
+1127                time.sleep(1)
+1128                print("Start!")
+1129                self.__send_bin(filename)
+1130            else:
+1131                print("Upgrade Response Error!")
+1132        else:
+1133            print("Upgrade Timeout!")
+
+ + +

Upgrades the firmware of the XGO robot.

+ +

Parameters: + filename (str): The path to the firmware file.

+
+ + +
+
+ +
+ + def + read_lib_version(self): + + + +
+ +
1135    def read_lib_version(self):
+1136        """
+1137        Returns the version of the XGO Python library.
+1138
+1139        Returns:
+1140            str: The library version string.
+1141        """
+1142        return __version__
+
+ + +

Returns the version of the XGO Python library.

+ +

Returns: + str: The library version string.

+
+ + +
+
+ +
+ + def + calibration(self, state): + + + +
+ +
1164    def calibration(self, state):
+1165        """
+1166        Initiates or terminates the calibration process of the XGO robot.
+1167
+1168        Parameters:
+1169            state (str): 'start' to initiate calibration, 'end' to terminate.
+1170
+1171        Raises:
+1172            ValueError: If an invalid state is provided.
+1173        """
+1174        if state == 'start':
+1175            XGOorder["CALIBRATION"][1] = 1
+1176        elif state == 'end':
+1177            XGOorder["CALIBRATION"][1] = 0
+1178        else:
+1179            print("ERROR!")
+1180        self.__send("CALIBRATION")
+1181        return
+
+ + +

Initiates or terminates the calibration process of the XGO robot.

+ +

Parameters: + state (str): 'start' to initiate calibration, 'end' to terminate.

+ +

Raises: + ValueError: If an invalid state is provided.

+
+ + +
+
+ +
+ + def + arm(self, arm_x, arm_z): + + + +
+ +
1183    def arm(self, arm_x, arm_z):
+1184        """
+1185        Controls the movement of the XGO robot's arm in the x and z directions.
+1186
+1187        Parameters:
+1188            arm_x (float): The x-coordinate of the arm's end effector.
+1189            arm_z (float): The z-coordinate of the arm's end effector.
+1190
+1191        Raises:
+1192            ValueError: If invalid arm_x or arm_z values are provided.
+1193        """
+1194        try:
+1195            arm_x_u8 = conver2u8(arm_x, XGOparam["ARM_LIMIT"][0])
+1196            arm_z_u8 = conver2u8(arm_z, XGOparam["ARM_LIMIT"][1])
+1197        except:
+1198            print("Error!Illegal Value!")
+1199            return
+1200        XGOorder["ARM_X"][1] = arm_x_u8
+1201        XGOorder["ARM_Z"][1] = arm_z_u8
+1202        self.__send("ARM_X")
+1203        self.__send("ARM_Z")
+
+ + +

Controls the movement of the XGO robot's arm in the x and z directions.

+ +

Parameters: + arm_x (float): The x-coordinate of the arm's end effector. + arm_z (float): The z-coordinate of the arm's end effector.

+ +

Raises: + ValueError: If invalid arm_x or arm_z values are provided.

+
+ + +
+
+ +
+ + def + arm_polar(self, arm_theta, arm_r): + + + +
+ +
1205    def arm_polar(self, arm_theta, arm_r):
+1206        """
+1207        Controls the movement of the XGO robot's arm using polar coordinates.
+1208
+1209        Parameters:
+1210            arm_theta (float): The angle (theta) of the arm.
+1211            arm_r (float): The radial distance (r) of the arm's end effector.
+1212
+1213        Raises:
+1214            ValueError: If invalid arm_theta or arm_r values are provided.
+1215        """
+1216        try:
+1217            arm_theta_u8 = conver2u8(arm_theta, XGOparam["ARM_LIMIT"][2])
+1218            arm_r_u8 = conver2u8(arm_r, XGOparam["ARM_LIMIT"][3])
+1219        except:
+1220            print("Error!Illegal Value!")
+1221            return
+1222        XGOorder["ARM_THETA"][1] = arm_theta_u8
+1223        XGOorder["ARM_R"][1] = arm_r_u8
+1224        self.__send("ARM_THETA")
+1225        self.__send("ARM_R")
+
+ + +

Controls the movement of the XGO robot's arm using polar coordinates.

+ +

Parameters: + arm_theta (float): The angle (theta) of the arm. + arm_r (float): The radial distance (r) of the arm's end effector.

+ +

Raises: + ValueError: If invalid arm_theta or arm_r values are provided.

+
+ + +
+
+ +
+ + def + arm_mode(self, mode): + + + +
+ +
1227    def arm_mode(self, mode):
+1228        """
+1229        Sets the mode of the XGO robot's arm.
+1230
+1231        Parameters:
+1232            mode (int): The arm mode (0x00 or 0x01).
+1233
+1234        Raises:
+1235            ValueError: If an invalid mode value is provided.
+1236        """
+1237        if mode != 0x01 and mode != 0x00:
+1238            print("Error!Illegal Value!")
+1239            return
+1240        XGOorder["ARM_MODE"][1] = mode
+1241        self.__send("ARM_MODE")
+
+ + +

Sets the mode of the XGO robot's arm.

+ +

Parameters: + mode (int): The arm mode (0x00 or 0x01).

+ +

Raises: + ValueError: If an invalid mode value is provided.

+
+ + +
+
+ +
+ + def + claw(self, pos): + + + +
+ +
1243    def claw(self, pos):
+1244        """
+1245        Controls the position of the XGO robot's claw.
+1246
+1247        Parameters:
+1248            pos (float): The desired claw position (0-255).
+1249
+1250        Raises:
+1251            ValueError: If an invalid claw position value is provided.
+1252        """
+1253        try:
+1254            claw_pos = conver2u8(pos, [0, 255])
+1255        except:
+1256            print("Error!Illegal Value!")
+1257            return
+1258        XGOorder["CLAW"][1] = claw_pos
+1259        self.__send("CLAW")
+
+ + +

Controls the position of the XGO robot's claw.

+ +

Parameters: + pos (float): The desired claw position (0-255).

+ +

Raises: + ValueError: If an invalid claw position value is provided.

+
+ + +
+
+ +
+ + def + btRename(self, name): + + + +
+ +
1261    def btRename(self, name):
+1262        """
+1263        Renames the Bluetooth name of the XGO robot (alternative implementation).
+1264
+1265        Parameters:
+1266            name (str): The new Bluetooth name (maximum 20 characters, alphanumeric only).
+1267
+1268        Raises:
+1269            TypeError: If the input is not a string.
+1270            ValueError: If the name is longer than 20 characters or contains non-alphanumeric characters.
+1271        """
+1272        length = len(name)
+1273        if not isinstance(name, str):
+1274            print("Wrong type!")
+1275            return
+1276
+1277        if length > 20:
+1278            print("The length of the name needs to be less than 20")
+1279            return
+1280
+1281        if not name.isalnum():
+1282            print("The name can only contain numbers and letters")
+1283            return
+1284
+1285        XGOorder["BT_NAME"] = [0x13]
+1286        for c in list(name):
+1287            if ord(c) > 255:
+1288                print("The name can only contain numbers and letters")
+1289                return
+1290            else:
+1291                XGOorder["BT_NAME"].append(ord(c))
+1292        print(XGOorder["BT_NAME"])
+1293        self.__send("BT_NAME", len=length)
+
+ + +

Renames the Bluetooth name of the XGO robot (alternative implementation).

+ +

Parameters: + name (str): The new Bluetooth name (maximum 20 characters, alphanumeric only).

+ +

Raises: + TypeError: If the input is not a string. + ValueError: If the name is longer than 20 characters or contains non-alphanumeric characters.

+
+ + +
+
+ +
+ + def + moveToMid(self): + + + +
+ +
1295    def moveToMid(self):
+1296        """
+1297        Moves the XGO robot's legs to their middle position.
+1298        """
+1299        self.__send("MOVE_TO_MID")
+
+ + +

Moves the XGO robot's legs to their middle position.

+
+ + +
+
+ +
+ + def + teach(self, mode, pos_id): + + + +
+ +
1301    def teach(self, mode, pos_id):
+1302        """
+1303        Records or plays back a taught position for the XGO robot's legs.
+1304
+1305        Parameters:
+1306            mode (str): 'record' to record a position, 'play' to play back a recorded position.
+1307            pos_id (int): The ID of the position to record or play back.
+1308        """
+1309        if mode == "play":
+1310            XGOorder["TEACH_PLAY"][1] = pos_id
+1311            self.__send("TEACH_PLAY")
+1312        if mode == "record":
+1313            XGOorder["TEACH_RECORD"][1] = pos_id
+1314            self.__send("TEACH_RECORD")
+1315        else:
+1316            return
+
+ + +

Records or plays back a taught position for the XGO robot's legs.

+ +

Parameters: + mode (str): 'record' to record a position, 'play' to play back a recorded position. + pos_id (int): The ID of the position to record or play back.

+
+ + +
+
+ +
+ + def + teach_arm(self, mode, pos_id): + + + +
+ +
1318    def teach_arm(self, mode, pos_id):
+1319        """
+1320        Records or plays back a taught position for the XGO robot's arm.
+1321
+1322        Parameters:
+1323            mode (str): 'record' to record a position, 'play' to play back a recorded position.
+1324            pos_id (int): The ID of the position to record or play back.
+1325        """
+1326        if mode == "play":
+1327            XGOorder["TEACH_ARM_PLAY"][1] = pos_id
+1328            self.__send("TEACH_ARM_PLAY")
+1329        if mode == "record":
+1330            XGOorder["TEACH_ARM_RECORD"][1] = pos_id
+1331            self.__send("TEACH_ARM_RECORD")
+1332        else:
+1333            return
+
+ + +

Records or plays back a taught position for the XGO robot's arm.

+ +

Parameters: + mode (str): 'record' to record a position, 'play' to play back a recorded position. + pos_id (int): The ID of the position to record or play back.

+
+ + +
+
+ +
+ + def + arm_speed(self, speed): + + + +
+ +
1335    def arm_speed(self, speed):
+1336        """
+1337        Adjusts the rotation speed of the arm.
+1338
+1339        Parameters:
+1340            speed (int): The desired arm speed (1-255).
+1341
+1342        Raises:
+1343            ValueError: If an invalid speed value is provided.
+1344        """
+1345        if speed < 0 or speed > 255:
+1346            print("ERROR!Illegal Value!The speed parameter needs to be between 0 and 255!")
+1347            return
+1348        if speed == 0:
+1349            speed = 1
+1350        XGOorder["ARM_SPEED"][1] = speed
+1351        self.__send("ARM_SPEED")
+
+ + +

Adjusts the rotation speed of the arm.

+ +

Parameters: + speed (int): The desired arm speed (1-255).

+ +

Raises: + ValueError: If an invalid speed value is provided.

+
+ + +
+
+ +
+ + def + read_imu(self): + + + +
+ +
1353    def read_imu(self):
+1354        """
+1355        Reads IMU (Inertial Measurement Unit) data from the XGO robot.
+1356
+1357        Returns:
+1358            list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].
+1359        """
+1360        self.__read(0x65, 24)
+1361        result = []
+1362        if self.__unpack():
+1363            result = self.unpack_imu()
+1364        return result
+
+ + +

Reads IMU (Inertial Measurement Unit) data from the XGO robot.

+ +

Returns: + list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].

+
+ + +
+
+ +
+ + def + read_imu_int16(self, direction): + + + +
+ +
1366    def read_imu_int16(self, direction):
+1367        """
+1368        Reads IMU data as signed 16-bit integers for a specific direction.
+1369
+1370        Parameters:
+1371            direction (str): The direction to read ('roll', 'pitch', or 'yaw').
+1372
+1373        Returns:
+1374            int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.
+1375        """
+1376        if direction == "roll":
+1377            self.__read(0x66, 2)
+1378        elif direction == "pitch":
+1379            self.__read(0x67, 2)
+1380        elif direction == "yaw":
+1381            self.__read(0x68, 2)
+1382        else:
+1383            return None
+1384        result = []
+1385        if self.__unpack():
+1386            result = Byte2Short(self.rx_data)
+1387        return result
+
+ + +

Reads IMU data as signed 16-bit integers for a specific direction.

+ +

Parameters: + direction (str): The direction to read ('roll', 'pitch', or 'yaw').

+ +

Returns: + int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.

+
+ + +
+
+ +
+ + def + unpack_imu(self): + + + +
+ +
1389    def unpack_imu(self):
+1390        """
+1391        Unpacks raw IMU data into meaningful values.
+1392
+1393        Returns:
+1394            list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].
+1395        """
+1396        result = []
+1397        for i in range(9):
+1398            a = bytearray()
+1399            if i < 6:
+1400                a.append(self.rx_data[2 * i + 1])
+1401                a.append(self.rx_data[2 * i])
+1402                if i < 3:
+1403                    result.append(struct.unpack("!h", a)[0] / 16384 * 9.8)
+1404                else:
+1405                    result.append(struct.unpack("!h", a)[0] / 16.4)
+1406            else:
+1407                a.append(self.rx_data[4 * i - 9])
+1408                a.append(self.rx_data[4 * i - 10])
+1409                a.append(self.rx_data[4 * i - 11])
+1410                a.append(self.rx_data[4 * i - 12])
+1411                result.append(struct.unpack("!f", a)[0] / 180 * 3.14)
+1412        return result
+
+ + +

Unpacks raw IMU data into meaningful values.

+ +

Returns: + list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw].

+
+ + +
+
+ +
+ + def + set_origin(self): + + + +
+ +
1414    def set_origin(self):
+1415        """
+1416        Sets the current position of the XGO robot as the origin.
+1417        """
+1418        XGOorder["SET_ORIGIN"][1] = 1
+1419        self.__send("SET_ORIGIN")
+
+ + +

Sets the current position of the XGO robot as the origin.

+
+ + +
+
+ +
+ + def + move_to(self, data): + + + +
+ +
1421    def move_to(self, data):
+1422        """
+1423        Moves the robot to a specified position.
+1424
+1425        Parameters:
+1426            data (int): The target position value.
+1427        """
+1428        packed_data = struct.pack('>h', data)
+1429        XGOorder["MOVE_TO"][1] = packed_data[0]
+1430        XGOorder["MOVE_TO"][2] = packed_data[1]
+1431        self.__send("MOVE_TO", len=2)
+
+ + +

Moves the robot to a specified position.

+ +

Parameters: + data (int): The target position value.

+
+ + +
+
+ +
+ + def + output_analog(self, data): + + + +
+ +
1433    def output_analog(self, data):
+1434        """
+1435        Sets the analog output value.
+1436
+1437        Parameters:
+1438            data (int): The analog output value.
+1439        """
+1440        XGOorder["OUTPUT_ANALOG"][1] = data
+1441        self.__send("OUTPUT_ANALOG")
+1442        pass
+
+ + +

Sets the analog output value.

+ +

Parameters: + data (int): The analog output value.

+
+ + +
+
+ +
+ + def + output_digital(self, data): + + + +
+ +
1444    def output_digital(self, data):
+1445        """
+1446        Sets the digital output value.
+1447
+1448        Parameters:
+1449            data (int): The digital output value.
+1450        """
+1451        XGOorder["OUTPUT_DIGITAL"][1] = data
+1452        self.__send("OUTPUT_DIGITAL")
+1453        pass
+
+ + +

Sets the digital output value.

+ +

Parameters: + data (int): The digital output value.

+
+ + +
+
+ +
+ + def + rider_move_x(self, speed, runtime=0): + + + +
+ +
1457    def rider_move_x(self, speed, runtime=0):
+1458        """
+1459        Moves the XGO Rider along the x-axis.
+1460
+1461        Parameters:
+1462            speed (float): The speed of movement along the x-axis.
+1463            runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.
+1464        """
+1465        XGOorder["VX"][1] = conver2u8(speed, XGOparam["VX_LIMIT"])
+1466        self.__send("VX")
+1467        if runtime:
+1468            time.sleep(runtime)
+1469            XGOorder["VX"][1] = conver2u8(0, XGOparam["VX_LIMIT"])
+1470            self.__send("VX")
+
+ + +

Moves the XGO Rider along the x-axis.

+ +

Parameters: + speed (float): The speed of movement along the x-axis. + runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0.

+
+ + +
+
+ +
+ + def + rider_turn(self, speed, runtime=0): + + + +
+ +
1472    def rider_turn(self, speed, runtime=0):
+1473        """
+1474        Turns the XGO Rider.
+1475
+1476        Parameters:
+1477            speed (float): The speed of the turn.
+1478            runtime (float, optional): The duration of the turn in seconds. If provided, the robot will stop turning after this duration. Defaults to 0.
+1479        """
+1480        XGOorder["VYAW"][1] = conver2u8(speed, XGOparam["VYAW_LIMIT"])
+1481        self.__send("VYAW")
+1482        if runtime:
+1483            time.sleep(runtime)
+1484            XGOorder["VYAW"][1] = conver2u8(0, XGOparam["VYAW_LIMIT"])
+1485            self.__send("VYAW")
+
+ + +

Turns the XGO Rider.

+ +

Parameters: + speed (float): The speed of the turn. + runtime (float, optional): The duration of the turn in seconds. If provided, the robot will stop turning after this duration. Defaults to 0.

+
+ + +
+
+ +
+ + def + rider_reset_odom(self): + + + +
+ +
1487    def rider_reset_odom(self):
+1488        """
+1489        Resets the odometry of the XGO Rider.
+1490        """
+1491        XGOorder["SET_ORIGIN"][1] = 1
+1492        self.__send("SET_ORIGIN")
+
+ + +

Resets the odometry of the XGO Rider.

+
+ + +
+
+ +
+ + def + rider_action(self, action_id, wait=False): + + + +
+ +
1494    def rider_action(self, action_id, wait=False):
+1495        """
+1496        Makes the XGO Rider perform a predefined action.
+1497
+1498        Parameters:
+1499            action_id (int): The ID of the action to perform (1-255).
+1500            wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.
+1501
+1502        Raises:
+1503            ValueError: If an invalid action ID is provided.
+1504        """
+1505        if action_id <= 0 or action_id > 255:
+1506            print("ERROR!Illegal Action ID!")
+1507            return
+1508        XGOorder["ACTION"][1] = action_id
+1509        self.__send("ACTION")
+1510        if wait:
+1511            st = XGOparam["ActionTime"].get(action_id)
+1512            if st:
+1513                time.sleep(st)
+
+ + +

Makes the XGO Rider perform a predefined action.

+ +

Parameters: + action_id (int): The ID of the action to perform (1-255). + wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False.

+ +

Raises: + ValueError: If an invalid action ID is provided.

+
+ + +
+
+ +
+ + def + rider_balance_roll(self, mode): + + + +
+ +
1515    def rider_balance_roll(self, mode):
+1516        """
+1517        Turns on/off the roll balance of the XGO Rider.
+1518
+1519        Parameters:
+1520            mode (int): 1 to turn on roll balance, 0 to turn it off.
+1521
+1522        Raises:
+1523            ValueError: If an invalid mode value is provided.
+1524        """
+1525        if mode != 0 and mode != 1:
+1526            print("ERROR!Illegal Value!")
+1527            return
+1528        XGOorder["IMU"][1] = mode
+1529        self.__send("IMU")
+
+ + +

Turns on/off the roll balance of the XGO Rider.

+ +

Parameters: + mode (int): 1 to turn on roll balance, 0 to turn it off.

+ +

Raises: + ValueError: If an invalid mode value is provided.

+
+ + +
+
+ +
+ + def + rider_perform(self, mode): + + + +
+ +
1531    def rider_perform(self, mode):
+1532        """
+1533        Turns on/off the XGO Rider's performance mode.
+1534
+1535        Parameters:
+1536            mode (int): 1 to turn on performance mode, 0 to turn it off.
+1537
+1538        Raises:
+1539            ValueError: If an invalid mode value is provided.
+1540        """
+1541        if mode != 0 and mode != 1:
+1542            print("ERROR!Illegal Value!")
+1543            return
+1544        XGOorder["PERFORM"][1] = mode
+1545        self.__send("PERFORM")
+
+ + +

Turns on/off the XGO Rider's performance mode.

+ +

Parameters: + mode (int): 1 to turn on performance mode, 0 to turn it off.

+ +

Raises: + ValueError: If an invalid mode value is provided.

+
+ + +
+
+ +
+ + def + rider_calibration(self, state): + + + +
+ +
1547    def rider_calibration(self, state):
+1548        """
+1549        Initiates or terminates the calibration process of the XGO Rider.
+1550
+1551        Parameters:
+1552            state (str): 'start' to initiate calibration, 'end' to terminate.
+1553
+1554        Raises:
+1555            ValueError: If an invalid state is provided.
+1556        """
+1557        if state == 'start':
+1558            XGOorder["CALIBRATION"][1] = 1
+1559        elif state == 'end':
+1560            XGOorder["CALIBRATION"][1] = 0
+1561        else:
+1562            print("ERROR!")
+1563        self.__send("CALIBRATION")
+1564        return
+
+ + +

Initiates or terminates the calibration process of the XGO Rider.

+ +

Parameters: + state (str): 'start' to initiate calibration, 'end' to terminate.

+ +

Raises: + ValueError: If an invalid state is provided.

+
+ + +
+
+ +
+ + def + rider_height(self, data): + + + +
+ +
1566    def rider_height(self, data):
+1567        """
+1568        Adjusts the height of the XGO Rider.
+1569
+1570        Parameters:
+1571            data (float): The desired height.
+1572        """
+1573        self.__translation("z", data)
+
+ + +

Adjusts the height of the XGO Rider.

+ +

Parameters: + data (float): The desired height.

+
+ + +
+
+ +
+ + def + rider_roll(self, data): + + + +
+ +
1575    def rider_roll(self, data):
+1576        """
+1577        Adjusts the roll angle of the XGO Rider.
+1578
+1579        Parameters:
+1580            data (float): The desired roll angle.
+1581        """
+1582        self.__attitude("r", data)
+
+ + +

Adjusts the roll angle of the XGO Rider.

+ +

Parameters: + data (float): The desired roll angle.

+
+ + +
+
+ +
+ + def + rider_periodic_roll(self, period): + + + +
+ +
1584    def rider_periodic_roll(self, period):
+1585        """
+1586        Initiates periodic roll movement of the XGO Rider.
+1587
+1588        Parameters:
+1589            period (float): The period of the roll movement.
+1590        """
+1591        self.__periodic_rot("r", period)
+
+ + +

Initiates periodic roll movement of the XGO Rider.

+ +

Parameters: + period (float): The period of the roll movement.

+
+ + +
+
+ +
+ + def + rider_periodic_z(self, period): + + + +
+ +
1593    def rider_periodic_z(self, period):
+1594        """
+1595        Initiates periodic vertical movement of the XGO Rider.
+1596
+1597        Parameters:
+1598            period (float): The period of the vertical movement.
+1599        """
+1600        self.__periodic_tran("z", period)
+
+ + +

Initiates periodic vertical movement of the XGO Rider.

+ +

Parameters: + period (float): The period of the vertical movement.

+
+ + +
+
+ +
+ + def + rider_read_battery(self): + + + +
+ +
1602    def rider_read_battery(self):
+1603        """
+1604        Reads the battery level of the XGO Rider.
+1605
+1606        Returns:
+1607            int: The battery level (0-100).
+1608        """
+1609        self.__read(XGOorder["BATTERY"][0], 1)
+1610        battery = 0
+1611        if self.__unpack():
+1612            battery = int(self.rx_data[0])
+1613        return battery
+
+ + +

Reads the battery level of the XGO Rider.

+ +

Returns: + int: The battery level (0-100).

+
+ + +
+
+ +
+ + def + rider_read_firmware(self): + + + +
+ +
1615    def rider_read_firmware(self):
+1616        """
+1617        Reads the firmware version of the XGO Rider.
+1618
+1619        Returns:
+1620            str: The firmware version string.
+1621        """
+1622        self.__read(XGOorder["FIRMWARE_VERSION"][0], 10)
+1623        firmware_version = 'Null'
+1624        if self.__unpack():
+1625            data = self.rx_data[0:10]
+1626            try:
+1627                firmware_version = data.decode("ascii").strip('\0')
+1628            except Exception as e:
+1629                print(e)
+1630        return firmware_version
+
+ + +

Reads the firmware version of the XGO Rider.

+ +

Returns: + str: The firmware version string.

+
+ + +
+
+ +
+ + def + rider_read_roll(self): + + + +
+ +
1632    def rider_read_roll(self):
+1633        """
+1634        Reads the roll angle of the XGO Rider.
+1635
+1636        Returns:
+1637            float: The roll angle in degrees.
+1638        """
+1639        self.__read(XGOorder["ROLL"][0], 4)
+1640        roll = 0
+1641        if self.__unpack():
+1642            roll = Byte2Float(self.rx_data)
+1643        return round(roll, 2)
+
+ + +

Reads the roll angle of the XGO Rider.

+ +

Returns: + float: The roll angle in degrees.

+
+ + +
+
+ +
+ + def + rider_read_pitch(self): + + + +
+ +
1645    def rider_read_pitch(self):
+1646        """
+1647        Reads the pitch angle of the XGO Rider.
+1648
+1649        Returns:
+1650            float: The pitch angle in degrees.
+1651        """
+1652        self.__read(XGOorder["PITCH"][0], 4)
+1653        pitch = 0
+1654        if self.__unpack():
+1655            pitch = Byte2Float(self.rx_data)
+1656        return round(pitch, 2)
+
+ + +

Reads the pitch angle of the XGO Rider.

+ +

Returns: + float: The pitch angle in degrees.

+
+ + +
+
+ +
+ + def + rider_read_yaw(self): + + + +
+ +
1658    def rider_read_yaw(self):
+1659        """
+1660        Reads the yaw angle of the XGO Rider.
+1661
+1662        Returns:
+1663            float: The yaw angle in degrees.
+1664        """
+1665        self.__read(XGOorder["YAW"][0], 4)
+1666        yaw = 0
+1667        if self.__unpack():
+1668            yaw = Byte2Float(self.rx_data)
+1669        return round(yaw, 2)
+
+ + +

Reads the yaw angle of the XGO Rider.

+ +

Returns: + float: The yaw angle in degrees.

+
+ + +
+
+ +
+ + def + rider_read_imu_int16(self, direction): + + + +
+ +
1671    def rider_read_imu_int16(self, direction):
+1672        """
+1673        Reads IMU data as signed 16-bit integers for a specific direction on the XGO Rider.
+1674
+1675        Parameters:
+1676            direction (str): The direction to read ('roll', 'pitch', or 'yaw').
+1677
+1678        Returns:
+1679            int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.
+1680        """
+1681        if direction == "roll":
+1682            self.__read(0x66, 2)
+1683        elif direction == "pitch":
+1684            self.__read(0x67, 2)
+1685        elif direction == "yaw":
+1686            self.__read(0x68, 2)
+1687        else:
+1688            return None
+1689        result = []
+1690        if self.__unpack():
+1691            result = Byte2Short(self.rx_data)
+1692        return result
+
+ + +

Reads IMU data as signed 16-bit integers for a specific direction on the XGO Rider.

+ +

Parameters: + direction (str): The direction to read ('roll', 'pitch', or 'yaw').

+ +

Returns: + int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided.

+
+ + +
+
+ +
+ + def + rider_reset(self): + + + +
+ +
1694    def rider_reset(self):
+1695        """
+1696        Resets the XGO Rider.
+1697        """
+1698        return self.reset()
+
+ + +

Resets the XGO Rider.

+
+ + +
+
+ +
+ + def + rider_upgrade(self, filename): + + + +
+ +
1700    def rider_upgrade(self, filename):
+1701        """
+1702        Upgrades the firmware of the XGO Rider.
+1703
+1704        Parameters:
+1705            filename (str): The path to the firmware file.
+1706        """
+1707        XGOorder["UPGRADE"][1] = 1
+1708        self.ser.flush()
+1709        self.__send("UPGRADE")
+1710        if self.__unpack(10):
+1711            if self.rx_data[0] == 0x55:
+1712                time.sleep(1)
+1713                print("Start!")
+1714                self.__send_bin(filename)
+1715            else:
+1716                print("Upgrade Response Error!")
+1717        else:
+1718            print("Upgrade Timeout!")
+
+ + +

Upgrades the firmware of the XGO Rider.

+ +

Parameters: + filename (str): The path to the firmware file.

+
+ + +
+
+ +
+ + def + rider_led(self, index, color): + + + +
+ +
1720    def rider_led(self, index, color):
+1721        """
+1722        Sets the color of an LED on the XGO Rider.
+1723
+1724        Parameters:
+1725            index (int): The index of the LED (likely 1-4 depending on hardware).
+1726            color (list): A list of three integers representing the RGB color values (0-255 each).
+1727        """
+1728        XGOorder["LED_COLOR"][0] = 0x68 + index
+1729        XGOorder["LED_COLOR"][1:4] = color
+1730        self.__send("LED_COLOR", len=3)
+
+ + +

Sets the color of an LED on the XGO Rider.

+ +

Parameters: + index (int): The index of the LED (likely 1-4 depending on hardware). + color (list): A list of three integers representing the RGB color values (0-255 each).

+
+ + +
+
+
+ + \ No newline at end of file diff --git a/xgoedu/__init__.py b/xgoedu/__init__.py index c566b04..2d601c3 100644 --- a/xgoedu/__init__.py +++ b/xgoedu/__init__.py @@ -1,34 +1,46 @@ ''' -xgo图形化python库 edu库 +xgo graphical python library edu library ''' import cv2 import numpy as np import math -import os,sys,time,json,base64 +import os, sys, time, json, base64 import spidev as SPI import xgoscreen.LCD_2inch as LCD_2inch import RPi.GPIO as GPIO -from PIL import Image,ImageDraw,ImageFont +from PIL import Image, ImageDraw, ImageFont import json import threading + # from xgolib import XGO # from keras.preprocessing import image -# import _thread 使用_thread会报错,坑! - +# import _thread # using _thread will report an error, pitfall! -__versinon__ = '1.3.6' -__last_modified__ = '2023/9/5' +__version__ = '1.5' +__last_modified__ = '2024/12/18' GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) -camera_still=False - +camera_still = False ''' -人脸检测 +Face detection ''' def getFaceBox(net, frame, conf_threshold=0.7): + """ + Detects faces in a given frame using a pre-trained deep neural network. + + Parameters: + net (cv2.dnn.Net): The pre-trained face detection model. + frame (numpy.ndarray): The input image frame. + conf_threshold (float, optional): The minimum confidence threshold for a detection to be considered a face. Defaults to 0.7. + + Returns: + tuple: A tuple containing the frame with detected faces and a list of bounding boxes. + - frameOpencvDnn (numpy.ndarray): The frame with bounding boxes drawn around detected faces. + - bboxes (list): A list of bounding boxes, where each bounding box is represented as [x1, y1, x2, y2]. + """ frameOpencvDnn = frame.copy() frameHeight = frameOpencvDnn.shape[0] frameWidth = frameOpencvDnn.shape[1] @@ -44,23 +56,32 @@ def getFaceBox(net, frame, conf_threshold=0.7): x2 = int(detections[0, 0, i, 5] * frameWidth) y2 = int(detections[0, 0, i, 6] * frameHeight) bboxes.append([x1, y1, x2, y2]) - cv2.rectangle(frameOpencvDnn, (x1, y1), (x2, y2), (0, 255, 0), int(round(frameHeight / 150)),8) + cv2.rectangle(frameOpencvDnn, (x1, y1), (x2, y2), (0, 255, 0), int(round(frameHeight / 150)), 8) return frameOpencvDnn, bboxes ''' -手势识别函数 +Gesture recognition function ''' def hand_pos(angle): + """ + Recognizes hand gestures based on finger angles. + + Parameters: + angle (list): A list of 5 finger angles (thumb, index, middle, ring, pinky). + + Returns: + str or None: The recognized hand gesture ('Good', 'Ok', 'Rock', 'Stone', '1', '3', '4', '5', '2') or None if no gesture is recognized. + """ pos = None - # 大拇指角度 + # Thumb angle f1 = angle[0] - # 食指角度 + # Index finger angle f2 = angle[1] - # 中指角度 + # Middle finger angle f3 = angle[2] - # 无名指角度 + # Ring finger angle f4 = angle[3] - # 小拇指角度 + # Pinky finger angle f5 = angle[4] if f1 < 50 and (f2 >= 50 and (f3 >= 50 and (f4 >= 50 and f5 >= 50))): pos = 'Good' @@ -81,57 +102,87 @@ def hand_pos(angle): elif f1 >= 50 and (f2 < 50 and (f3 < 50 and (f4 >= 50 and f5 >= 50))): pos = '2' return pos -def color(value): - digit = list(map(str, range(10))) + list("ABCDEF") - value = value.upper() - if isinstance(value, tuple): - string = '#' - for i in value: - a1 = i // 16 - a2 = i % 16 - string += digit[a1] + digit[a2] - return string - elif isinstance(value, str): - a1 = digit.index(value[1]) * 16 + digit.index(value[2]) - a2 = digit.index(value[3]) * 16 + digit.index(value[4]) - a3 = digit.index(value[5]) * 16 + digit.index(value[6]) - return (a3, a2, a1) - +def color(value): + """ + Converts a color value between hexadecimal and RGB tuple formats. + + Parameters: + value (str or tuple): The color value to convert. + - If a string, it should be a hexadecimal color code (e.g., '#FF0000'). + - If a tuple, it should be an RGB tuple (e.g., (255, 0, 0)). + + Returns: + str or tuple: The converted color value. + - If the input is a tuple, the output is a hexadecimal color string. + - If the input is a string, the output is an RGB tuple. + """ + digit = list(map(str, range(10))) + list("ABCDEF") + value = value.upper() + if isinstance(value, tuple): + string = '#' + for i in value: + a1 = i // 16 + a2 = i % 16 + string += digit[a1] + digit[a2] + return string + elif isinstance(value, str): + a1 = digit.index(value[1]) * 16 + digit.index(value[2]) + a2 = digit.index(value[3]) * 16 + digit.index(value[4]) + a3 = digit.index(value[5]) * 16 + digit.index(value[6]) + return (a3, a2, a1) class XGOEDU(): + """ + A class for controlling and interacting with the XGO robot's educational features, including the LCD display, camera, and various AI functions. + """ def __init__(self): + """ + Initializes the XGOEDU object, setting up the LCD display, GPIO pins, and various attributes. + """ self.display = LCD_2inch.LCD_2inch() self.display.Init() self.display.clear() - self.splash = Image.new("RGB",(320,240),"black") + self.splash = Image.new("RGB", (320, 240), "black") self.display.ShowImage(self.splash) self.draw = ImageDraw.Draw(self.splash) - self.font = ImageFont.truetype("/home/pi/model/msyh.ttc",15) - self.key1=17 - self.key2=22 - self.key3=23 - self.key4=24 - self.cap=None - self.hand=None - self.yolo=None - self.face=None - self.face_classifier=None - self.classifier=None - self.agesexmark=None - self.camera_still=False - GPIO.setup(self.key1,GPIO.IN,GPIO.PUD_UP) - GPIO.setup(self.key2,GPIO.IN,GPIO.PUD_UP) - GPIO.setup(self.key3,GPIO.IN,GPIO.PUD_UP) - GPIO.setup(self.key4,GPIO.IN,GPIO.PUD_UP) + self.font = ImageFont.truetype("/home/pi/model/msyh.ttc", 15) + self.key1 = 17 + self.key2 = 22 + self.key3 = 23 + self.key4 = 24 + self.cap = None + self.hand = None + self.yolo = None + self.face = None + self.face_classifier = None + self.classifier = None + self.agesexmark = None + self.camera_still = False + GPIO.setup(self.key1, GPIO.IN, GPIO.PUD_UP) + GPIO.setup(self.key2, GPIO.IN, GPIO.PUD_UP) + GPIO.setup(self.key3, GPIO.IN, GPIO.PUD_UP) + GPIO.setup(self.key4, GPIO.IN, GPIO.PUD_UP) def open_camera(self): - if self.cap==None: - self.cap =cv2.VideoCapture(0) - self.cap.set(3,320) - self.cap.set(4,240) + """ + Opens the camera if it's not already open. + """ + if self.cap == None: + self.cap = cv2.VideoCapture(0) + self.cap.set(3, 320) + self.cap.set(4, 240) def fetch_token(self): + """ + Fetches an access token from the Baidu AI platform. + + Returns: + str: The access token. + + Raises: + DemoError: If the API key or secret key is incorrect, or if the scope is not correct. + """ from urllib.request import urlopen from urllib.request import Request from urllib.error import URLError @@ -140,10 +191,10 @@ def fetch_token(self): SECRET_KEY = 'MqFrVgdwoM8ZuGIp0NIFF7qfYti4mjP6' TOKEN_URL = 'http://aip.baidubce.com/oauth/2.0/token' params = {'grant_type': 'client_credentials', - 'client_id': API_KEY, - 'client_secret': SECRET_KEY} + 'client_id': API_KEY, + 'client_secret': SECRET_KEY} post_data = urlencode(params) - post_data = post_data.encode( 'utf-8') + post_data = post_data.encode('utf-8') req = Request(TOKEN_URL, post_data) try: f = urlopen(req) @@ -151,224 +202,332 @@ def fetch_token(self): except URLError as err: print('token http response http code : ' + str(err.code)) result_str = err.read() - result_str = result_str.decode() + result_str = result_str.decode() - #print(result_str) + # print(result_str) result = json.loads(result_str) - #print(result) - SCOPE=False + # print(result) + SCOPE = False if ('access_token' in result.keys() and 'scope' in result.keys()): - #print(SCOPE) - if SCOPE and (not SCOPE in result['scope'].split(' ')): # SCOPE = False 忽略检查 + # print(SCOPE) + if SCOPE and (not SCOPE in result['scope'].split(' ')): # SCOPE = False ignore check raise DemoError('scope is not correct') - #print('SUCCESS WITH TOKEN: %s EXPIRES IN SECONDS: %s' % (result['access_token'], result['expires_in'])) + # print('SUCCESS WITH TOKEN: %s EXPIRES IN SECONDS: %s' % (result['access_token'], result['expires_in'])) return result['access_token'] else: raise DemoError('MAYBE API_KEY or SECRET_KEY not correct: access_token or scope not found in token response') - - - #绘画直线 + # draw a straight line ''' - x1,y1为初始点坐标,x2,y2为终止点坐标 + x1, y1 are the initial point coordinates, x2, y2 are the end point coordinates ''' - def lcd_line(self,x1,y1,x2,y2,color="WHITE",width=2): - self.draw.line([(x1,y1),(x2,y2)],fill=color ,width=width) + def lcd_line(self, x1, y1, x2, y2, color="WHITE", width=2): + """ + Draws a straight line on the LCD display. + + Parameters: + x1 (int): The x-coordinate of the starting point. + y1 (int): The y-coordinate of the starting point. + x2 (int): The x-coordinate of the ending point. + y2 (int): The y-coordinate of the ending point. + color (str, optional): The color of the line. Defaults to "WHITE". + width (int, optional): The width of the line. Defaults to 2. + """ + self.draw.line([(x1, y1), (x2, y2)], fill=color, width=width) self.display.ShowImage(self.splash) - #绘画圆 + + # draw circle ''' - x1,y1,x2,y2为定义给定边框的两个点,angle0为初始角度,angle1为终止角度 + x1, y1, x2, y2 are two points defining the given border, angle0 is the initial angle, angle1 is the end angle ''' - def lcd_circle(self,x1,y1,x2,y2,angle0,angle1,color="WHITE",width=2): - self.draw.arc((x1,y1,x2,y2),angle0,angle1,fill=color ,width=width) + def lcd_circle(self, x1, y1, x2, y2, angle0, angle1, color="WHITE", width=2): + """ + Draws a circle or an arc on the LCD display. + + Parameters: + x1 (int): The x-coordinate of the top-left corner of the bounding box. + y1 (int): The y-coordinate of the top-left corner of the bounding box. + x2 (int): The x-coordinate of the bottom-right corner of the bounding box. + y2 (int): The y-coordinate of the bottom-right corner of the bounding box. + angle0 (int): The starting angle (in degrees). + angle1 (int): The ending angle (in degrees). + color (str, optional): The color of the circle/arc. Defaults to "WHITE". + width (int, optional): The width of the circle/arc. Defaults to 2. + """ + self.draw.arc((x1, y1, x2, y2), angle0, angle1, fill=color, width=width) self.display.ShowImage(self.splash) - #绘画圆: 根据圆形点和半径画圆 + # draw a circle: draw a circle based on the circle point and radius ''' - center_x, center_y 圆心点坐标 - radius 圆半径长度 mm + center_x, center_y coordinates of the center point of the circle + radius circle radius length mm ''' - def lcd_round(self,center_x, center_y, radius, color, width=2): + def lcd_round(self, center_x, center_y, radius, color, width=2): + """ + Draws a circle on the LCD display using the center point and radius. + + Parameters: + center_x (int): The x-coordinate of the center of the circle. + center_y (int): The y-coordinate of the center of the circle. + radius (int): The radius of the circle. + color (str): The color of the circle. + width (int, optional): The width of the circle's outline. Defaults to 2. + """ # Calculate the bounding box for the circle x1 = center_x - radius y1 = center_y - radius x2 = center_x + radius y2 = center_y + radius - + # Call lcd_circle() function to draw the circle self.lcd_circle(x1, y1, x2, y2, 0, 360, color=color, width=width) - - - #绘画矩形 + # draw rectangle ''' - x1,y1为初始点坐标,x2,y2为对角线终止点坐标 + x1, y1 are the initial point coordinates, x2, y2 are the diagonal end point coordinates ''' - def lcd_rectangle(self,x1,y1,x2,y2,fill=None,outline="WHITE",width=2): - self.draw.rectangle((x1,y1,x2,y2),fill=fill,outline=outline,width=width) + def lcd_rectangle(self, x1, y1, x2, y2, fill=None, outline="WHITE", width=2): + """ + Draws a rectangle on the LCD display. + + Parameters: + x1 (int): The x-coordinate of the top-left corner. + y1 (int): The y-coordinate of the top-left corner. + x2 (int): The x-coordinate of the bottom-right corner. + y2 (int): The y-coordinate of the bottom-right corner. + fill (str, optional): The fill color of the rectangle. Defaults to None. + outline (str, optional): The outline color of the rectangle. Defaults to "WHITE". + width (int, optional): The width of the rectangle's outline. Defaults to 2. + """ + self.draw.rectangle((x1, y1, x2, y2), fill=fill, outline=outline, width=width) self.display.ShowImage(self.splash) - #清除屏幕 + + # clear the screen def lcd_clear(self): - self.splash = Image.new("RGB",(320,240),"black") + """ + Clears the LCD display. + """ + self.splash = Image.new("RGB", (320, 240), "black") self.draw = ImageDraw.Draw(self.splash) self.display.ShowImage(self.splash) - #显示图片 + + # show picture ''' - 图片的大小为320*240,jpg格式 + The size of the picture is 320*240, jpg format ''' - def lcd_picture(self,filename,x=0,y=0): - path="/home/pi/xgoPictures/" - image = Image.open(path+filename) - self.splash.paste(image,(x,y)) + def lcd_picture(self, filename, x=0, y=0): + """ + Displays an image on the LCD display. + + Parameters: + filename (str): The name of the image file (must be in the /home/pi/xgoPictures/ directory). + x (int, optional): The x-coordinate of the top-left corner where the image will be displayed. Defaults to 0. + y (int, optional): The y-coordinate of the top-left corner where the image will be displayed. Defaults to 0. + """ + path = "/home/pi/xgoPictures/" + image = Image.open(path + filename) + self.splash.paste(image, (x, y)) self.display.ShowImage(self.splash) - #显示文字 + + # display text ''' - x1,y1为初始点坐标,content为内容 + x1, y1 are the initial point coordinates, content is the content ''' - def lcd_text(self,x,y,content,color="WHITE",fontsize=15): - if fontsize!=15: - self.font = ImageFont.truetype("/home/pi/model/msyh.ttc",fontsize) - self.draw.text((x,y),content,fill=color,font=self.font) + def lcd_text(self, x, y, content, color="WHITE", fontsize=15): + """ + Displays text on the LCD display. + + Parameters: + x (int): The x-coordinate of the top-left corner of the text. + y (int): The y-coordinate of the top-left corner of the text. + content (str): The text to display. + color (str, optional): The color of the text. Defaults to "WHITE". + fontsize (int, optional): The font size of the text. Defaults to 15. + """ + if fontsize != 15: + self.font = ImageFont.truetype("/home/pi/model/msyh.ttc", fontsize) + self.draw.text((x, y), content, fill=color, font=self.font) self.display.ShowImage(self.splash) - #流式显示所有文字 + + # streaming display all text ''' - x1,y1为初始点坐标,content为内容 - 遇到回车符自动换行,遇到边缘换行,一页满了自动清屏,2,2开始继续显示 + x1, y1 are the initial point coordinates, content is the content + Automatically wrap when encountering a carriage return character, wrap when encountering the edge, and automatically clear the screen when a page is full, 2, 2 continue to display ''' - def display_text_on_screen(self, content, color, start_x=2, start_y=2, font_size=20, screen_width=320, screen_height=240): - # 计算每行可显示字符的数量和行数 - char_width = font_size +1 #// 2 + def display_text_on_screen(self, content, color, start_x=2, start_y=2, font_size=20, screen_width=320, + screen_height=240): + """ + Displays text on the screen with automatic wrapping and page breaks. + + Parameters: + content (str): The text content to display. + color (str): The color of the text. + start_x (int, optional): The x-coordinate of the starting position. Defaults to 2. + start_y (int, optional): The y-coordinate of the starting position. Defaults to 2. + font_size (int, optional): The font size. Defaults to 20. + screen_width (int, optional): The width of the screen. Defaults to 320. + screen_height (int, optional): The height of the screen. Defaults to 240. + """ + # Calculate the number of characters that can be displayed per line and the number of lines + char_width = font_size + 1 # // 2 chars_per_line = screen_width // char_width lines = screen_height // char_width - - # 拆分内容为逐个字符的列表 + + # Split the content into a list of individual characters chars = list(content) - - # 处理换行符 + + # Handle newline characters line_break_indices = [i for i, char in enumerate(chars) if char == '\n'] - - - # 计算总行数和页数 + + # Calculate the total number of lines and pages total_lines = len(chars) // chars_per_line + 1 - total_pages = (total_lines - 1+len(line_break_indices)) // lines + 1 - - # 清屏 + total_pages = (total_lines - 1 + len(line_break_indices)) // lines + 1 + + # Clear the screen self.display.clear() - - # 逐行显示文字 + + # Display the text line by line current_page = 1 current_line = 1 current_char = 0 - - while current_page <= total_pages or current_char < len(chars) : + + while current_page <= total_pages or current_char < len(chars): self.display.clear() - # 计算当前页要显示的行数 - if current_page < total_pages or current_char < len(chars) : + # Calculate the number of lines to display on the current page + if current_page < total_pages or current_char < len(chars): lines_to_display = lines else: lines_to_display = (total_lines - 1) % lines + 1 - + current_line = 1 - # 显示当前页的内容 + # Display the content of the current page for line in range(lines_to_display): current_x = start_x - current_y = start_y + current_line * char_width # font_size - current_line +=1 + current_y = start_y + current_line * char_width # font_size + current_line += 1 if current_line >= lines: break - - # 显示当前行的文字 + + # Show the text of the current line for _ in range(chars_per_line): - # 检查是否所有字符都已显示完毕 + # Check if all characters have been displayed if current_char >= len(chars): break - + char = chars[current_char] if char == '\n': current_x = start_x - current_y = start_y + current_line * char_width # font_size - current_line +=1 - + current_y = start_y + current_line * char_width # font_size + current_line += 1 + self.lcd_text(current_x, current_y, char, color, font_size) current_char += 1 break # continue - + self.lcd_text(current_x, current_y, char, color, font_size) current_x += char_width current_char += 1 - - # 检查是否所有字符都已显示完毕 + + # Check if all characters have been displayed if current_char >= len(chars): break - - # 更新当前页和当前行 + + # Update current page and current line current_page += 1 current_line += lines_to_display - - # 等待显示时间或手动触发翻页 - # 这里可以根据需要添加适当的延时代码或触发翻页的机制 - - # 如果内容超过一屏幕,则清屏 + + # Wait for display time or manually trigger page turning + # Here you can add appropriate delay code or a mechanism to trigger page turning as needed + + # If the content exceeds one screen, clear the screen # if total_lines > lines: if current_page < total_pages: self.display.clear() - - #key_value + + # key_value ''' - a左上按键 - b右上按键 - c左下按键 - d右下按键 - 返回值 0未按下,1按下 + a upper left button + b upper right button + c lower left button + d lower right button + Return value 0 not pressed, 1 pressed ''' - def xgoButton(self,button): + def xgoButton(self, button): + """ + Checks the state of a button. + + Parameters: + button (str): The button to check ('a', 'b', 'c', or 'd'). + + Returns: + bool: True if the button is pressed, False otherwise. + """ if button == "a": - last_state_a =GPIO.input(self.key1) + last_state_a = GPIO.input(self.key1) time.sleep(0.02) - return(not last_state_a) + return (not last_state_a) elif button == "b": - last_state_b=GPIO.input(self.key2) + last_state_b = GPIO.input(self.key2) time.sleep(0.02) - return(not last_state_b) + return (not last_state_b) elif button == "c": - last_state_c=GPIO.input(self.key3) + last_state_c = GPIO.input(self.key3) time.sleep(0.02) - return(not last_state_c) + return (not last_state_c) elif button == "d": - last_state_d=GPIO.input(self.key4) + last_state_d = GPIO.input(self.key4) time.sleep(0.02) - return(not last_state_d) - #speaker + return (not last_state_d) + + # speaker ''' - filename 文件名 字符串 + filename file name string ''' - def xgoSpeaker(self,filename): - path="/home/pi/xgoMusic/" - os.system("mplayer"+" "+path+filename) - - def xgoVideoAudio(self,filename): - path="/home/pi/xgoVideos/" - time.sleep(0.2) #音画速度同步了 但是时间轴可能不同步 这里调试一下 - cmd="sudo mplayer "+path+filename+" -novideo" + def xgoSpeaker(self, filename): + """ + Plays an audio file using mplayer. + + Parameters: + filename (str): The name of the audio file (must be in the /home/pi/xgoMusic/ directory). + """ + path = "/home/pi/xgoMusic/" + os.system("mplayer" + " " + path + filename) + + def xgoVideoAudio(self, filename): + """ + Plays the audio track of a video file using mplayer. + + Parameters: + filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory). + """ + path = "/home/pi/xgoVideos/" + time.sleep(0.2) # Synchronize sound and picture speed, but the timeline may not be synchronized. Adjust here. + cmd = "sudo mplayer " + path + filename + " -novideo" os.system(cmd) - def xgoVideo(self,filename): - path="/home/pi/xgoVideos/" - x=threading.Thread(target=self.xgoVideoAudio,args=(filename,)) + def xgoVideo(self, filename): + """ + Plays a video file on the LCD display while simultaneously playing its audio track in a separate thread. + + Parameters: + filename (str): The name of the video file (must be in the /home/pi/xgoVideos/ directory). + """ + path = "/home/pi/xgoVideos/" + x = threading.Thread(target=self.xgoVideoAudio, args=(filename,)) x.start() global counter - video=cv2.VideoCapture(path+filename) - print(path+filename) - fps = video.get(cv2.CAP_PROP_FPS) + video = cv2.VideoCapture(path + filename) + print(path + filename) + fps = video.get(cv2.CAP_PROP_FPS) print(fps) - init_time=time.time() - counter=0 + init_time = time.time() + counter = 0 while True: grabbed, dst = video.read() try: - b,g,r = cv2.split(dst) - dst = cv2.merge((r,g,b)) + b, g, r = cv2.split(dst) + dst = cv2.merge((r, g, b)) except: pass try: @@ -376,221 +535,265 @@ def xgoVideo(self,filename): except: break self.display.ShowImage(imgok) - #强制卡帧数 实测帧数不要超过20贞 否则显示跟不上 但是20贞转换经常有问题 所以建议直接15贞 + # Force frame rate. It is recommended that the frame rate should not exceed 20 frames, otherwise the display will not keep up, but 20 frames often have problems, so it is recommended to directly use 15 frames. counter += 1 - ctime=time.time()- init_time + ctime = time.time() - init_time if ctime != 0: - qtime=counter/fps-ctime - #print(qtime) - if qtime>0: + qtime = counter / fps - ctime + # print(qtime) + if qtime > 0: time.sleep(qtime) if not grabbed: break - - #audio_record + + # audio_record ''' - filename 文件名 字符串 - seconds 录制时间S 字符串 + filename file name string + seconds recording time S string ''' - def xgoAudioRecord(self,filename="record",seconds=5): - path="/home/pi/xgoMusic/" + def xgoAudioRecord(self, filename="record", seconds=5): + """ + Records audio for a specified duration and saves it as a WAV file. + + Parameters: + filename (str, optional): The name of the output audio file. Defaults to "record". + seconds (int, optional): The recording duration in seconds. Defaults to 5. + """ + path = "/home/pi/xgoMusic/" command1 = "sudo arecord -d" command2 = "-f S32_LE -r 8000 -c 1 -t wav" - cmd=command1+" "+str(seconds)+" "+command2+" "+path+filename+".wav" + cmd = command1 + " " + str(seconds) + " " + command2 + " " + path + filename + ".wav" print(cmd) os.system(cmd) - def xgoCamera(self,switch): + def xgoCamera(self, switch): + """ + Turns the camera on or off and displays the camera feed on the LCD. + + Parameters: + switch (bool): True to turn the camera on, False to turn it off. + """ global camera_still if switch: self.open_camera() - self.camera_still=True - t = threading.Thread(target=self.camera_mode) - t.start() + self.camera_still = True + t = threading.Thread(target=self.camera_mode) + t.start() else: - self.camera_still=False + self.camera_still = False time.sleep(0.5) - splash = Image.new("RGB",(320,240),"black") + splash = Image.new("RGB", (320, 240), "black") self.display.ShowImage(splash) def camera_mode(self): - self.camera_still=True + """ + Continuously captures and displays the camera feed on the LCD until camera_still is set to False. + """ + self.camera_still = True while 1: - success,image = self.cap.read() - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) - image = cv2.flip(image,1) + success, image = self.cap.read() + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) + image = cv2.flip(image, 1) imgok = Image.fromarray(image) self.display.ShowImage(imgok) if not self.camera_still: break - def xgoVideoRecord(self,filename="record",seconds=5): - path="/home/pi/xgoVideos/" - self.camera_still=False + def xgoVideoRecord(self, filename="record", seconds=5): + """ + Records a video for a specified duration, displays it on the LCD, and saves it as an MP4 file. + + Parameters: + filename (str, optional): The name of the output video file. Defaults to "record". + seconds (int, optional): The recording duration in seconds. Defaults to 5. + """ + path = "/home/pi/xgoVideos/" + self.camera_still = False time.sleep(0.6) self.open_camera() - FPS=15 + FPS = 15 fourcc = cv2.VideoWriter_fourcc(*'mp4v') width = int(self.cap.get(cv2.CAP_PROP_FRAME_WIDTH)) height = int(self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) - videoWrite = cv2.VideoWriter(path+filename+'.mp4', fourcc, FPS, (width,height)) - starttime=time.time() + videoWrite = cv2.VideoWriter(path + filename + '.mp4', fourcc, FPS, (width, height)) + starttime = time.time() while 1: print('recording...') ret, image = self.cap.read() if not ret: break videoWrite.write(image) - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) - image = cv2.flip(image,1) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) + image = cv2.flip(image, 1) imgok = Image.fromarray(image) self.display.ShowImage(imgok) - if time.time()-starttime>seconds: + if time.time() - starttime > seconds: break print('recording done') self.xgoCamera(True) videoWrite.release() - def xgoTakePhoto(self,filename="photo"): - path="/home/pi/xgoPictures/" - self.camera_still=False + def xgoTakePhoto(self, filename="photo"): + """ + Takes a photo, displays it on the LCD, and saves it as a JPG file. + + Parameters: + filename (str, optional): The name of the output image file. Defaults to "photo". + """ + path = "/home/pi/xgoPictures/" + self.camera_still = False time.sleep(0.6) self.open_camera() - success,image = self.cap.read() - cv2.imwrite(path+filename+'.jpg',image) + success, image = self.cap.read() + cv2.imwrite(path + filename + '.jpg', image) if not success: print("Ignoring empty camera frame") - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) - image = cv2.flip(image,1) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) + image = cv2.flip(image, 1) imgok = Image.fromarray(image) self.display.ShowImage(imgok) print('photo writed!') time.sleep(0.7) self.xgoCamera(True) - ''' - 开启摄像头 A键拍照 B键录像 C键退出 + Turn on the camera, take a photo with the A button, record a video with the B button, and exit with the C button ''' - def camera(self,filename="camera"): - font = ImageFont.truetype("/home/pi/model/msyh.ttc",20) + def camera(self, filename="camera"): + """ + Activates the camera and allows the user to take photos, record videos, or exit using the A, B, and C buttons, respectively. + + Parameters: + filename (str, optional): The base filename for photos and videos. Defaults to "camera". + """ + font = ImageFont.truetype("/home/pi/model/msyh.ttc", 20) self.open_camera() while True: - success,image = self.cap.read() - #cv2.imwrite('/home/pi/xgoEdu/camera/file.jpg',image) + success, image = self.cap.read() + # cv2.imwrite('/home/pi/xgoEdu/camera/file.jpg',image) if not success: print("Ignoring empty camera frame") continue - #cv2.imshow('frame',image) - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) - image = cv2.flip(image,1) + # cv2.imshow('frame',image) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) + image = cv2.flip(image, 1) imgok = Image.fromarray(image) self.display.ShowImage(imgok) if cv2.waitKey(5) & 0xFF == 27: XGOEDU.lcd_clear(self) time.sleep(0.5) break - if XGOEDU.xgoButton(self,"a"): - draw=ImageDraw.Draw(imgok) - cv2.imwrite(filename+'.jpg',image) + if XGOEDU.xgoButton(self, "a"): + draw = ImageDraw.Draw(imgok) + cv2.imwrite(filename + '.jpg', image) print('photo writed!') - draw.text((5,5),filename+'.jpg saved!',fill=(255,0,0),font=font) + draw.text((5, 5), filename + '.jpg saved!', fill=(255, 0, 0), font=font) self.display.ShowImage(imgok) time.sleep(1) - if XGOEDU.xgoButton(self,"b"): - FPS=15 + if XGOEDU.xgoButton(self, "b"): + FPS = 15 fourcc = cv2.VideoWriter_fourcc(*'mp4v') width = int(self.cap.get(cv2.CAP_PROP_FRAME_WIDTH)) height = int(self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) - videoWrite = cv2.VideoWriter(filename+'.mp4', fourcc, FPS, (width,height)) + videoWrite = cv2.VideoWriter(filename + '.mp4', fourcc, FPS, (width, height)) while 1: ret, image = self.cap.read() if not ret: break videoWrite.write(image) - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) - image = cv2.flip(image,1) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) + image = cv2.flip(image, 1) imgok = Image.fromarray(image) - draw=ImageDraw.Draw(imgok) - draw.text((5,5),'recording',fill=(255,0,0),font=font) + draw = ImageDraw.Draw(imgok) + draw.text((5, 5), 'recording', fill=(255, 0, 0), font=font) self.display.ShowImage(imgok) if cv2.waitKey(33) & 0xFF == ord('q'): break - if XGOEDU.xgoButton(self,"b"): + if XGOEDU.xgoButton(self, "b"): break time.sleep(1) videoWrite.release() - if XGOEDU.xgoButton(self,"c"): + if XGOEDU.xgoButton(self, "c"): XGOEDU.lcd_clear(self) time.sleep(0.5) break + ''' - 骨骼识别 + Skeletal recognition ''' - def posenetRecognition(self,target="camera"): + def posenetRecognition(self, target="camera"): + """ + Performs skeletal (pose) recognition on an image or video frame and displays the results on the LCD. + + Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + + Returns: + list or None: A list of angles between key body joints if successful, or None if no pose is detected. + """ import mediapipe as mp mp_pose = mp.solutions.pose ges = '' mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles mp_holistic = mp.solutions.holistic - joint_list = [[24,26,28], [23,25,27], [14,12,24], [13,11,23]] # leg&arm - if target=="camera": + joint_list = [[24, 26, 28], [23, 25, 27], [14, 12, 24], [13, 11, 23]] # leg&arm + if target == "camera": self.open_camera() - success,image = self.cap.read() + success, image = self.cap.read() else: - image=np.array(Image.open(target)) + image = np.array(Image.open(target)) with mp_pose.Pose( min_detection_confidence=0.5, min_tracking_confidence=0.5) as pose: - image.flags.writeable = False - image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) - results = pose.process(image) - - # Draw the pose annotation on the image. - image.flags.writeable = True - image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) - mp_drawing.draw_landmarks( - image, - results.pose_landmarks, - mp_pose.POSE_CONNECTIONS, - landmark_drawing_spec=mp_drawing_styles.get_default_pose_landmarks_style()) - # Flip the image horizontally for a selfie-view display. - - if results.pose_landmarks: - RHL = results.pose_landmarks - angellist=[] - for joint in joint_list: - a = np.array([RHL.landmark[joint[0]].x, RHL.landmark[joint[0]].y]) - b = np.array([RHL.landmark[joint[1]].x, RHL.landmark[joint[1]].y]) - c = np.array([RHL.landmark[joint[2]].x, RHL.landmark[joint[2]].y]) - radians_fingers = np.arctan2(c[1] - b[1], c[0] - b[0]) - np.arctan2(a[1] - b[1], a[0] - b[0]) - angle = np.abs(radians_fingers * 180.0 / np.pi) - if angle > 180.0: - angle = 360 - angle - #cv2.putText(image, str(round(angle, 2)), tuple(np.multiply(b, [640, 480]).astype(int)),cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA) - angellist.append(angle) - else: - angellist=[] - print(angellist) - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) - image = cv2.flip(image, 1) - try: - ges=str(int(angellist[0]))+'|'+str(int(angellist[1]))+'|'+str(int(angellist[2]))+'|'+str(int(angellist[3])) - except: - ges=' ' - cv2.putText(image,ges,(10,220),cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA) - imgok = Image.fromarray(image) - self.display.ShowImage(imgok) - + image.flags.writeable = False + image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) + results = pose.process(image) + + # Draw the pose annotation on the image. + image.flags.writeable = True + image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) + mp_drawing.draw_landmarks( + image, + results.pose_landmarks, + mp_pose.POSE_CONNECTIONS, + landmark_drawing_spec=mp_drawing_styles.get_default_pose_landmarks_style()) + # Flip the image horizontally for a selfie-view display. + + if results.pose_landmarks: + RHL = results.pose_landmarks + angellist = [] + for joint in joint_list: + a = np.array([RHL.landmark[joint[0]].x, RHL.landmark[joint[0]].y]) + b = np.array([RHL.landmark[joint[1]].x, RHL.landmark[joint[1]].y]) + c = np.array([RHL.landmark[joint[2]].x, RHL.landmark[joint[2]].y]) + radians_fingers = np.arctan2(c[1] - b[1], c[0] - b[0]) - np.arctan2(a[1] - b[1], a[0] - b[0]) + angle = np.abs(radians_fingers * 180.0 / np.pi) + if angle > 180.0: + angle = 360 - angle + # cv2.putText(image, str(round(angle, 2)), tuple(np.multiply(b, [640, 480]).astype(int)),cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA) + angellist.append(angle) + else: + angellist = [] + print(angellist) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) + image = cv2.flip(image, 1) + try: + ges = str(int(angellist[0])) + '|' + str(int(angellist[1])) + '|' + str(int(angellist[2])) + '|' + str( + int(angellist[3])) + except: + ges = ' ' + cv2.putText(image, ges, (10, 220), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2, cv2.LINE_AA) + imgok = Image.fromarray(image) + self.display.ShowImage(imgok) # datas = self.hand.run(image) # b,g,r = cv2.split(image) @@ -613,96 +816,134 @@ def posenetRecognition(self,target="camera"): # XGOEDU.circle(self,image,i,3,"#ff9900",-1) # imgok = Image.fromarray(image) # self.display.ShowImage(imgok) - if angellist==[]: + if angellist == []: return None else: return angellist ''' - 手势识别 + Gesture recognition ''' - def gestureRecognition(self,target="camera"): + def gestureRecognition(self, target="camera"): + """ + Performs hand gesture recognition on an image or video frame and displays the results on the LCD. + + Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + + Returns: + tuple or None: A tuple containing the recognized gesture (str) and the center coordinates of the hand if successful, or None if no gesture is recognized. + """ ges = '' - if self.hand==None: - self.hand = hands(0,2,0.6,0.5) - if target=="camera": + if self.hand == None: + self.hand = hands(0, 2, 0.6, 0.5) + if target == "camera": self.open_camera() - success,image = self.cap.read() + success, image = self.cap.read() else: - image=np.array(Image.open(target)) - image = cv2.flip(image,1) + image = np.array(Image.open(target)) + image = cv2.flip(image, 1) datas = self.hand.run(image) - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) for data in datas: rect = data['rect'] right_left = data['right_left'] center = data['center'] dlandmark = data['dlandmark'] hand_angle = data['hand_angle'] - XGOEDU.rectangle(self,image,rect,"#33cc00",2) - #XGOEDU.text(self,image,right_left,center,2,"#cc0000",5) + XGOEDU.rectangle(self, image, rect, "#33cc00", 2) + # XGOEDU.text(self,image,right_left,center,2,"#cc0000",5) if right_left == 'L': - XGOEDU.text(self,image,hand_pos(hand_angle),(180,80),1.5,"#33cc00",2) + XGOEDU.text(self, image, hand_pos(hand_angle), (180, 80), 1.5, "#33cc00", 2) elif right_left == 'R': - XGOEDU.text(self,image,hand_pos(hand_angle),(50,80),1.5,"#ff0000",2) + XGOEDU.text(self, image, hand_pos(hand_angle), (50, 80), 1.5, "#ff0000", 2) ges = hand_pos(hand_angle) for i in dlandmark: - XGOEDU.circle(self,image,i,3,"#ff9900",-1) + XGOEDU.circle(self, image, i, 3, "#ff9900", -1) imgok = Image.fromarray(image) self.display.ShowImage(imgok) - if ges=='': + if ges == '': return None else: - return(ges,center) + return (ges, center) + ''' yolo ''' - def yoloFast(self,target="camera"): - ret='' + def yoloFast(self, target="camera"): + """ + Performs object detection using YOLO on an image or video frame and displays the results on the LCD. + + Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + + Returns: + tuple or None: A tuple containing the detected class (str) and the bounding box coordinates if successful, or None if no object is detected. + """ + ret = '' self.open_camera() - if self.yolo==None: + if self.yolo == None: self.yolo = yoloXgo('/home/pi/model/Model.onnx', - ['person','bicycle','car','motorbike','aeroplane','bus','train','truck','boat','traffic light','fire hydrant','stop sign','parking meter','bench','bird','cat','dog','horse','sheep','cow','elephant','bear','zebra','giraffe','backpack','umbrella','handbag','tie','suitcase','frisbee','skis','snowboard','sports ball','kite','baseball bat','baseball glove','skateboard','surfboard','tennis racket','bottle','wine glass','cup','fork','knife','spoon','bowl','banana','apple','sandwich','orange','broccoli','carrot','hot dog','pizza','donut','cake','chair','sofa','pottedplant','bed','diningtable','toilet','tvmonitor','laptop','mouse','remote','keyboard','cell phone','microwave','oven','toaster','sink','refrigerator','book','clock','vase','scissors','teddy bear','hair drier','toothbrush'], - [352,352],0.66) - if target=="camera": + ['person', 'bicycle', 'car', 'motorbike', 'aeroplane', 'bus', 'train', 'truck', 'boat', + 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', + 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', + 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball', + 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket', + 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple', + 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', + 'sofa', 'pottedplant', 'bed', 'diningtable', 'toilet', 'tvmonitor', 'laptop', 'mouse', + 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink', + 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier', + 'toothbrush'], + [352, 352], 0.66) + if target == "camera": self.open_camera() - success,image = self.cap.read() + success, image = self.cap.read() else: - image=np.array(Image.open(target)) + image = np.array(Image.open(target)) datas = self.yolo.run(image) - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) - image = cv2.flip(image,1) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) + image = cv2.flip(image, 1) if datas: for data in datas: - XGOEDU.rectangle(self,image,data['xywh'],"#33cc00",2) - xy= (data['xywh'][0], data['xywh'][1]) - XGOEDU.text(self,image,data['classes'],xy,1,"#ff0000",2) + XGOEDU.rectangle(self, image, data['xywh'], "#33cc00", 2) + xy = (data['xywh'][0], data['xywh'][1]) + XGOEDU.text(self, image, data['classes'], xy, 1, "#ff0000", 2) value_yolo = data['classes'] - ret=(value_yolo,xy) + ret = (value_yolo, xy) imgok = Image.fromarray(image) self.display.ShowImage(imgok) - if ret=='': + if ret == '': return None else: return ret ''' - 人脸坐标点检测 + Face detection (coordinate points) ''' - def face_detect(self,target="camera"): - ret='' - if self.face==None: + def face_detect(self, target="camera"): + """ + Performs face detection (including facial landmarks) on an image or video frame and displays the results on the LCD. + + Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + + Returns: + list or None: A list of bounding box coordinates [x, y, w, h] of detected faces if successful, or None if no face is detected. + """ + ret = '' + if self.face == None: self.face = face_detection(0.7) - if target=="camera": + if target == "camera": self.open_camera() - success,image = self.cap.read() + success, image = self.cap.read() else: - image=np.array(Image.open(target)) - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) - image = cv2.flip(image,1) + image = np.array(Image.open(target)) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) + image = cv2.flip(image, 1) datas = self.face.run(image) for data in datas: lefteye = str(data['left_eye']) @@ -711,88 +952,106 @@ def face_detect(self,target="camera"): mouth = str(data['mouth']) leftear = str(data['left_ear']) rightear = str(data['right_ear']) - cv2.putText(image,'lefteye',(10,30),cv2.FONT_HERSHEY_SIMPLEX,0.7,(255,0,0),2) - cv2.putText(image,lefteye,(100,30),cv2.FONT_HERSHEY_SIMPLEX,0.7,(255,0,0),2) - cv2.putText(image,'righteye',(10,50),cv2.FONT_HERSHEY_SIMPLEX,0.7,(0,255,0),2) - cv2.putText(image,righteye,(100,50),cv2.FONT_HERSHEY_SIMPLEX,0.7,(0,255,0),2) - cv2.putText(image,'nose',(10,70),cv2.FONT_HERSHEY_SIMPLEX,0.7,(0,0,255),2) - cv2.putText(image,nose,(100,70),cv2.FONT_HERSHEY_SIMPLEX,0.7,(0,0,255),2) - cv2.putText(image,'leftear',(10,90),cv2.FONT_HERSHEY_SIMPLEX,0.7,(255,255,0),2) - cv2.putText(image,leftear,(100,90),cv2.FONT_HERSHEY_SIMPLEX,0.7,(255,255,0),2) - cv2.putText(image,'rightear',(10,110),cv2.FONT_HERSHEY_SIMPLEX,0.7,(200,0,200),2) - cv2.putText(image,rightear,(100,110),cv2.FONT_HERSHEY_SIMPLEX,0.7,(200,0,200),2) - XGOEDU.rectangle(self,image,data['rect'],"#33cc00",2) - ret=data['rect'] + cv2.putText(image, 'lefteye', (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2) + cv2.putText(image, lefteye, (100, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2) + cv2.putText(image, 'righteye', (10, 50), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2) + cv2.putText(image, righteye, (100, 50), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2) + cv2.putText(image, 'nose', (10, 70), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) + cv2.putText(image, nose, (100, 70), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) + cv2.putText(image, 'leftear', (10, 90), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 0), 2) + cv2.putText(image, leftear, (100, 90), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 255, 0), 2) + cv2.putText(image, 'rightear', (10, 110), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (200, 0, 200), 2) + cv2.putText(image, rightear, (100, 110), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (200, 0, 200), 2) + XGOEDU.rectangle(self, image, data['rect'], "#33cc00", 2) + ret = data['rect'] imgok = Image.fromarray(image) self.display.ShowImage(imgok) - if ret=='': + if ret == '': return None else: return ret ''' - 情绪识别 + Emotion recognition ''' - def emotion(self,target="camera"): - ret='' - if self.classifier==None: + def emotion(self, target="camera"): + """ + Performs emotion recognition on an image or video frame and displays the results on the LCD. + + Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + + Returns: + tuple or None: A tuple containing the detected emotion (str) and the bounding box coordinates (x, y) of the face if successful, or None if no face or emotion is detected. + """ + ret = '' + if self.classifier == None: from keras.models import load_model - self.face_classifier=cv2.CascadeClassifier('/home/pi/model/haarcascade_frontalface_default.xml') + self.face_classifier = cv2.CascadeClassifier('/home/pi/model/haarcascade_frontalface_default.xml') self.classifier = load_model('/home/pi/model/EmotionDetectionModel.h5') - class_labels=['Angry','Happy','Neutral','Sad','Surprise'] - if target=="camera": + class_labels = ['Angry', 'Happy', 'Neutral', 'Sad', 'Surprise'] + if target == "camera": self.open_camera() - success,image = self.cap.read() + success, image = self.cap.read() else: - image=np.array(Image.open(target)) - labels=[] - gray=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) - faces=self.face_classifier.detectMultiScale(gray,1.3,5) - label='' - for (x,y,w,h) in faces: - cv2.rectangle(image,(x,y),(x+w,y+h),(255,0,0),2) - roi_gray=gray[y:y+h,x:x+w] - roi_gray=cv2.resize(roi_gray,(48,48),interpolation=cv2.INTER_AREA) - if np.sum([roi_gray])!=0: + image = np.array(Image.open(target)) + labels = [] + gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) + faces = self.face_classifier.detectMultiScale(gray, 1.3, 5) + label = '' + for (x, y, w, h) in faces: + cv2.rectangle(image, (x, y), (x + w, y + h), (255, 0, 0), 2) + roi_gray = gray[y:y + h, x:x + w] + roi_gray = cv2.resize(roi_gray, (48, 48), interpolation=cv2.INTER_AREA) + if np.sum([roi_gray]) != 0: from tensorflow.keras.utils import img_to_array - roi=roi_gray.astype('float')/255.0 - roi=img_to_array(roi) - roi=np.expand_dims(roi,axis=0) + roi = roi_gray.astype('float') / 255.0 + roi = img_to_array(roi) + roi = np.expand_dims(roi, axis=0) - preds=self.classifier.predict(roi)[0] - label=class_labels[preds.argmax()] - ret=(label,(x,y)) + preds = self.classifier.predict(roi)[0] + label = class_labels[preds.argmax()] + ret = (label, (x, y)) else: pass - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) image = cv2.flip(image, 1) try: - cv2.putText(image,label,label_position,cv2.FONT_HERSHEY_SIMPLEX,1,(0,255,0),3) + cv2.putText(image, label, label_position, cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 3) except: pass imgok = Image.fromarray(image) self.display.ShowImage(imgok) - if ret=='': + if ret == '': return None else: return ret ''' - 年纪及性别检测 + Age and gender detection ''' - def agesex(self,target="camera"): - ret='' + def agesex(self, target="camera"): + """ + Performs age and gender detection on an image or video frame and displays the results on the LCD. + + Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + + Returns: + tuple or None: A tuple containing the detected gender (str), age (str), and the bounding box coordinates (x, y) of the face if successful, or None if no face, gender, or age is detected. + """ + ret = '' MODEL_MEAN_VALUES = (78.4263377603, 87.7689143744, 114.895847746) ageList = ['(0-2)', '(4-6)', '(8-12)', '(15-20)', '(25-32)', '(38-43)', '(48-53)', '(60-100)'] genderList = ['Male', 'Female'] padding = 20 - if target=="camera": + if target == "camera": self.open_camera() - success,image = self.cap.read() + success, image = self.cap.read() else: - image=np.array(Image.open(target)) - if self.agesexmark==None: + image = np.array(Image.open(target)) + if self.agesexmark == None: faceProto = "/home/pi/model/opencv_face_detector.pbtxt" faceModel = "/home/pi/model/opencv_face_detector_uint8.pb" ageProto = "/home/pi/model/age_deploy.prototxt" @@ -802,67 +1061,115 @@ def agesex(self,target="camera"): self.ageNet = cv2.dnn.readNet(ageModel, ageProto) self.genderNet = cv2.dnn.readNet(genderModel, genderProto) self.faceNet = cv2.dnn.readNet(faceModel, faceProto) - self.agesexmark=True + self.agesexmark = True image = cv2.flip(image, 1) frameFace, bboxes = getFaceBox(self.faceNet, image) - gender='' - age='' + gender = '' + age = '' for bbox in bboxes: face = image[max(0, bbox[1] - padding):min(bbox[3] + padding, image.shape[0] - 1), - max(0, bbox[0] - padding):min(bbox[2] + padding, image.shape[1] - 1)] + max(0, bbox[0] - padding):min(bbox[2] + padding, image.shape[1] - 1)] blob = cv2.dnn.blobFromImage(face, 1.0, (227, 227), MODEL_MEAN_VALUES, swapRB=False) - self.genderNet.setInput(blob) - genderPreds = self.genderNet.forward() - gender = genderList[genderPreds[0].argmax()] + self.genderNet.setInput(blob) + genderPreds = self.genderNet.forward() + gender = genderList[genderPreds[0].argmax()] self.ageNet.setInput(blob) agePreds = self.ageNet.forward() age = ageList[agePreds[0].argmax()] label = "{},{}".format(gender, age) - cv2.putText(frameFace, label, (bbox[0], bbox[1] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 255, 255), 2,cv2.LINE_AA) - ret=(gender,age,(bbox[0], bbox[1])) - b,g,r = cv2.split(frameFace) - frameFace = cv2.merge((r,g,b)) + cv2.putText(frameFace, label, (bbox[0], bbox[1] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 255, 255), 2, + cv2.LINE_AA) + ret = (gender, age, (bbox[0], bbox[1])) + b, g, r = cv2.split(frameFace) + frameFace = cv2.merge((r, g, b)) imgok = Image.fromarray(frameFace) self.display.ShowImage(imgok) - if ret=='': + if ret == '': return None else: return ret - - def rectangle(self,frame,z,colors,size): - frame=cv2.rectangle(frame,(int(z[0]),int(z[1])),(int(z[0]+z[2]),int(z[1]+z[3])),color(colors),size) + def rectangle(self, frame, z, colors, size): + """ + Draws a rectangle on a given frame. + + Parameters: + frame (numpy.ndarray): The image frame to draw on. + z (tuple): A tuple of four integers (x, y, w, h) representing the top-left corner, width, and height of the rectangle. + colors (str): The color of the rectangle in hexadecimal format (e.g., "#FF0000" for red). + size (int): The thickness of the rectangle's outline. + + Returns: + numpy.ndarray: The frame with the rectangle drawn on it. + """ + frame = cv2.rectangle(frame, (int(z[0]), int(z[1])), (int(z[0] + z[2]), int(z[1] + z[3])), color(colors), size) + return frame + + def circle(self, frame, xy, rad, colors, tk): + """ + Draws a circle on a given frame. + + Parameters: + frame (numpy.ndarray): The image frame to draw on. + xy (tuple): A tuple of two integers (x, y) representing the center coordinates of the circle. + rad (int): The radius of the circle. + colors (str): The color of the circle in hexadecimal format. + tk (int): The thickness of the circle's outline. Use -1 to fill the circle. + + Returns: + numpy.ndarray: The frame with the circle drawn on it. + """ + frame = cv2.circle(frame, xy, rad, color(colors), tk) return frame - - def circle(self,frame,xy,rad,colors,tk): - frame=cv2.circle(frame,xy,rad,color(colors),tk) + + def text(self, frame, text, xy, font_size, colors, size): + """ + Draws text on a given frame. + + Parameters: + frame (numpy.ndarray): The image frame to draw on. + text (str): The text to be drawn. + xy (tuple): A tuple of two integers (x, y) representing the top-left corner of the text. + font_size (float): The font size of the text. + colors (str): The color of the text in hexadecimal format. + size (int): The thickness of the text. + + Returns: + numpy.ndarray: The frame with the text drawn on it. + """ + frame = cv2.putText(frame, text, xy, cv2.FONT_HERSHEY_SIMPLEX, font_size, color(colors), size) return frame - - def text(self,frame,text,xy,font_size,colors,size): - frame=cv2.putText(frame,text,xy,cv2.FONT_HERSHEY_SIMPLEX,font_size,color(colors),size) - return frame - def SpeechRecognition(self,seconds=3): - self.xgoAudioRecord(filename="recog",seconds=seconds) + def SpeechRecognition(self, seconds=3): + """ + Performs speech recognition using the Baidu ASR API. + + Parameters: + seconds (int, optional): The duration of the audio recording in seconds. Defaults to 3. + + Returns: + str: The recognized text. + """ + self.xgoAudioRecord(filename="recog", seconds=seconds) from urllib.request import urlopen from urllib.request import Request from urllib.error import URLError from urllib.parse import urlencode timer = time.perf_counter - AUDIO_FILE = 'recog.wav' - FORMAT = AUDIO_FILE[-3:] + AUDIO_FILE = 'recog.wav' + FORMAT = AUDIO_FILE[-3:] CUID = '123456PYTHON' RATE = 16000 - DEV_PID = 1537 + DEV_PID = 1537 ASR_URL = 'http://vop.baidu.com/server_api' - SCOPE = 'audio_voice_assistant_get' + SCOPE = 'audio_voice_assistant_get' token = self.fetch_token() speech_data = [] - path="/home/pi/xgoMusic/" - with open(path+AUDIO_FILE, 'rb') as speech_file: + path = "/home/pi/xgoMusic/" + with open(path + AUDIO_FILE, 'rb') as speech_file: speech_data = speech_file.read() length = len(speech_data) @@ -871,14 +1178,14 @@ def SpeechRecognition(self,seconds=3): speech = base64.b64encode(speech_data) speech = str(speech, 'utf-8') params = {'dev_pid': DEV_PID, - 'format': FORMAT, - 'rate': RATE, - 'token': token, - 'cuid': CUID, - 'channel': 1, - 'speech': speech, - 'len': length - } + 'format': FORMAT, + 'rate': RATE, + 'token': token, + 'cuid': CUID, + 'channel': 1, + 'speech': speech, + 'len': length + } post_data = json.dumps(params, sort_keys=False) req = Request(ASR_URL, post_data.encode('utf-8')) req.add_header('Content-Type', 'application/json') @@ -886,19 +1193,25 @@ def SpeechRecognition(self,seconds=3): begin = timer() f = urlopen(req) result_str = f.read() - print ("Request time cost %f" % (timer() - begin)) + print("Request time cost %f" % (timer() - begin)) except URLError as err: print('asr http response http code : ' + str(err.code)) result_str = err.read() try: result_str = str(result_str, 'utf-8') - re=json.loads(result_str) - text=re['result'][0] + re = json.loads(result_str) + text = re['result'][0] except: - text='error!' + text = 'error!' return text - def SpeechSynthesis(self,texts): + def SpeechSynthesis(self, texts): + """ + Performs speech synthesis (text-to-speech) using the Baidu TTS API. + + Parameters: + texts (str): The text to be synthesized. + """ from urllib.request import urlopen from urllib.request import Request from urllib.error import URLError @@ -916,13 +1229,13 @@ def SpeechSynthesis(self,texts): CUID = "123456PYTHON" TTS_URL = 'http://tsn.baidu.com/text2audio' - SCOPE = 'audio_tts_post' + SCOPE = 'audio_tts_post' token = self.fetch_token() - tex = quote_plus(TEXT) + tex = quote_plus(TEXT) print(tex) params = {'tok': token, 'tex': tex, 'per': PER, 'spd': SPD, 'pit': PIT, 'vol': VOL, 'aue': AUE, 'cuid': CUID, - 'lan': 'zh', 'ctp': 1} + 'lan': 'zh', 'ctp': 1} data = urlencode(params) print('test on Web Browser' + TTS_URL + '?' + data) @@ -936,14 +1249,14 @@ def SpeechSynthesis(self,texts): headers = dict((name.lower(), value) for name, value in f.headers.items()) has_error = ('content-type' not in headers.keys() or headers['content-type'].find('audio/') < 0) - except URLError as err: + except URLError as err: print('asr http response http code : ' + str(err.code)) result_str = err.read() has_error = True - path="/home/pi/xgoMusic/" + path = "/home/pi/xgoMusic/" save_file = "error.txt" if has_error else 'result.' + FORMAT - with open(path+save_file, 'wb') as of: + with open(path + save_file, 'wb') as of: of.write(result_str) if has_error: @@ -954,97 +1267,143 @@ def SpeechSynthesis(self,texts): self.xgoSpeaker("result.wav") - def cv2AddChineseText(self,img, text, position, textColor=(0, 255, 0), textSize=30): - if (isinstance(img, np.ndarray)): + def cv2AddChineseText(self, img, text, position, textColor=(0, 255, 0), textSize=30): + """ + Adds Chinese text to an image using PIL, as OpenCV doesn't support Chinese characters directly. + + Parameters: + img (numpy.ndarray): The image to add text to. + text (str): The Chinese text to add. + position (tuple): The (x, y) coordinates of the top-left corner of the text. + textColor (tuple, optional): The RGB color of the text. Defaults to (0, 255, 0) (green). + textSize (int, optional): The font size. Defaults to 30. + + Returns: + numpy.ndarray: The image with the Chinese text added. + """ + if (isinstance(img, np.ndarray)): img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB)) draw = ImageDraw.Draw(img) fontStyle = ImageFont.truetype( "/home/pi/model/msyh.ttc", textSize, encoding="utf-8") draw.text(position, text, textColor, font=fontStyle) return cv2.cvtColor(np.asarray(img), cv2.COLOR_RGB2BGR) - - def QRRecognition(self,target="camera"): + + def QRRecognition(self, target="camera"): + """ + Performs QR code recognition on an image or video frame and displays the results on the LCD. + + Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + + Returns: + list: A list of decoded QR code data strings. + """ import pyzbar.pyzbar as pyzbar - if target=="camera": + if target == "camera": self.open_camera() - success,img = self.cap.read() + success, img = self.cap.read() else: - path="/home/pi/xgoPictures/" - img=np.array(Image.open(path+target)) - - barcodes = pyzbar.decode(img) - result=[] + path = "/home/pi/xgoPictures/" + img = np.array(Image.open(path + target)) + + barcodes = pyzbar.decode(img) + result = [] for barcode in barcodes: barcodeData = barcode.data.decode("utf-8") barcodeType = barcode.type result.append(barcodeData) text = "{} ({})".format(barcodeData, barcodeType) - img=self.cv2AddChineseText(img,text, (10, 30),(0, 255, 0), 30) + img = self.cv2AddChineseText(img, text, (10, 30), (0, 255, 0), 30) try: - re=result[0] + re = result[0] except: - result=[] - b,g,r = cv2.split(img) - img = cv2.merge((r,g,b)) + result = [] + b, g, r = cv2.split(img) + img = cv2.merge((r, g, b)) imgok = Image.fromarray(img) self.display.ShowImage(imgok) return result - def ColorRecognition(self,target="camera",mode='R'): + def ColorRecognition(self, target="camera", mode='R'): + """ + Performs color recognition on an image or video frame, identifies the largest contour of the specified color, and displays the results on the LCD. + + Parameters: + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + mode (str, optional): The color to recognize ('R' for red, 'G' for green, 'B' for blue, 'Y' for yellow). Defaults to 'R'. + + Returns: + tuple: A tuple containing the center coordinates (x, y) and radius of the largest contour of the specified color. + """ color_x = 0 color_y = 0 color_radius = 0 - if mode=='R': #red + if mode == 'R': # red color_lower = np.array([0, 43, 46]) color_upper = np.array([10, 255, 255]) - elif mode=='G': #green + elif mode == 'G': # green color_lower = np.array([35, 43, 46]) color_upper = np.array([77, 255, 255]) - elif mode=='B': #blue + elif mode == 'B': # blue color_lower = np.array([100, 43, 46]) color_upper = np.array([124, 255, 255]) - elif mode=='Y': #yellow + elif mode == 'Y': # yellow color_lower = np.array([26, 43, 46]) color_upper = np.array([34, 255, 255]) - if target=="camera": + if target == "camera": self.open_camera() - success,frame = self.cap.read() + success, frame = self.cap.read() else: - path="/home/pi/xgoPictures/" - frame=np.array(Image.open(path+target)) - frame_ = cv2.GaussianBlur(frame,(5,5),0) - hsv = cv2.cvtColor(frame,cv2.COLOR_BGR2HSV) - mask = cv2.inRange(hsv,color_lower,color_upper) - mask = cv2.erode(mask,None,iterations=2) - mask = cv2.dilate(mask,None,iterations=2) - mask = cv2.GaussianBlur(mask,(3,3),0) - cnts = cv2.findContours(mask.copy(),cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)[-2] + path = "/home/pi/xgoPictures/" + frame = np.array(Image.open(path + target)) + frame_ = cv2.GaussianBlur(frame, (5, 5), 0) + hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) + mask = cv2.inRange(hsv, color_lower, color_upper) + mask = cv2.erode(mask, None, iterations=2) + mask = cv2.dilate(mask, None, iterations=2) + mask = cv2.GaussianBlur(mask, (3, 3), 0) + cnts = cv2.findContours(mask.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)[-2] if len(cnts) > 0: - cnt = max (cnts, key = cv2.contourArea) - (color_x,color_y),color_radius = cv2.minEnclosingCircle(cnt) - cv2.circle(frame,(int(color_x),int(color_y)),int(color_radius),(255,0,255),2) - cv2.putText(frame, "X:%d, Y%d" % (int(color_x), int(color_y)), (40,40), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (255,255,0), 3) - - b,g,r = cv2.split(frame) - img = cv2.merge((r,g,b)) + cnt = max(cnts, key=cv2.contourArea) + (color_x, color_y), color_radius = cv2.minEnclosingCircle(cnt) + cv2.circle(frame, (int(color_x), int(color_y)), int(color_radius), (255, 0, 255), 2) + cv2.putText(frame, "X:%d, Y%d" % (int(color_x), int(color_y)), (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.8, + (255, 255, 0), 3) + + b, g, r = cv2.split(frame) + img = cv2.merge((r, g, b)) imgok = Image.fromarray(img) self.display.ShowImage(imgok) - return ((color_x,color_y),color_radius) + return ((color_x, color_y), color_radius) + + def cap_color_mask(self, position=None, scale=25, h_error=20, s_limit=[90, 255], v_limit=[90, 230]): + """ + Captures a color mask from the camera feed based on a specified region and displays it on the LCD. - def cap_color_mask(self,position=None, scale=25, h_error=20, s_limit=[90, 255], v_limit=[90, 230]): + Parameters: + position (list, optional): The top-left corner coordinates (x, y) of the region to sample for color. Defaults to [160, 100]. + scale (int, optional): The width and height of the square region to sample. Defaults to 25. + h_error (int, optional): The tolerance for hue variation. Defaults to 20. + s_limit (list, optional): The lower and upper limits for saturation. Defaults to [90, 255]. + v_limit (list, optional): The lower and upper limits for value (brightness). Defaults to [90, 230]. + + Returns: + list: A list containing two lists, representing the lower and upper bounds of the captured color mask in HSV format. + """ if position is None: position = [160, 100] count = 0 self.open_camera() while True: - if self.xgoButton("c"): + if self.xgoButton("c"): break - success,frame = self.cap.read() - b,g,r = cv2.split(frame) - frame_bgr = cv2.merge((r,g,b)) + success, frame = self.cap.read() + b, g, r = cv2.split(frame) + frame_bgr = cv2.merge((r, g, b)) hsv = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2HSV) h, s, v = cv2.split(hsv) color = np.mean(h[position[1]:position[1] + scale, position[0]:position[0] + scale]) @@ -1057,16 +1416,26 @@ def cap_color_mask(self,position=None, scale=25, h_error=20, s_limit=[90, 255], if count == 0: cv2.rectangle(frame, (position[0], position[1]), (position[0] + scale, position[1] + scale), - (255, 255, 255), 2) + (255, 255, 255), 2) cv2.putText(frame, 'press button B', (40, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) - b,g,r = cv2.split(frame) - img = cv2.merge((r,g,b)) + b, g, r = cv2.split(frame) + img = cv2.merge((r, g, b)) imgok = Image.fromarray(img) self.display.ShowImage(imgok) - - def filter_img(self,frame,color): - b,g,r = cv2.split(frame) - frame_bgr = cv2.merge((r,g,b)) + + def filter_img(self, frame, color): + """ + Applies a color mask to an image frame, isolating the specified color. + + Parameters: + frame (numpy.ndarray): The input image frame. + color (list or str): The color to filter. Can be a list of two lists representing the lower and upper bounds of the color mask in HSV format, or a string representing a predefined color ('red', 'green', 'blue', 'yellow'). + + Returns: + numpy.ndarray: The image frame with the color mask applied. + """ + b, g, r = cv2.split(frame) + frame_bgr = cv2.merge((r, g, b)) hsv = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2HSV) if isinstance(color, list): color_lower = np.array(color[0]) @@ -1077,23 +1446,37 @@ def filter_img(self,frame,color): img_mask = cv2.bitwise_and(frame, frame, mask=mask) return img_mask - def BallRecognition(self,color_mask,target="camera",p1=36, p2=15, minR=6, maxR=35): - x=y=ra=0 - if target=="camera": + def BallRecognition(self, color_mask, target="camera", p1=36, p2=15, minR=6, maxR=35): + """ + Detects and tracks a ball of a specific color in an image or video frame using Hough Circle Transform. + + Parameters: + color_mask (list): A list of two lists, representing the lower and upper bounds of the ball's color in HSV format. + target (str, optional): The source of the image data. Can be "camera" for live camera feed or a file path for an image. Defaults to "camera". + p1 (int, optional): The higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller). Defaults to 36. + p2 (int, optional): The accumulator threshold for the circle centers at the detection stage. Defaults to 15. + minR (int, optional): The minimum circle radius. Defaults to 6. + maxR (int, optional): The maximum circle radius. Defaults to 35. + + Returns: + tuple: A tuple containing the x-coordinate, y-coordinate, and radius of the detected ball. + """ + x = y = ra = 0 + if target == "camera": self.open_camera() - success,image = self.cap.read() + success, image = self.cap.read() else: - path="/home/pi/xgoPictures/" - image=np.array(Image.open(path+target)) + path = "/home/pi/xgoPictures/" + image = np.array(Image.open(path + target)) + + frame_mask = self.filter_img(image, color_mask) - frame_mask=self.filter_img(image, color_mask) - img = cv2.medianBlur(frame_mask, 5) - img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) - - circles = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, 20, param1=p1, param2=p2, minRadius=minR,maxRadius=maxR) - b,g,r = cv2.split(image) - image = cv2.merge((r,g,b)) + img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) + + circles = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, 20, param1=p1, param2=p2, minRadius=minR, maxRadius=maxR) + b, g, r = cv2.split(image) + image = cv2.merge((r, g, b)) if circles is not None and len(circles[0]) == 1: param = circles[0][0] x, y, ra = int(param[0]), int(param[1]), int(param[2]) @@ -1101,17 +1484,28 @@ def BallRecognition(self,color_mask,target="camera",p1=36, p2=15, minR=6, maxR=3 cv2.circle(image, (x, y), 2, (255, 255, 255), 2) imgok = Image.fromarray(image) self.display.ShowImage(imgok) - return x,y,ra - - - - + return x, y, ra class DemoError(Exception): + """ + A custom exception class for errors related to the Baidu AI API. + """ pass class hands(): - def __init__(self,model_complexity,max_num_hands,min_detection_confidence,min_tracking_confidence): + """ + A class for hand detection and landmark estimation using MediaPipe. + """ + def __init__(self, model_complexity, max_num_hands, min_detection_confidence, min_tracking_confidence): + """ + Initializes the hands object. + + Parameters: + model_complexity (int): Complexity of the hand landmark model: 0 or 1. + max_num_hands (int): Maximum number of hands to detect. + min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for hand detection to be considered successful. + min_tracking_confidence (float): Minimum confidence value ([0.0, 1.0]) for the hand landmarks to be considered tracked successfully. + """ import mediapipe as mp self.model_complexity = model_complexity self.max_num_hands = max_num_hands @@ -1123,45 +1517,65 @@ def __init__(self,model_complexity,max_num_hands,min_detection_confidence,min_tr min_detection_confidence=self.min_detection_confidence, min_tracking_confidence=self.min_tracking_confidence, ) - - def run(self,cv_img): + + def run(self, cv_img): + """ + Processes an image and returns hand landmarks and other related information. + + Parameters: + cv_img (numpy.ndarray): The input image. + + Returns: + list: A list of dictionaries, where each dictionary contains information about a detected hand, including center coordinates, bounding rectangle, landmark coordinates, hand angles, and right/left classification. + """ import copy image = cv_img debug_image = copy.deepcopy(image) image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) results = self.hands.process(image) - hf=[] + hf = [] if results.multi_hand_landmarks is not None: for hand_landmarks, handedness in zip(results.multi_hand_landmarks, results.multi_handedness): - # 手的重心计算 + # Calculate the center of the palm cx, cy = self.calc_palm_moment(debug_image, hand_landmarks) - # 手的外接矩形计算 + # Calculate the bounding rectangle of the hand rect = self.calc_bounding_rect(debug_image, hand_landmarks) - # 手的个关键点 - dlandmark = self.dlandmarks(debug_image,hand_landmarks,handedness) + # Get individual landmarks + dlandmark = self.dlandmarks(debug_image, hand_landmarks, handedness) - hf.append({'center':(cx,cy),'rect':rect,'dlandmark':dlandmark[0],'hand_angle':self.hand_angle(dlandmark[0]),'right_left':dlandmark[1]}) + hf.append({'center': (cx, cy), 'rect': rect, 'dlandmark': dlandmark[0], + 'hand_angle': self.hand_angle(dlandmark[0]), 'right_left': dlandmark[1]}) return hf def calc_palm_moment(self, image, landmarks): + """ + Calculates the moment (center) of the palm. + + Parameters: + image (numpy.ndarray): The input image. + landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks. + + Returns: + tuple: The (x, y) coordinates of the palm's center. + """ image_width, image_height = image.shape[1], image.shape[0] palm_array = np.empty((0, 2), int) for index, landmark in enumerate(landmarks.landmark): landmark_x = min(int(landmark.x * image_width), image_width - 1) landmark_y = min(int(landmark.y * image_height), image_height - 1) landmark_point = [np.array((landmark_x, landmark_y))] - if index == 0: # 手首1 + if index == 0: # Wrist 1 palm_array = np.append(palm_array, landmark_point, axis=0) - if index == 1: # 手首2 + if index == 1: # Wrist 2 palm_array = np.append(palm_array, landmark_point, axis=0) - if index == 5: # 人差指:付け根 + if index == 5: # Index finger: base palm_array = np.append(palm_array, landmark_point, axis=0) - if index == 9: # 中指:付け根 + if index == 9: # Middle finger: base palm_array = np.append(palm_array, landmark_point, axis=0) - if index == 13: # 薬指:付け根 + if index == 13: # Ring finger: base palm_array = np.append(palm_array, landmark_point, axis=0) - if index == 17: # 小指:付け根 + if index == 17: # Pinky finger: base palm_array = np.append(palm_array, landmark_point, axis=0) M = cv2.moments(palm_array) cx, cy = 0, 0 @@ -1171,6 +1585,16 @@ def calc_palm_moment(self, image, landmarks): return cx, cy def calc_bounding_rect(self, image, landmarks): + """ + Calculates the bounding rectangle of the hand. + + Parameters: + image (numpy.ndarray): The input image. + landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks. + + Returns: + list: A list [x, y, w, h] representing the bounding rectangle. + """ image_width, image_height = image.shape[1], image.shape[0] landmark_array = np.empty((0, 2), int) for _, landmark in enumerate(landmarks.landmark): @@ -1181,7 +1605,18 @@ def calc_bounding_rect(self, image, landmarks): x, y, w, h = cv2.boundingRect(landmark_array) return [x, y, w, h] - def dlandmarks(self,image, landmarks, handedness): + def dlandmarks(self, image, landmarks, handedness): + """ + Extracts and returns the coordinates of hand landmarks. + + Parameters: + image (numpy.ndarray): The input image. + landmarks (mediapipe.framework.formats.landmark_pb2.NormalizedLandmarkList): Hand landmarks. + handedness (mediapipe.framework.formats.classification_pb2.ClassificationList): Handedness information. + + Returns: + tuple: A tuple containing a list of landmark coordinates and the handedness label ('Right' or 'Left'). + """ image_width, image_height = image.shape[1], image.shape[0] landmark_point = [] for index, landmark in enumerate(landmarks.landmark): @@ -1190,199 +1625,307 @@ def dlandmarks(self,image, landmarks, handedness): landmark_x = min(int(landmark.x * image_width), image_width - 1) landmark_y = min(int(landmark.y * image_height), image_height - 1) landmark_point.append((landmark_x, landmark_y)) - return landmark_point,handedness.classification[0].label[0] + return landmark_point, handedness.classification[0].label[0] def vector_2d_angle(self, v1, v2): + """ + Calculates the angle between two 2D vectors. + + Parameters: + v1 (tuple): The first vector (x, y). + v2 (tuple): The second vector (x, y). + + Returns: + float: The angle between the two vectors in degrees. + """ v1_x = v1[0] v1_y = v1[1] v2_x = v2[0] v2_y = v2[1] try: - angle_= math.degrees(math.acos((v1_x*v2_x+v1_y*v2_y)/(((v1_x**2+v1_y**2)**0.5)*((v2_x**2+v2_y**2)**0.5)))) + angle_ = math.degrees(math.acos((v1_x * v2_x + v1_y * v2_y) / (((v1_x ** 2 + v1_y ** 2) ** 0.5) * ((v2_x ** 2 + v2_y ** 2) ** 0.5)))) except: angle_ = 180 return angle_ - def hand_angle(self,hand_): + def hand_angle(self, hand_): + """ + Calculates the angles of the fingers. + + Parameters: + hand_ (list): A list of hand landmark coordinates. + + Returns: + list: A list of finger angles (thumb, index, middle, ring, pinky). + """ angle_list = [] - # thumb 大拇指角度 + # thumb Thumb angle angle_ = self.vector_2d_angle( - ((int(hand_[0][0])- int(hand_[2][0])),(int(hand_[0][1])-int(hand_[2][1]))), - ((int(hand_[3][0])- int(hand_[4][0])),(int(hand_[3][1])- int(hand_[4][1]))) - ) + ((int(hand_[0][0]) - int(hand_[2][0])), (int(hand_[0][1]) - int(hand_[2][1]))), + ((int(hand_[3][0]) - int(hand_[4][0])), (int(hand_[3][1]) - int(hand_[4][1]))) + ) angle_list.append(angle_) - # index 食指角度 + # index Index finger angle angle_ = self.vector_2d_angle( - ((int(hand_[0][0])-int(hand_[6][0])),(int(hand_[0][1])- int(hand_[6][1]))), - ((int(hand_[7][0])- int(hand_[8][0])),(int(hand_[7][1])- int(hand_[8][1]))) - ) + ((int(hand_[0][0]) - int(hand_[6][0])), (int(hand_[0][1]) - int(hand_[6][1]))), + ((int(hand_[7][0]) - int(hand_[8][0])), (int(hand_[7][1]) - int(hand_[8][1]))) + ) angle_list.append(angle_) - # middle 中指角度 + # middle Middle finger angle angle_ = self.vector_2d_angle( - ((int(hand_[0][0])- int(hand_[10][0])),(int(hand_[0][1])- int(hand_[10][1]))), - ((int(hand_[11][0])- int(hand_[12][0])),(int(hand_[11][1])- int(hand_[12][1]))) - ) + ((int(hand_[0][0]) - int(hand_[10][0])), (int(hand_[0][1]) - int(hand_[10][1]))), + ((int(hand_[11][0]) - int(hand_[12][0])), (int(hand_[11][1]) - int(hand_[12][1]))) + ) angle_list.append(angle_) - # ring 無名指角度 + # ring Ring finger angle angle_ = self.vector_2d_angle( - ((int(hand_[0][0])- int(hand_[14][0])),(int(hand_[0][1])- int(hand_[14][1]))), - ((int(hand_[15][0])- int(hand_[16][0])),(int(hand_[15][1])- int(hand_[16][1]))) - ) + ((int(hand_[0][0]) - int(hand_[14][0])), (int(hand_[0][1]) - int(hand_[14][1]))), + ((int(hand_[15][0]) - int(hand_[16][0])), (int(hand_[15][1]) - int(hand_[16][1]))) + ) angle_list.append(angle_) - # pink 小拇指角度 + # pink Pinky finger angle angle_ = self.vector_2d_angle( - ((int(hand_[0][0])- int(hand_[18][0])),(int(hand_[0][1])- int(hand_[18][1]))), - ((int(hand_[19][0])- int(hand_[20][0])),(int(hand_[19][1])- int(hand_[20][1]))) - ) + ((int(hand_[0][0]) - int(hand_[18][0])), (int(hand_[0][1]) - int(hand_[18][1]))), + ((int(hand_[19][0]) - int(hand_[20][0])), (int(hand_[19][1]) - int(hand_[20][1]))) + ) angle_list.append(angle_) return angle_list - + class yoloXgo(): - def __init__(self,model,classes,inputwh,thresh): - import onnxruntime + """ + A class for object detection using YOLO (You Only Look Once) models with ONNX Runtime. + """ + def __init__(self, model, classes, inputwh, thresh): + """ + Initializes the yoloXgo object. + + Parameters: + model (str): The path to the ONNX model file. + classes (list): A list of class names. + inputwh (list): A list [width, height] representing the input size of the model. + thresh (float): The confidence threshold for object detection. + """ + import onnxruntime self.session = onnxruntime.InferenceSession(model) - self.input_width=inputwh[0] - self.input_height=inputwh[1] - self.thresh=thresh - self.classes=classes - - def sigmoid(self,x): + self.input_width = inputwh[0] + self.input_height = inputwh[1] + self.thresh = thresh + self.classes = classes + + def sigmoid(self, x): + """ + Computes the sigmoid function. + + Parameters: + x (float or numpy.ndarray): The input value. + + Returns: + float or numpy.ndarray: The sigmoid of the input. + """ return 1. / (1 + np.exp(-x)) - # tanh函数 - def tanh(self,x): + # tanh function + def tanh(self, x): + """ + Computes the hyperbolic tangent function. + + Parameters: + x (float or numpy.ndarray): The input value. + + Returns: + float or numpy.ndarray: The hyperbolic tangent of the input. + """ return 2. / (1 + np.exp(-2 * x)) - 1 - # 数据预处理 - def preprocess(self,src_img, size): - output = cv2.resize(src_img,(size[0], size[1]),interpolation=cv2.INTER_AREA) - output = output.transpose(2,0,1) + # Data preprocessing + def preprocess(self, src_img, size): + """ + Preprocesses the input image for the YOLO model. + + Parameters: + src_img (numpy.ndarray): The input image. + size (list): A list [width, height] representing the target size. + + Returns: + numpy.ndarray: The preprocessed image data. + """ + output = cv2.resize(src_img, (size[0], size[1]), interpolation=cv2.INTER_AREA) + output = output.transpose(2, 0, 1) output = output.reshape((1, 3, size[1], size[0])) / 255 - return output.astype('float32') + return output.astype('float32') + + # nms algorithm + + def nms(self, dets, thresh=0.45): + """ + Performs Non-Maximum Suppression (NMS) to filter out overlapping bounding boxes. + + Parameters: + dets (numpy.ndarray): An array of bounding boxes with shape (N, 6), where N is the number of boxes, and each box is represented as [x1, y1, x2, y2, score, class_index]. + thresh (float, optional): The IoU (Intersection over Union) threshold for suppression. Defaults to 0.45. - # nms算法 - def nms(self,dets,thresh=0.45): - # dets:N*M,N是bbox的个数,M的前4位是对应的(x1,y1,x2,y2),第5位是对应的分数 + Returns: + list: A list of filtered bounding boxes, each represented as [x1, y1, x2, y2, score, class_index]. + """ + # dets:N*M,N is the number of bbox, the first 4 digits of M are the corresponding (x1, y1, x2, y2), and the 5th digit is the corresponding score # #thresh:0.3,0.5.... x1 = dets[:, 0] y1 = dets[:, 1] x2 = dets[:, 2] y2 = dets[:, 3] scores = dets[:, 4] - areas = (x2 - x1 + 1) * (y2 - y1 + 1) # 求每个bbox的面积 - order = scores.argsort()[::-1] # 对分数进行倒排序 - keep = [] # 用来保存最后留下来的bboxx下标 + areas = (x2 - x1 + 1) * (y2 - y1 + 1) # Calculate the area of each bbox + order = scores.argsort()[::-1] # Sort scores in descending order + keep = [] # Used to store the bboxx subscripts that are finally retained while order.size > 0: - i = order[0] # 无条件保留每次迭代中置信度最高的bbox + i = order[0] # Unconditionally keep the bbox with the highest confidence in each iteration keep.append(i) - # 计算置信度最高的bbox和其他剩下bbox之间的交叉区域 + # Calculate the intersection area between the bbox with the highest confidence and the other remaining bboxes xx1 = np.maximum(x1[i], x1[order[1:]]) yy1 = np.maximum(y1[i], y1[order[1:]]) xx2 = np.minimum(x2[i], x2[order[1:]]) yy2 = np.minimum(y2[i], y2[order[1:]]) - # 计算置信度高的bbox和其他剩下bbox之间交叉区域的面积 + # Calculate the area of the intersection area between the high-confidence bbox and the other remaining bboxes w = np.maximum(0.0, xx2 - xx1 + 1) h = np.maximum(0.0, yy2 - yy1 + 1) inter = w * h - # 求交叉区域的面积占两者(置信度高的bbox和其他bbox)面积和的必烈 + # Calculate the ratio of the area of the intersection area to the area of both (the bbox with high confidence and other bboxes) ovr = inter / (areas[i] + areas[order[1:]] - inter) - # 保留ovr小于thresh的bbox,进入下一次迭代。 + # Keep the bbox whose ovr is less than thresh and enter the next iteration. inds = np.where(ovr <= thresh)[0] - # 因为ovr中的索引不包括order[0]所以要向后移动一位 + # Because the index in ovr does not include order[0], it needs to be moved one bit backward order = order[inds + 1] - + output = [] for i in keep: output.append(dets[i].tolist()) return output - def run(self, img,): + def run(self, img, ): + """ + Runs object detection on an image using the YOLO model. + + Parameters: + img (numpy.ndarray): The input image. + + Returns: + list or bool: A list of dictionaries, where each dictionary represents a detected object and contains the class name, confidence score, and bounding box coordinates. Returns False if no objects are detected. + """ pred = [] - # 输入图像的原始宽高 + # Original width and height of the input image H, W, _ = img.shape - # 数据预处理: resize, 1/255 + # Data preprocessing: resize, 1/255 data = self.preprocess(img, [self.input_width, self.input_height]) - # 模型推理 + # Model inference input_name = self.session.get_inputs()[0].name feature_map = self.session.run([], {input_name: data})[0][0] - # 输出特征图转置: CHW, HWC + # Output feature map transpose: CHW, HWC feature_map = feature_map.transpose(1, 2, 0) - # 输出特征图的宽高 + # The width and height of the output feature map feature_map_height = feature_map.shape[0] feature_map_width = feature_map.shape[1] - # 特征图后处理 + # Feature map post-processing for h in range(feature_map_height): for w in range(feature_map_width): data = feature_map[h][w] - # 解析检测框置信度 + # Resolve detection frame confidence obj_score, cls_score = data[0], data[5:].max() score = (obj_score ** 0.6) * (cls_score ** 0.4) - # 阈值筛选 + # Threshold screening if score > self.thresh: - # 检测框类别 + # Detection frame category cls_index = np.argmax(data[5:]) - # 检测框中心点偏移 + # Detection frame center point offset x_offset, y_offset = self.tanh(data[1]), self.tanh(data[2]) - # 检测框归一化后的宽高 + # Normalized width and height of the detection frame box_width, box_height = self.sigmoid(data[3]), self.sigmoid(data[4]) - # 检测框归一化后中心点 + # The center point after normalization of the detection frame box_cx = (w + x_offset) / feature_map_width box_cy = (h + y_offset) / feature_map_height - + # cx,cy,w,h => x1, y1, x2, y2 x1, y1 = box_cx - 0.5 * box_width, box_cy - 0.5 * box_height x2, y2 = box_cx + 0.5 * box_width, box_cy + 0.5 * box_height x1, y1, x2, y2 = int(x1 * W), int(y1 * H), int(x2 * W), int(y2 * H) pred.append([x1, y1, x2, y2, score, cls_index]) - datas=np.array(pred) - data=[] - if len(datas)>0: - boxes=self.nms(datas) + datas = np.array(pred) + data = [] + if len(datas) > 0: + boxes = self.nms(datas) for b in boxes: obj_score, cls_index = b[4], int(b[5]) x1, y1, x2, y2 = int(b[0]), int(b[1]), int(b[2]), int(b[3]) - s={'classes':self.classes[cls_index],'score':'%.2f' % obj_score,'xywh':[x1,y1,x2-x1,y2-y1],} + s = {'classes': self.classes[cls_index], 'score': '%.2f' % obj_score, 'xywh': [x1, y1, x2 - x1, y2 - y1], } data.append(s) return data else: return False class face_detection(): - def __init__(self,min_detection_confidence): + """ + A class for face detection using MediaPipe. + """ + def __init__(self, min_detection_confidence): + """ + Initializes the face_detection object. + + Parameters: + min_detection_confidence (float): Minimum confidence value ([0.0, 1.0]) for face detection to be considered successful. + """ import mediapipe as mp self.model_selection = 0 - self.min_detection_confidence =min_detection_confidence + self.min_detection_confidence = min_detection_confidence self.mp_face_detection = mp.solutions.face_detection self.face_detection = self.mp_face_detection.FaceDetection( min_detection_confidence=self.min_detection_confidence, ) - def run(self,cv_img): + def run(self, cv_img): + """ + Performs face detection on an image. + + Parameters: + cv_img (numpy.ndarray): The input image. + + Returns: + list: A list of dictionaries, where each dictionary contains information about a detected face, including bounding box coordinates and landmark coordinates. + """ image = cv_img image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) results = self.face_detection.process(cv_img) - face=[] + face = [] if results.detections is not None: for detection in results.detections: - data =self.draw_detection(image,detection) + data = self.draw_detection(image, detection) face.append(data) return face + def draw_detection(self, image, detection): + """ + Extracts face detection information and returns it as a dictionary. + + Parameters: + image (numpy.ndarray): The input image. + detection (mediapipe.framework.formats.detection_pb2.Detection): Face detection result. + + Returns: + dict: A dictionary containing face detection information, including label ID, confidence score, bounding box coordinates, and landmark coordinates. + """ image_width, image_height = image.shape[1], image.shape[0] bbox = detection.location_data.relative_bounding_box bbox.xmin = int(bbox.xmin * image_width) @@ -1390,48 +1933,44 @@ def draw_detection(self, image, detection): bbox.width = int(bbox.width * image_width) bbox.height = int(bbox.height * image_height) - - # 位置:右目 + # Position: right eye keypoint0 = detection.location_data.relative_keypoints[0] keypoint0.x = int(keypoint0.x * image_width) keypoint0.y = int(keypoint0.y * image_height) - - # 位置:左目 + # Position: left eye keypoint1 = detection.location_data.relative_keypoints[1] keypoint1.x = int(keypoint1.x * image_width) keypoint1.y = int(keypoint1.y * image_height) - - # 位置:鼻 + # Position: nose keypoint2 = detection.location_data.relative_keypoints[2] keypoint2.x = int(keypoint2.x * image_width) keypoint2.y = int(keypoint2.y * image_height) - - # 位置:口 + # Position: mouth keypoint3 = detection.location_data.relative_keypoints[3] keypoint3.x = int(keypoint3.x * image_width) keypoint3.y = int(keypoint3.y * image_height) - # 位置:右耳 + # Position: right ear keypoint4 = detection.location_data.relative_keypoints[4] keypoint4.x = int(keypoint4.x * image_width) keypoint4.y = int(keypoint4.y * image_height) - # 位置:左耳 + # Position: left ear keypoint5 = detection.location_data.relative_keypoints[5] keypoint5.x = int(keypoint5.x * image_width) keypoint5.y = int(keypoint5.y * image_height) - data={'id':detection.label_id[0], - 'score':round(detection.score[0], 3), - 'rect':[int(bbox.xmin),int(bbox.ymin),int(bbox.width),int(bbox.height)], - 'right_eye':(int(keypoint0.x),int(keypoint0.y)), - 'left_eye':(int(keypoint1.x),int(keypoint1.y)), - 'nose':(int(keypoint2.x),int(keypoint2.y)), - 'mouth':(int(keypoint3.x),int(keypoint3.y)), - 'right_ear':(int(keypoint4.x),int(keypoint4.y)), - 'left_ear':(int(keypoint5.x),int(keypoint5.y)), - } - return data + data = {'id': detection.label_id[0], + 'score': round(detection.score[0], 3), + 'rect': [int(bbox.xmin), int(bbox.ymin), int(bbox.width), int(bbox.height)], + 'right_eye': (int(keypoint0.x), int(keypoint0.y)), + 'left_eye': (int(keypoint1.x), int(keypoint1.y)), + 'nose': (int(keypoint2.x), int(keypoint2.y)), + 'mouth': (int(keypoint3.x), int(keypoint3.y)), + 'right_ear': (int(keypoint4.x), int(keypoint4.y)), + 'left_ear': (int(keypoint5.x), int(keypoint5.y)), + } + return data \ No newline at end of file diff --git a/xgolib/__init__.py b/xgolib/__init__.py index 6b89fe8..b16cc73 100644 --- a/xgolib/__init__.py +++ b/xgolib/__init__.py @@ -3,12 +3,11 @@ import time import math -__version__ = '1.4.2' -__last_modified__ = '2024/2/25' +__version__ = '1.5' +__last_modified__ = '2024/12/18' """ -XGOorder 用来存放命令地址和对应数据 -XGOorder is used to store the command address and corresponding data +XGOorder is used to store the command address and corresponding data. """ XGOorder = { @@ -58,23 +57,37 @@ } """ -XGOparam 用来存放机器狗的参数限制范围 -Xgoparam is used to store the parameter limit range of the robot dog +XGOparam is used to store the parameter limit range of the robot dog. """ XGOparam = {} - def search(data, list): + """ + Searches for a specific data element within a list. + + Parameters: + data: The data element to search for. + list: The list to search within. + + Returns: + int: The index (position + 1) of the data element in the list if found, otherwise -1. + """ for i in range(len(list)): if data == list[i]: return i + 1 return -1 - def conver2u8(data, limit, min_value=0): """ - 将实际参数转化为0到255的单字节数据 - Convert the actual parameters to single byte data from 0 to 255 + Converts the actual parameters to single byte data from 0 to 255. + + Parameters: + data (float): The actual parameter value. + limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit]. + min_value (int, optional): The minimum value to return if the data is below the limit. Defaults to 0. + + Returns: + int: The converted single byte data (0-255). """ max_value = 0xff if not isinstance(limit, list): @@ -86,15 +99,32 @@ def conver2u8(data, limit, min_value=0): else: return int(255 / (limit[1] - limit[0]) * (data - limit[0])) - def conver2float(data, limit): + """ + Converts a single byte data (0-255) to its corresponding float value based on the provided limit. + + Parameters: + data (int): The single byte data (0-255). + limit (float or list): The parameter limit range. If a single float is provided, it's treated as the maximum limit with a symmetrical negative limit. If a list is provided, it should contain two elements: [min_limit, max_limit]. + + Returns: + float: The corresponding float value. + """ if not isinstance(limit, list): return (data - 128.0) / 255.0 * limit else: return data / 255.0 * (limit[1] - limit[0]) + limit[0] - def Byte2Float(rawdata): + """ + Converts a 4-byte sequence (in little-endian format) to a float. + + Parameters: + rawdata (list): A list containing 4 bytes. + + Returns: + float: The converted float value. + """ a = bytearray() a.append(rawdata[3]) a.append(rawdata[2]) @@ -102,27 +132,40 @@ def Byte2Float(rawdata): a.append(rawdata[0]) return struct.unpack("!f", a)[0] - def Byte2Short(rawdata): + """ + Converts a 2-byte sequence (in big-endian format) to a signed short integer. + + Parameters: + rawdata (list): A list containing 2 bytes. + + Returns: + int: The converted signed short integer value. + """ a = bytearray() a.append(rawdata[0]) a.append(rawdata[1]) return struct.unpack('>h', a)[0] - def changePara(version): + """ + Changes the XGOparam dictionary based on the robot version. + + Parameters: + version (str): The robot version ('xgomini', 'xgolite', or 'xgorider'). + """ global XGOparam if version == 'xgomini': XGOparam = { - "TRANSLATION_LIMIT": [35, 19.5, [75, 120]], # X Y Z 平移范围 - "ATTITUDE_LIMIT": [20, 22, 16], # Roll Pitch Yaw 姿态范围 - "LEG_LIMIT": [35, 18, [75, 115]], # 腿长范围 - "MOTOR_LIMIT": [[-73, 57], [-66, 93], [-31, 31], [-65, 65], [-85, 50], [-75, 90]], # 下 中 上 舵机范围 + "TRANSLATION_LIMIT": [35, 19.5, [75, 120]], # X Y Z translation range + "ATTITUDE_LIMIT": [20, 22, 16], # Roll Pitch Yaw attitude range + "LEG_LIMIT": [35, 18, [75, 115]], # Leg length range + "MOTOR_LIMIT": [[-73, 57], [-66, 93], [-31, 31], [-65, 65], [-85, 50], [-75, 90]], # Lower, middle, upper servo range "PERIOD_LIMIT": [[1.5, 8]], - "MARK_TIME_LIMIT": [10, 35], # 原地踏步高度范围 - "VX_LIMIT": 25, # X速度范围 - "VY_LIMIT": 18, # Y速度范围 - "VYAW_LIMIT": 100, # 旋转速度范围 + "MARK_TIME_LIMIT": [10, 35], # Mark time height range + "VX_LIMIT": 25, # X speed range + "VY_LIMIT": 18, # Y speed range + "VYAW_LIMIT": 100, # Rotation speed range "ARM_LIMIT": [[-80, 155], [-95, 155], [70, 270], [80, 140]], "ActionTime": { 1: 3, 2: 3, 3: 5, 4: 5, 5: 4, 6: 4, 7: 4, 8: 4, 9: 4, 10: 7, @@ -164,15 +207,21 @@ def changePara(version): 21: 8, 22: 7, 23: 6, 24: 7, 128: 10, 129: 10, 130: 10, 255: 1} } - class XGO(): """ - 在实例化XGO时需要指定上位机与机器狗的串口通讯接口 - When instantiating XGO, you need to specify the serial - communication interface between the upper computer and the machine dog + When instantiating XGO, you need to specify the serial communication interface between the upper computer and the machine dog. """ def __init__(self, port, baud=115200, version="xgomini", verbose=False): + """ + Initializes the XGO robot object. + + Parameters: + port (str): The serial port to use for communication (e.g., '/dev/ttyACM0', 'COM3'). + baud (int, optional): The baud rate for serial communication. Defaults to 115200. + version (string, optional): Specifies the version of the XGO robot. Accepts 'xgomini', 'xgolite', or 'xgorider'. Defaults to 'xgomini'. + verbose (bool, optional): Enables verbose output for debugging. Defaults to False. + """ self.verbose = verbose self.ser = serial.Serial("/dev/ttyAMA0", baud, timeout=0.5) self.ser.flushOutput() @@ -201,6 +250,14 @@ def __init__(self, port, baud=115200, version="xgomini", verbose=False): pass def __send(self, key, index=1, len=1): + """ + Sends a command to the XGO robot. + + Parameters: + key (str): The command key (e.g., "VX", "VY", "TRANSLATION"). + index (int, optional): The starting index for the data within the XGOorder dictionary. Defaults to 1. + len (int, optional): The number of data elements to send. Defaults to 1. + """ mode = 0x01 order = XGOorder[key][0] + index - 1 value = [] @@ -218,6 +275,13 @@ def __send(self, key, index=1, len=1): print("tx_data: ", tx) def __read(self, addr, read_len=1): + """ + Sends a read request to the XGO robot. + + Parameters: + addr (int): The address to read from. + read_len (int, optional): The number of bytes to read. Defaults to 1. + """ self.ser.flushInput() mode = 0x02 sum_data = (0x09 + mode + addr + read_len) % 256 @@ -229,17 +293,36 @@ def __read(self, addr, read_len=1): print("tx_data: ", tx) def __change_baud(self, baud): + """ + Changes the baud rate of the serial connection. + + Parameters: + baud (int): The new baud rate. + """ self.ser.flush() self.ser.close() self.ser = serial.Serial(self.port, baud, timeout=0.5) def stop(self): + """ + Stops all movement of the XGO robot. + """ self.move_x(0) self.move_y(0) self.mark_time(0) self.turn(0) def move(self, direction, step): + """ + Moves the XGO robot in a specified direction. + + Parameters: + direction (str): The direction of movement ('x', 'X', 'y', or 'Y'). + step (float): The step size or speed of the movement. + + Raises: + ValueError: If an invalid direction is provided. + """ if direction in ['x', 'X']: self.move_x(step) elif direction in ['y', 'Y']: @@ -248,6 +331,13 @@ def move(self, direction, step): print("ERROR!Invalid direction!") def move_x(self, step, runtime=0): + """ + Moves the XGO robot along the x-axis. + + Parameters: + step (float): The step size or speed of the movement along the x-axis. + runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0. + """ XGOorder["VX"][1] = conver2u8(step, XGOparam["VX_LIMIT"]) self.__send("VX") if runtime: @@ -256,6 +346,13 @@ def move_x(self, step, runtime=0): self.__send("VX") def move_y(self, step, runtime=0): + """ + Moves the XGO robot along the y-axis. + + Parameters: + step (float): The step size or speed of the movement along the y-axis. + runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0. + """ XGOorder["VY"][1] = conver2u8(step, XGOparam["VY_LIMIT"]) self.__send("VY") if runtime: @@ -264,6 +361,13 @@ def move_y(self, step, runtime=0): self.__send("VY") def turn(self, step, runtime=0): + """ + Rotates the XGO robot. + + Parameters: + step (float): The step size or speed of the rotation. + runtime (float, optional): The duration of the rotation in seconds. If provided, the robot will stop rotating after this duration. Defaults to 0. + """ XGOorder["VYAW"][1] = conver2u8(step, XGOparam["VYAW_LIMIT"]) self.__send("VYAW") if runtime: @@ -272,24 +376,70 @@ def turn(self, step, runtime=0): self.__send("VYAW") def forward(self, step): + """ + Moves the XGO robot forward. + + Parameters: + step (float): The step size or speed of the forward movement. + """ self.move_x(abs(step)) def back(self, step): + """ + Moves the XGO robot backward. + + Parameters: + step (float): The step size or speed of the backward movement. + """ self.move_x(-abs(step)) def left(self, step): + """ + Moves the XGO robot to the left. + + Parameters: + step (float): The step size or speed of the leftward movement. + """ self.move_y(abs(step)) def right(self, step): + """ + Moves the XGO robot to the right. + + Parameters: + step (float): The step size or speed of the rightward movement. + """ self.move_y(-abs(step)) def turnleft(self, step): + """ + Turns the XGO robot to the left. + + Parameters: + step (float): The step size or speed of the left turn. + """ self.turn(abs(step)) def turnright(self, step): + """ + Turns the XGO robot to the right. + + Parameters: + step (float): The step size or speed of the right turn. + """ self.turn(-abs(step)) def move_by(self, distance, vx, vy, k, mintime): + """ + Moves the XGO robot a specific distance using a combination of x and y velocities. + + Parameters: + distance (float): The distance to move. + vx (float): The velocity along the x-axis. + vy (float): The velocity along the y-axis. + k (float): A scaling factor for the movement duration. + mintime (float): The minimum duration of the movement. + """ runtime = k * abs(distance) + mintime self.move_x(math.copysign(vx, distance)) self.move_y(math.copysign(vy, distance)) @@ -299,14 +449,41 @@ def move_by(self, distance, vx, vy, k, mintime): time.sleep(0.2) def move_x_by(self, distance, vx=18, k=0.035, mintime=0.55): + """ + Moves the XGO robot a specific distance along the x-axis. + + Parameters: + distance (float): The distance to move along the x-axis. + vx (float, optional): The velocity along the x-axis. Defaults to 18. + k (float, optional): A scaling factor for the movement duration. Defaults to 0.035. + mintime (float, optional): The minimum duration of the movement. Defaults to 0.55. + """ self.move_by(distance, vx, 0, k, mintime) pass def move_y_by(self, distance, vy=18, k=0.0373, mintime=0.5): + """ + Moves the XGO robot a specific distance along the y-axis. + + Parameters: + distance (float): The distance to move along the y-axis. + vy (float, optional): The velocity along the y-axis. Defaults to 18. + k (float, optional): A scaling factor for the movement duration. Defaults to 0.0373. + mintime (float, optional): The minimum duration of the movement. Defaults to 0.5. + """ self.move_by(distance, 0, vy, k, mintime) pass def turn_by(self, theta, mintime, vyaw=16, k=0.08): + """ + Turns the XGO robot by a specific angle. + + Parameters: + theta (float): The angle to turn (in degrees). + mintime (float): The minimum duration of the turn. + vyaw (float, optional): The angular velocity. Defaults to 16. + k (float, optional): A scaling factor for the turn duration. Defaults to 0.08. + """ runtime = abs(theta) * k + mintime self.turn(math.copysign(vyaw, theta)) time.sleep(runtime) @@ -314,6 +491,14 @@ def turn_by(self, theta, mintime, vyaw=16, k=0.08): pass def turn_to(self, theta, vyaw=60, emax=10): + """ + Turns the XGO robot to a specific absolute angle. + + Parameters: + theta (float): The target angle (in degrees). + vyaw (float, optional): The angular velocity. Defaults to 60. + emax (float, optional): The maximum error tolerance for the angle. Defaults to 10. + """ cur_yaw = self.read_yaw() des_yaw = self.init_yaw + theta while abs(des_yaw - cur_yaw) >= emax: @@ -324,6 +509,13 @@ def turn_to(self, theta, vyaw=60, emax=10): pass def __translation(self, direction, data): + """ + Translates the XGO robot's body along a specified axis. + + Parameters: + direction (str): The axis of translation ('x', 'y', or 'z'). + data (float): The translation amount. + """ index = search(direction, ['x', 'y', 'z']) if index == -1: print("ERROR!Direction must be 'x', 'y' or 'z'") @@ -333,8 +525,14 @@ def __translation(self, direction, data): def translation(self, direction, data): """ - 使机器狗足端不动,身体进行三轴平动 - Keep the robot's feet stationary and the body makes three-axis translation + Translates the XGO robot's body. + + Parameters: + direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these). + data (float or list): The translation amount(s). + + Raises: + ValueError: If the length of direction and data don't match when using a list. """ if isinstance(direction, list): if len(direction) != len(data): @@ -346,6 +544,13 @@ def translation(self, direction, data): self.__translation(direction, data) def __attitude(self, direction, data): + """ + Adjusts the XGO robot's body attitude along a specified axis. + + Parameters: + direction (str): The axis of attitude adjustment ('r' for roll, 'p' for pitch, or 'y' for yaw). + data (float): The attitude adjustment amount. + """ index = search(direction, ['r', 'p', 'y']) if index == -1: print("ERROR!Direction must be 'r', 'p' or 'y'") @@ -355,8 +560,14 @@ def __attitude(self, direction, data): def attitude(self, direction, data): """ - 使机器狗足端不动,身体进行三轴转动 - Keep the robot's feet stationary and the body makes three-axis rotation + Adjusts the XGO robot's body attitude. + + Parameters: + direction (str or list): The axis/axes of attitude adjustment ('r', 'p', 'y', or a list of these). + data (float or list): The attitude adjustment amount(s). + + Raises: + ValueError: If the length of direction and data don't match when using a list. """ if isinstance(direction, list): if len(direction) != len(data): @@ -369,8 +580,14 @@ def attitude(self, direction, data): def action(self, action_id, wait=False): """ - 使机器狗狗指定的预设动作 - Make the robot do the specified preset action + Makes the XGO robot perform a predefined action. + + Parameters: + action_id (int): The ID of the action to perform (1-255). + wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False. + + Raises: + ValueError: If an invalid action ID is provided. """ if action_id <= 0 or action_id > 255: print("ERROR!Illegal Action ID!") @@ -378,22 +595,27 @@ def action(self, action_id, wait=False): XGOorder["ACTION"][1] = action_id self.__send("ACTION") if wait: - st = ActionTime.get(action_id) + st = XGOparam["ActionTime"].get(action_id) if st: time.sleep(st) def reset(self): """ - 机器狗停止运动,所有参数恢复到初始状态 - The robot dog stops moving and all parameters return to the initial state + Resets the XGO robot to its initial state. """ self.action(255) time.sleep(1) def leg(self, leg_id, data): """ - 控制机器狗的单腿的三轴移动 - Control the three-axis movement of a single leg of the robot + Controls the three-axis movement of a single leg of the XGO robot. + + Parameters: + leg_id (int): The ID of the leg to control (1, 2, 3, or 4). + data (list): A list of three float values representing the x, y, and z coordinates of the leg's end effector. + + Raises: + ValueError: If an invalid leg ID or data length is provided. """ value = [0, 0, 0] if leg_id not in [1, 2, 3, 4]: @@ -413,6 +635,13 @@ def leg(self, leg_id, data): self.__send("LEG_POS", index) def __motor(self, index, data): + """ + Controls a single motor of the XGO robot. + + Parameters: + index (int): The index of the motor to control (1-15). + data (float): The target angle for the motor. + """ if index < 13: XGOorder["MOTOR_ANGLE"][index] = conver2u8(data, XGOparam["MOTOR_LIMIT"][(index - 1) % 3]) elif index == 13: @@ -424,8 +653,14 @@ def __motor(self, index, data): def motor(self, motor_id, data): """ - 控制机器狗单个舵机转动 - Control the rotation of a single steering gear of the robot + Controls one or more motors of the XGO robot. + + Parameters: + motor_id (int or list): The ID(s) of the motor(s) to control (11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, or 53). + data (float or list): The target angle(s) for the motor(s). + + Raises: + ValueError: If an invalid motor ID or data length is provided. """ MOTOR_ID = [11, 12, 13, 21, 22, 23, 31, 32, 33, 41, 42, 43, 51, 52, 53] @@ -447,6 +682,15 @@ def motor(self, motor_id, data): self.__motor(index, data) def unload_motor(self, leg_id): + """ + Unloads the motors of a specified leg. + + Parameters: + leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs). + + Raises: + ValueError: If an invalid leg ID is provided. + """ if leg_id not in [1, 2, 3, 4, 5]: print('ERROR!leg_id must be 1, 2, 3 ,4 or 5') return @@ -454,10 +698,22 @@ def unload_motor(self, leg_id): self.__send("UNLOAD_MOTOR") def unload_allmotor(self): + """ + Unloads all motors of the XGO robot. + """ XGOorder["UNLOAD_MOTOR"][1] = 0x01 self.__send("UNLOAD_MOTOR") def load_motor(self, leg_id): + """ + Loads the motors of a specified leg. + + Parameters: + leg_id (int): The ID of the leg (1, 2, 3, 4, or 5 for all legs). + + Raises: + ValueError: If an invalid leg ID is provided. + """ if leg_id not in [1, 2, 3, 4, 5]: print('ERROR!leg_id must be 1, 2, 3 ,4 or 5') return @@ -465,10 +721,20 @@ def load_motor(self, leg_id): self.__send("LOAD_MOTOR") def load_allmotor(self): + """ + Loads all motors of the XGO robot. + """ XGOorder["LOAD_MOTOR"][1] = 0x00 self.__send("LOAD_MOTOR") def __periodic_rot(self, direction, period): + """ + Initiates periodic rotation of the XGO robot's body along a specified axis. + + Parameters: + direction (str): The axis of rotation ('r' for roll, 'p' for pitch, or 'y' for yaw). + period (float): The period of rotation. + """ index = search(direction, ['r', 'p', 'y']) if index == -1: print("ERROR!Direction must be 'r', 'p' or 'y'") @@ -481,8 +747,14 @@ def __periodic_rot(self, direction, period): def periodic_rot(self, direction, period): """ - 使机器狗周期性转动 - Make the robot rotate periodically + Initiates periodic rotation of the XGO robot's body. + + Parameters: + direction (str or list): The axis/axes of rotation ('r', 'p', 'y', or a list of these). + period (float or list): The period(s) of rotation. + + Raises: + ValueError: If the length of direction and period don't match when using a list. """ if (isinstance(direction, list)): if (len(direction) != len(period)): @@ -494,6 +766,13 @@ def periodic_rot(self, direction, period): self.__periodic_rot(direction, period) def __periodic_tran(self, direction, period): + """ + Initiates periodic translation of the XGO robot's body along a specified axis. + + Parameters: + direction (str): The axis of translation ('x', 'y', or 'z'). + period (float): The period of translation. + """ index = search(direction, ['x', 'y', 'z']) if index == -1: print("ERROR!Direction must be 'x', 'y' or 'z'") @@ -506,8 +785,14 @@ def __periodic_tran(self, direction, period): def periodic_tran(self, direction, period): """ - 使机器狗周期性平动 - Make the robot translate periodically + Initiates periodic translation of the XGO robot's body. + + Parameters: + direction (str or list): The axis/axes of translation ('x', 'y', 'z', or a list of these). + period (float or list): The period(s) of translation. + + Raises: + ValueError: If the length of direction and period don't match when using a list. """ if isinstance(direction, list): if len(direction) != len(period): @@ -520,8 +805,10 @@ def periodic_tran(self, direction, period): def mark_time(self, data): """ - 使机器狗原地踏步 - Make the robot marks time + Makes the XGO robot mark time (原地踏步). + + Parameters: + data (float): The height of the mark time movement. Set to 0 to stop marking time. """ if data == 0: XGOorder["MarkTime"][1] = 0 @@ -531,8 +818,13 @@ def mark_time(self, data): def pace(self, mode): """ - 改变机器狗的踏步频率 - Change the step frequency of the robot + Changes the step frequency of the XGO robot. + + Parameters: + mode (str): The desired pace ('normal', 'slow', or 'high'). + + Raises: + ValueError: If an invalid pace mode is provided. """ if mode == "normal": value = 0x00 @@ -547,6 +839,12 @@ def pace(self, mode): self.__send("MOVE_MODE") def gait_type(self, mode): + """ + Sets the gait type of the XGO robot. + + Parameters: + mode (str): The desired gait type ('trot', 'walk', 'high_walk', or 'slow_trot'). + """ if mode == "trot": value = 0x00 elif mode == "walk": @@ -560,8 +858,13 @@ def gait_type(self, mode): def imu(self, mode): """ - 开启/关闭机器狗自稳状态 - Turn on / off the self stable state of the robot dog + Turns on/off the self-stabilization of the XGO robot. + + Parameters: + mode (int): 1 to turn on self-stabilization, 0 to turn it off. + + Raises: + ValueError: If an invalid mode value is provided. """ if mode != 0 and mode != 1: print("ERROR!Illegal Value!") @@ -571,8 +874,13 @@ def imu(self, mode): def perform(self, mode): """ - 开启/关闭机器狗循环做动作状态 - Turn on / off the action status of the robot dog cycle + Turns on/off the XGO robot's performance mode (循环做动作状态). + + Parameters: + mode (int): 1 to turn on performance mode, 0 to turn it off. + + Raises: + ValueError: If an invalid mode value is provided. """ if mode != 0 and mode != 1: print("ERROR!Illegal Value!") @@ -582,9 +890,13 @@ def perform(self, mode): def motor_speed(self, speed): """ - 调节舵机转动速度,只在单独控制舵机的情况下有效 - Adjust the steering gear rotation speed, - only effective when control the steering gear separately + Adjusts the rotation speed of the motors. + + Parameters: + speed (int): The desired motor speed (1-255). + + Raises: + ValueError: If an invalid speed value is provided. """ if speed < 0 or speed > 255: print("ERROR!Illegal Value!The speed parameter needs to be between 0 and 255!") @@ -595,6 +907,16 @@ def motor_speed(self, speed): self.__send("MOTOR_SPEED") def bt_rename(self, name): + """ + Renames the Bluetooth name of the XGO robot. + + Parameters: + name (str): The new Bluetooth name (maximum 10 characters, ASCII only). + + Raises: + TypeError: If the input is not a string. + ValueError: If the name is longer than 10 characters or contains non-ASCII characters. + """ if type(name) != str: print("ERROR!The input value must be of string type!") return @@ -610,7 +932,10 @@ def bt_rename(self, name): def read_motor(self): """ - 读取15个舵机的角度 + Reads the angles of all 15 motors. + + Returns: + list: A list of 15 float values representing the angles of the motors. """ self.__read(XGOorder["MOTOR_ANGLE"][0], 15) angle = [] @@ -623,6 +948,12 @@ def read_motor(self): return angle def read_battery(self): + """ + Reads the battery level of the XGO robot. + + Returns: + int: The battery level (0-100). + """ self.__read(XGOorder["BATTERY"][0], 1) battery = 0 if self.__unpack(): @@ -630,6 +961,12 @@ def read_battery(self): return battery def read_firmware(self): + """ + Reads the firmware version of the XGO robot. + + Returns: + str: The firmware version string. + """ self.__read(XGOorder["FIRMWARE_VERSION"][0], 10) firmware_version = 'Null' if self.__unpack(): @@ -641,6 +978,12 @@ def read_firmware(self): return firmware_version def read_roll(self): + """ + Reads the roll angle of the XGO robot. + + Returns: + float: The roll angle in degrees. + """ self.__read(XGOorder["ROLL"][0], 4) roll = 0 if self.__unpack(): @@ -648,6 +991,12 @@ def read_roll(self): return round(roll, 2) def read_pitch(self): + """ + Reads the pitch angle of the XGO robot. + + Returns: + float: The pitch angle in degrees. + """ self.__read(XGOorder["PITCH"][0], 4) pitch = 0 if self.__unpack(): @@ -655,6 +1004,12 @@ def read_pitch(self): return round(pitch, 2) def read_yaw(self): + """ + Reads the yaw angle of the XGO robot. + + Returns: + float: The yaw angle in degrees. + """ self.__read(XGOorder["YAW"][0], 4) yaw = 0 if self.__unpack(): @@ -662,6 +1017,15 @@ def read_yaw(self): return round(yaw, 2) def __unpack(self, timeout=1): + """ + Unpacks received data from the XGO robot. + + Parameters: + timeout (float, optional): The maximum time (in seconds) to wait for a complete data packet. Defaults to 1. + + Returns: + bool: True if a complete data packet was received and unpacked successfully, False otherwise. + """ t = time.time() rx_msg = [] while time.time() - t < timeout: @@ -739,9 +1103,21 @@ def __unpack(self, timeout=1): return False def set_move_mintime(self, mintime): + """ + Sets the minimum movement time for the XGO robot. + + Parameters: + mintime (float): The minimum movement time in seconds. + """ self.mintime = mintime def upgrade(self, filename): + """ + Upgrades the firmware of the XGO robot. + + Parameters: + filename (str): The path to the firmware file. + """ XGOorder["UPGRADE"][1] = 1 self.ser.flush() self.__send("UPGRADE") @@ -756,11 +1132,20 @@ def upgrade(self, filename): print("Upgrade Timeout!") def read_lib_version(self): + """ + Returns the version of the XGO Python library. + + Returns: + str: The library version string. + """ return __version__ def __send_bin(self, filename): """ - 处于测试阶段,请勿使用 + Sends a binary file to the XGO robot for firmware upgrade. (TESTING PHASE) + + Parameters: + filename (str): The path to the binary file. """ try: self.__change_baud(350000) @@ -777,7 +1162,13 @@ def __send_bin(self, filename): def calibration(self, state): """ - 用于软件标定,请谨慎使用!!! + Initiates or terminates the calibration process of the XGO robot. + + Parameters: + state (str): 'start' to initiate calibration, 'end' to terminate. + + Raises: + ValueError: If an invalid state is provided. """ if state == 'start': XGOorder["CALIBRATION"][1] = 1 @@ -790,8 +1181,14 @@ def calibration(self, state): def arm(self, arm_x, arm_z): """ - 控制机器狗的机械臂的前后和上下移动 - Control the movement of the arm of the robot + Controls the movement of the XGO robot's arm in the x and z directions. + + Parameters: + arm_x (float): The x-coordinate of the arm's end effector. + arm_z (float): The z-coordinate of the arm's end effector. + + Raises: + ValueError: If invalid arm_x or arm_z values are provided. """ try: arm_x_u8 = conver2u8(arm_x, XGOparam["ARM_LIMIT"][0]) @@ -806,8 +1203,14 @@ def arm(self, arm_x, arm_z): def arm_polar(self, arm_theta, arm_r): """ - 控制机器狗的机械臂的前后和上下移动 - Control the movement of the arm of the robot + Controls the movement of the XGO robot's arm using polar coordinates. + + Parameters: + arm_theta (float): The angle (theta) of the arm. + arm_r (float): The radial distance (r) of the arm's end effector. + + Raises: + ValueError: If invalid arm_theta or arm_r values are provided. """ try: arm_theta_u8 = conver2u8(arm_theta, XGOparam["ARM_LIMIT"][2]) @@ -821,6 +1224,15 @@ def arm_polar(self, arm_theta, arm_r): self.__send("ARM_R") def arm_mode(self, mode): + """ + Sets the mode of the XGO robot's arm. + + Parameters: + mode (int): The arm mode (0x00 or 0x01). + + Raises: + ValueError: If an invalid mode value is provided. + """ if mode != 0x01 and mode != 0x00: print("Error!Illegal Value!") return @@ -828,6 +1240,15 @@ def arm_mode(self, mode): self.__send("ARM_MODE") def claw(self, pos): + """ + Controls the position of the XGO robot's claw. + + Parameters: + pos (float): The desired claw position (0-255). + + Raises: + ValueError: If an invalid claw position value is provided. + """ try: claw_pos = conver2u8(pos, [0, 255]) except: @@ -837,6 +1258,16 @@ def claw(self, pos): self.__send("CLAW") def btRename(self, name): + """ + Renames the Bluetooth name of the XGO robot (alternative implementation). + + Parameters: + name (str): The new Bluetooth name (maximum 20 characters, alphanumeric only). + + Raises: + TypeError: If the input is not a string. + ValueError: If the name is longer than 20 characters or contains non-alphanumeric characters. + """ length = len(name) if not isinstance(name, str): print("Wrong type!") @@ -861,9 +1292,19 @@ def btRename(self, name): self.__send("BT_NAME", len=length) def moveToMid(self): + """ + Moves the XGO robot's legs to their middle position. + """ self.__send("MOVE_TO_MID") def teach(self, mode, pos_id): + """ + Records or plays back a taught position for the XGO robot's legs. + + Parameters: + mode (str): 'record' to record a position, 'play' to play back a recorded position. + pos_id (int): The ID of the position to record or play back. + """ if mode == "play": XGOorder["TEACH_PLAY"][1] = pos_id self.__send("TEACH_PLAY") @@ -874,6 +1315,13 @@ def teach(self, mode, pos_id): return def teach_arm(self, mode, pos_id): + """ + Records or plays back a taught position for the XGO robot's arm. + + Parameters: + mode (str): 'record' to record a position, 'play' to play back a recorded position. + pos_id (int): The ID of the position to record or play back. + """ if mode == "play": XGOorder["TEACH_ARM_PLAY"][1] = pos_id self.__send("TEACH_ARM_PLAY") @@ -884,6 +1332,15 @@ def teach_arm(self, mode, pos_id): return def arm_speed(self, speed): + """ + Adjusts the rotation speed of the arm. + + Parameters: + speed (int): The desired arm speed (1-255). + + Raises: + ValueError: If an invalid speed value is provided. + """ if speed < 0 or speed > 255: print("ERROR!Illegal Value!The speed parameter needs to be between 0 and 255!") return @@ -893,6 +1350,12 @@ def arm_speed(self, speed): self.__send("ARM_SPEED") def read_imu(self): + """ + Reads IMU (Inertial Measurement Unit) data from the XGO robot. + + Returns: + list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw]. + """ self.__read(0x65, 24) result = [] if self.__unpack(): @@ -900,6 +1363,15 @@ def read_imu(self): return result def read_imu_int16(self, direction): + """ + Reads IMU data as signed 16-bit integers for a specific direction. + + Parameters: + direction (str): The direction to read ('roll', 'pitch', or 'yaw'). + + Returns: + int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided. + """ if direction == "roll": self.__read(0x66, 2) elif direction == "pitch": @@ -914,6 +1386,12 @@ def read_imu_int16(self, direction): return result def unpack_imu(self): + """ + Unpacks raw IMU data into meaningful values. + + Returns: + list: A list containing 9 float values: [acceleration_x, acceleration_y, acceleration_z, gyro_x, gyro_y, gyro_z, roll, pitch, yaw]. + """ result = [] for i in range(9): a = bytearray() @@ -933,21 +1411,42 @@ def unpack_imu(self): return result def set_origin(self): + """ + Sets the current position of the XGO robot as the origin. + """ XGOorder["SET_ORIGIN"][1] = 1 self.__send("SET_ORIGIN") def move_to(self, data): + """ + Moves the robot to a specified position. + + Parameters: + data (int): The target position value. + """ packed_data = struct.pack('>h', data) XGOorder["MOVE_TO"][1] = packed_data[0] XGOorder["MOVE_TO"][2] = packed_data[1] self.__send("MOVE_TO", len=2) def output_analog(self, data): + """ + Sets the analog output value. + + Parameters: + data (int): The analog output value. + """ XGOorder["OUTPUT_ANALOG"][1] = data self.__send("OUTPUT_ANALOG") pass def output_digital(self, data): + """ + Sets the digital output value. + + Parameters: + data (int): The digital output value. + """ XGOorder["OUTPUT_DIGITAL"][1] = data self.__send("OUTPUT_DIGITAL") pass @@ -955,6 +1454,13 @@ def output_digital(self, data): ############# RIDER ################ def rider_move_x(self, speed, runtime=0): + """ + Moves the XGO Rider along the x-axis. + + Parameters: + speed (float): The speed of movement along the x-axis. + runtime (float, optional): The duration of the movement in seconds. If provided, the robot will stop moving after this duration. Defaults to 0. + """ XGOorder["VX"][1] = conver2u8(speed, XGOparam["VX_LIMIT"]) self.__send("VX") if runtime: @@ -963,6 +1469,13 @@ def rider_move_x(self, speed, runtime=0): self.__send("VX") def rider_turn(self, speed, runtime=0): + """ + Turns the XGO Rider. + + Parameters: + speed (float): The speed of the turn. + runtime (float, optional): The duration of the turn in seconds. If provided, the robot will stop turning after this duration. Defaults to 0. + """ XGOorder["VYAW"][1] = conver2u8(speed, XGOparam["VYAW_LIMIT"]) self.__send("VYAW") if runtime: @@ -971,10 +1484,23 @@ def rider_turn(self, speed, runtime=0): self.__send("VYAW") def rider_reset_odom(self): + """ + Resets the odometry of the XGO Rider. + """ XGOorder["SET_ORIGIN"][1] = 1 self.__send("SET_ORIGIN") def rider_action(self, action_id, wait=False): + """ + Makes the XGO Rider perform a predefined action. + + Parameters: + action_id (int): The ID of the action to perform (1-255). + wait (bool, optional): If True, the program will wait for the action to complete before proceeding. Defaults to False. + + Raises: + ValueError: If an invalid action ID is provided. + """ if action_id <= 0 or action_id > 255: print("ERROR!Illegal Action ID!") return @@ -986,6 +1512,15 @@ def rider_action(self, action_id, wait=False): time.sleep(st) def rider_balance_roll(self, mode): + """ + Turns on/off the roll balance of the XGO Rider. + + Parameters: + mode (int): 1 to turn on roll balance, 0 to turn it off. + + Raises: + ValueError: If an invalid mode value is provided. + """ if mode != 0 and mode != 1: print("ERROR!Illegal Value!") return @@ -993,6 +1528,15 @@ def rider_balance_roll(self, mode): self.__send("IMU") def rider_perform(self, mode): + """ + Turns on/off the XGO Rider's performance mode. + + Parameters: + mode (int): 1 to turn on performance mode, 0 to turn it off. + + Raises: + ValueError: If an invalid mode value is provided. + """ if mode != 0 and mode != 1: print("ERROR!Illegal Value!") return @@ -1001,7 +1545,13 @@ def rider_perform(self, mode): def rider_calibration(self, state): """ - 用于软件标定,请谨慎使用!!! + Initiates or terminates the calibration process of the XGO Rider. + + Parameters: + state (str): 'start' to initiate calibration, 'end' to terminate. + + Raises: + ValueError: If an invalid state is provided. """ if state == 'start': XGOorder["CALIBRATION"][1] = 1 @@ -1013,18 +1563,48 @@ def rider_calibration(self, state): return def rider_height(self, data): + """ + Adjusts the height of the XGO Rider. + + Parameters: + data (float): The desired height. + """ self.__translation("z", data) def rider_roll(self, data): + """ + Adjusts the roll angle of the XGO Rider. + + Parameters: + data (float): The desired roll angle. + """ self.__attitude("r", data) def rider_periodic_roll(self, period): + """ + Initiates periodic roll movement of the XGO Rider. + + Parameters: + period (float): The period of the roll movement. + """ self.__periodic_rot("r", period) def rider_periodic_z(self, period): + """ + Initiates periodic vertical movement of the XGO Rider. + + Parameters: + period (float): The period of the vertical movement. + """ self.__periodic_tran("z", period) def rider_read_battery(self): + """ + Reads the battery level of the XGO Rider. + + Returns: + int: The battery level (0-100). + """ self.__read(XGOorder["BATTERY"][0], 1) battery = 0 if self.__unpack(): @@ -1032,6 +1612,12 @@ def rider_read_battery(self): return battery def rider_read_firmware(self): + """ + Reads the firmware version of the XGO Rider. + + Returns: + str: The firmware version string. + """ self.__read(XGOorder["FIRMWARE_VERSION"][0], 10) firmware_version = 'Null' if self.__unpack(): @@ -1043,6 +1629,12 @@ def rider_read_firmware(self): return firmware_version def rider_read_roll(self): + """ + Reads the roll angle of the XGO Rider. + + Returns: + float: The roll angle in degrees. + """ self.__read(XGOorder["ROLL"][0], 4) roll = 0 if self.__unpack(): @@ -1050,6 +1642,12 @@ def rider_read_roll(self): return round(roll, 2) def rider_read_pitch(self): + """ + Reads the pitch angle of the XGO Rider. + + Returns: + float: The pitch angle in degrees. + """ self.__read(XGOorder["PITCH"][0], 4) pitch = 0 if self.__unpack(): @@ -1057,6 +1655,12 @@ def rider_read_pitch(self): return round(pitch, 2) def rider_read_yaw(self): + """ + Reads the yaw angle of the XGO Rider. + + Returns: + float: The yaw angle in degrees. + """ self.__read(XGOorder["YAW"][0], 4) yaw = 0 if self.__unpack(): @@ -1064,6 +1668,15 @@ def rider_read_yaw(self): return round(yaw, 2) def rider_read_imu_int16(self, direction): + """ + Reads IMU data as signed 16-bit integers for a specific direction on the XGO Rider. + + Parameters: + direction (str): The direction to read ('roll', 'pitch', or 'yaw'). + + Returns: + int or None: The IMU value as a signed 16-bit integer, or None if an invalid direction is provided. + """ if direction == "roll": self.__read(0x66, 2) elif direction == "pitch": @@ -1078,9 +1691,18 @@ def rider_read_imu_int16(self, direction): return result def rider_reset(self): + """ + Resets the XGO Rider. + """ return self.reset() def rider_upgrade(self, filename): + """ + Upgrades the firmware of the XGO Rider. + + Parameters: + filename (str): The path to the firmware file. + """ XGOorder["UPGRADE"][1] = 1 self.ser.flush() self.__send("UPGRADE") @@ -1095,7 +1717,13 @@ def rider_upgrade(self, filename): print("Upgrade Timeout!") def rider_led(self, index, color): + """ + Sets the color of an LED on the XGO Rider. + + Parameters: + index (int): The index of the LED (likely 1-4 depending on hardware). + color (list): A list of three integers representing the RGB color values (0-255 each). + """ XGOorder["LED_COLOR"][0] = 0x68 + index XGOorder["LED_COLOR"][1:4] = color self.__send("LED_COLOR", len=3) - diff --git a/xgoscreen/LCD_2inch.py b/xgoscreen/LCD_2inch.py index 61e9d8c..b401350 100644 --- a/xgoscreen/LCD_2inch.py +++ b/xgoscreen/LCD_2inch.py @@ -1,39 +1,69 @@ - import time import xgoscreen.lcdconfig as lcdconfig class LCD_2inch(lcdconfig.RaspberryPi): + """ + This class provides a high-level interface for controlling a 2-inch LCD display using the Raspberry Pi. + It inherits from the `lcdconfig.RaspberryPi` class to manage low-level hardware interactions. + + Attributes: + width (int): The width of the LCD display in pixels (240). + height (int): The height of the LCD display in pixels (320). + """ width = 240 - height = 320 + height = 320 + def command(self, cmd): + """ + Sends a command to the LCD controller. + + Parameters: + cmd (int): The command byte to send. + """ self.digital_write(self.DC_PIN, self.GPIO.LOW) self.spi_writebyte([cmd]) def data(self, val): + """ + Sends a data byte to the LCD controller. + + Parameters: + val (int): The data byte to send. + """ self.digital_write(self.DC_PIN, self.GPIO.HIGH) self.spi_writebyte([val]) + def reset(self): - """Reset the display""" - self.GPIO.output(self.RST_PIN,self.GPIO.HIGH) + """ + Resets the LCD display. + """ + self.GPIO.output(self.RST_PIN, self.GPIO.HIGH) time.sleep(0.01) - self.GPIO.output(self.RST_PIN,self.GPIO.LOW) + self.GPIO.output(self.RST_PIN, self.GPIO.LOW) time.sleep(0.01) - self.GPIO.output(self.RST_PIN,self.GPIO.HIGH) + self.GPIO.output(self.RST_PIN, self.GPIO.HIGH) time.sleep(0.01) - + def Init(self): - """Initialize dispaly""" + """ + Initializes the LCD display. + + This method performs the following steps: + 1. Initializes the Raspberry Pi module using `module_init()`. + 2. Resets the LCD display using `reset()`. + 3. Sends a sequence of commands and data bytes to configure the display controller. + """ self.module_init() self.reset() self.command(0x36) - self.data(0x00) + self.data(0x00) - self.command(0x3A) + self.command(0x3A) self.data(0x05) - self.command(0x21) + self.command(0x21) self.command(0x2A) self.data(0x00) @@ -55,7 +85,7 @@ def Init(self): self.data(0x33) self.command(0xB7) - self.data(0x35) + self.data(0x35) self.command(0xBB) self.data(0x1F) @@ -67,13 +97,13 @@ def Init(self): self.data(0x01) self.command(0xC3) - self.data(0x12) + self.data(0x12) self.command(0xC4) self.data(0x20) self.command(0xC6) - self.data(0x0F) + self.data(0x0F) self.command(0xD0) self.data(0xA4) @@ -116,64 +146,84 @@ def Init(self): self.command(0x29) - def SetWindows(self, Xstart, Ystart, Xend, Yend): - #set the X coordinates + """ + Sets the active window area on the LCD display. + + Parameters: + Xstart (int): The starting X-coordinate of the window. + Ystart (int): The starting Y-coordinate of the window. + Xend (int): The ending X-coordinate of the window. + Yend (int): The ending Y-coordinate of the window. + """ + # set the X coordinates self.command(0x2A) - self.data(Xstart>>8) #Set the horizontal starting point to the high octet - self.data(Xstart & 0xff) #Set the horizontal starting point to the low octet - self.data(Xend>>8) #Set the horizontal end to the high octet - self.data((Xend - 1) & 0xff)#Set the horizontal end to the low octet + self.data(Xstart >> 8) # Set the horizontal starting point to the high octet + self.data(Xstart & 0xff) # Set the horizontal starting point to the low octet + self.data(Xend >> 8) # Set the horizontal end to the high octet + self.data((Xend - 1) & 0xff) # Set the horizontal end to the low octet - #set the Y coordinates + # set the Y coordinates self.command(0x2B) - self.data(Ystart>>8) + self.data(Ystart >> 8) self.data((Ystart & 0xff)) - self.data(Yend>>8) - self.data((Yend - 1) & 0xff ) + self.data(Yend >> 8) + self.data((Yend - 1) & 0xff) - self.command(0x2C) - - def ShowImage(self,Image,Xstart=0,Ystart=0): + self.command(0x2C) + + def ShowImage(self, Image, Xstart=0, Ystart=0): + """ + Displays a PIL (Pillow) Image on the LCD. + + Parameters: + Image (PIL.Image.Image): The image to display. + Xstart (int, optional): The starting X-coordinate for displaying the image. Defaults to 0. + Ystart (int, optional): The starting Y-coordinate for displaying the image. Defaults to 0. + """ """Set buffer to value of Python Imaging Library image.""" """Write display buffer to physical display""" imwidth, imheight = Image.size - if imwidth == self.height and imheight == self.width: + if imwidth == self.height and imheight == self.width: img = self.np.asarray(Image) - pix = self.np.zeros((self.width, self.height,2), dtype = self.np.uint8) - #RGB888 >> RGB565 - pix[...,[0]] = self.np.add(self.np.bitwise_and(img[...,[0]],0xF8),self.np.right_shift(img[...,[1]],5)) - pix[...,[1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[...,[1]],3),0xE0), self.np.right_shift(img[...,[2]],3)) + pix = self.np.zeros((self.width, self.height, 2), dtype=self.np.uint8) + # RGB888 >> RGB565 + pix[..., [0]] = self.np.add(self.np.bitwise_and(img[..., [0]], 0xF8), self.np.right_shift(img[..., [1]], 5)) + pix[..., [1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[..., [1]], 3), 0xE0), + self.np.right_shift(img[..., [2]], 3)) pix = pix.flatten().tolist() - + self.command(0x36) - self.data(0x70) - self.SetWindows ( 0, 0, self.height,self.width) - self.digital_write(self.DC_PIN,self.GPIO.HIGH) - for i in range(0,len(pix),4096): - self.spi_writebyte(pix[i:i+4096]) - - else : + self.data(0x70) + self.SetWindows(0, 0, self.height, self.width) + self.digital_write(self.DC_PIN, self.GPIO.HIGH) + for i in range(0, len(pix), 4096): + self.spi_writebyte(pix[i:i + 4096]) + + else: img = self.np.asarray(Image) - pix = self.np.zeros((imheight,imwidth , 2), dtype = self.np.uint8) - - pix[...,[0]] = self.np.add(self.np.bitwise_and(img[...,[0]],0xF8),self.np.right_shift(img[...,[1]],5)) - pix[...,[1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[...,[1]],3),0xE0), self.np.right_shift(img[...,[2]],3)) + pix = self.np.zeros((imheight, imwidth, 2), dtype=self.np.uint8) + + pix[..., [0]] = self.np.add(self.np.bitwise_and(img[..., [0]], 0xF8), self.np.right_shift(img[..., [1]], 5)) + pix[..., [1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[..., [1]], 3), 0xE0), + self.np.right_shift(img[..., [2]], 3)) pix = pix.flatten().tolist() - + self.command(0x36) - self.data(0x00) - self.SetWindows ( 0, 0, self.width, self.height) - self.digital_write(self.DC_PIN,self.GPIO.HIGH) - for i in range(0,len(pix),4096): - self.spi_writebyte(pix[i:i+4096]) - + self.data(0x00) + self.SetWindows(0, 0, self.width, self.height) + self.digital_write(self.DC_PIN, self.GPIO.HIGH) + for i in range(0, len(pix), 4096): + self.spi_writebyte(pix[i:i + 4096]) + def clear(self): + """ + Clears the LCD display by filling it with white color (0xff). + """ """Clear contents of image buffer""" - _buffer = [0xff]*(self.width * self.height * 2) - self.SetWindows ( 0, 0, self.height, self.width) - self.digital_write(self.DC_PIN,self.GPIO.HIGH) - for i in range(0,len(_buffer),4096): - self.spi_writebyte(_buffer[i:i+4096]) - + _buffer = [0xff] * (self.width * self.height * 2) + self.SetWindows(0, 0, self.height, self.width) + self.digital_write(self.DC_PIN, self.GPIO.HIGH) + for i in range(0, len(_buffer), 4096): + self.spi_writebyte(_buffer[i:i + 4096]) \ No newline at end of file diff --git a/xgoscreen/lcdconfig.py b/xgoscreen/lcdconfig.py index 34b925d..d49951e 100644 --- a/xgoscreen/lcdconfig.py +++ b/xgoscreen/lcdconfig.py @@ -6,67 +6,142 @@ import numpy as np class RaspberryPi: - def __init__(self,spi=spidev.SpiDev(0,0),spi_freq=40000000,rst = 27,dc = 25,bl = 0,bl_freq=1000,i2c=None,i2c_freq=100000): - import RPi.GPIO - self.np=np - self.RST_PIN= rst + """ + This class provides an interface for controlling hardware peripherals on a Raspberry Pi, specifically SPI, GPIO, and PWM, for use with devices like LCD displays. + + Attributes: + RST_PIN (int): GPIO pin number for the reset signal. + DC_PIN (int): GPIO pin number for the data/command signal. + BL_PIN (int): GPIO pin number for the backlight control signal. + SPEED (int): SPI communication frequency. + BL_freq (int): PWM frequency for backlight control. + GPIO (RPi.GPIO): The RPi.GPIO module for GPIO control. + SPI (spidev.SpiDev or None): The spidev.SpiDev object for SPI communication, or None if not used. + _pwm (RPi.GPIO.PWM): The PWM object for backlight control. + """ + def __init__(self, spi=spidev.SpiDev(0, 0), spi_freq=40000000, rst=27, dc=25, bl=0, bl_freq=1000, i2c=None, i2c_freq=100000): + """ + Initializes the RaspberryPi object and configures GPIO, SPI, and PWM. + + Parameters: + spi (spidev.SpiDev, optional): The SPI device object. Defaults to spidev.SpiDev(0, 0). Set to None to disable SPI. + spi_freq (int, optional): The SPI communication frequency in Hz. Defaults to 40000000. + rst (int, optional): The GPIO pin number for the reset signal. Defaults to 27. + dc (int, optional): The GPIO pin number for the data/command signal. Defaults to 25. + bl (int, optional): The GPIO pin number for the backlight control signal. Defaults to 0. + bl_freq (int, optional): The PWM frequency for backlight control in Hz. Defaults to 1000. + i2c (None, optional): Placeholder for I2C configuration (not implemented in this version). Defaults to None. + i2c_freq (int, optional): Placeholder for I2C frequency (not implemented in this version). Defaults to 100000. + """ + import RPi.GPIO + self.np = np + self.RST_PIN = rst self.DC_PIN = dc self.BL_PIN = bl - self.SPEED =spi_freq - self.BL_freq=bl_freq + self.SPEED = spi_freq + self.BL_freq = bl_freq self.GPIO = RPi.GPIO - #self.GPIO.cleanup() + # self.GPIO.cleanup() self.GPIO.setmode(self.GPIO.BCM) self.GPIO.setwarnings(False) - self.GPIO.setup(self.RST_PIN, self.GPIO.OUT) - self.GPIO.setup(self.DC_PIN, self.GPIO.OUT) - self.GPIO.setup(self.BL_PIN, self.GPIO.OUT) - self.GPIO.output(self.BL_PIN, self.GPIO.HIGH) - #Initialize SPI + self.GPIO.setup(self.RST_PIN, self.GPIO.OUT) + self.GPIO.setup(self.DC_PIN, self.GPIO.OUT) + self.GPIO.setup(self.BL_PIN, self.GPIO.OUT) + self.GPIO.output(self.BL_PIN, self.GPIO.HIGH) + # Initialize SPI self.SPI = spi - if self.SPI!=None : + if self.SPI != None: self.SPI.max_speed_hz = spi_freq self.SPI.mode = 0b00 def digital_write(self, pin, value): + """ + Writes a digital value to a specified GPIO pin. + + Parameters: + pin (int): The GPIO pin number. + value (int): The value to write (HIGH or LOW, 1 or 0). + """ self.GPIO.output(pin, value) def digital_read(self, pin): + """ + Reads the digital value from a specified GPIO pin. + + Parameters: + pin (int): The GPIO pin number. + + Returns: + int: The digital value read from the pin (HIGH or LOW, 1 or 0). + """ return self.GPIO.input(pin) def delay_ms(self, delaytime): + """ + Pauses the program execution for a specified number of milliseconds. + + Parameters: + delaytime (int): The delay time in milliseconds. + """ time.sleep(delaytime / 1000.0) def spi_writebyte(self, data): - if self.SPI!=None : + """ + Writes a list of bytes to the SPI bus. + + Parameters: + data (list): A list of bytes (integers) to be transmitted. + """ + if self.SPI != None: self.SPI.writebytes(data) + def bl_DutyCycle(self, duty): + """ + Sets the duty cycle of the PWM signal for backlight control. + + Parameters: + duty (int): The duty cycle percentage (0-100). + """ self._pwm.ChangeDutyCycle(duty) - - def bl_Frequency(self,freq): + + def bl_Frequency(self, freq): + """ + Sets the frequency of the PWM signal for backlight control. + + Parameters: + freq (int): The PWM frequency in Hz. + """ self._pwm.ChangeFrequency(freq) - + def module_init(self): + """ + Initializes the module by setting up GPIO pins and starting PWM for backlight control. + + Returns: + int: 0 if initialization is successful. + """ self.GPIO.setup(self.RST_PIN, self.GPIO.OUT) self.GPIO.setup(self.DC_PIN, self.GPIO.OUT) self.GPIO.setup(self.BL_PIN, self.GPIO.OUT) - self._pwm=self.GPIO.PWM(self.BL_PIN,self.BL_freq) + self._pwm = self.GPIO.PWM(self.BL_PIN, self.BL_freq) self._pwm.start(100) - if self.SPI!=None : - self.SPI.max_speed_hz = self.SPEED - self.SPI.mode = 0b00 + if self.SPI != None: + self.SPI.max_speed_hz = self.SPEED + self.SPI.mode = 0b00 return 0 def module_exit(self): + """ + Cleans up the module by closing the SPI connection, stopping PWM, and resetting GPIO pins. + """ logging.debug("spi end") - if self.SPI!=None : + if self.SPI != None: self.SPI.close() - + logging.debug("gpio cleanup...") self.GPIO.output(self.RST_PIN, 1) - self.GPIO.output(self.DC_PIN, 0) + self.GPIO.output(self.DC_PIN, 0) self._pwm.stop() time.sleep(0.001) self.GPIO.output(self.BL_PIN, 1) - #self.GPIO.cleanup() - + # self.GPIO.cleanup() \ No newline at end of file