logo

如何讲apriltag的六个数值传输的stm32上?后面一部分看不懂不会改?

2024-04-19 15:27
7
_54bc
c_x = 160 * 0.5 # 默认值(image.w * 0.5)
c_y = 120 * 0.5 # 默认值(image.h * 0.5)图片位置

def degrees(radians):
    return (180 * radians) / math.pi#计算弧度

while(True):
    img = sensor.snapshot() # Take a picture and return the image.

   for tag in img.find_apriltags(fx=f_x, fy=f_y, cx=c_x, cy=c_y): # 默认为TAG36H11
    if blobs:
        print('sum :', len(apriltag))
        output_str = json.dumps(apriltag)
        for a in apriltag:
            # Draw a rect around the blob.
            img.draw_rectangle(a.rect()) # rect
            img.draw_cross(a.cx(), a.cy()) # cx, cy

        print('you send:',output_str)
        uart.write(output_str+'\n')
    else:
        print('not found!')
2024-04-22 18:24
I
网红小智智 星瞳科技

你要先确定好协议,用二进制发送,还是字符串发送,然后生成数据。