while(True):
clock.tick()
img = sensor.snapshot()
tags = sorted(img.find_apriltags(fx=f_x, fy=f_y, cx=c_x, cy=c_y), key = lambda x: x.w() * x.h(), reverse = True)
if tags and (tags[0].id() in valid_tag_ids):
if MAX_DISTANCE_SENSOR_enable: send_distance_sensor_packet(tags[0], valid_tag_ids[tags[0].id()])
send_landing_target_packet(tags[0], img.width(), img.height(), valid_tag_ids[tags[0].id()])
img.draw_rectangle(tags[0].rect(),(255,0,0))
img.draw_cross(tags[0].cx(), tags[0].cy(),(255,0,0))
print("Distance %f m - FPS %f" % (z_to_mm(tags[0].z_translation(), valid_tag_ids[tags[0].id()])/1000, clock.fps()))
else:
print("FPS %f" % clock.fps())
Q
qkdr
@qkdr
0
声望
1
楼层
294
资料浏览
0
粉丝
0
关注
qkdr 发布的帖子
-
求问AprilTag定点降落代码中的MAX_DISTANCE_SENSOR_enable是什么意思呢