from uexplore_interfaces import Event
from uexplore_interfaces import AIVision
from uexplore_interfaces import Screen
from uexplore_interfaces import Model
from uexplore_interfaces import Math
import math
from uexplore_interfaces import Utils

_E6_88_91_E7_9A_84_E5_8F_98_E9_87_8F = 0
_E6_97_8B_E8_BD_AC_E5_80_BC = 0


def on_start_event():
  global _E6_97_8B_E8_BD_AC_E5_80_BC

  AIVision.load_model([AIVision.Model.track_recognition])
  AIVision.set_track_recognition_line(AIVision.LineType.single)
  while True:
      _E6_97_8B_E8_BD_AC_E5_80_BC = (0.25 * AIVision.get_single_track_offset())
      Screen.print_text_newline(((str('单轨偏移量:') + str(AIVision.get_single_track_offset()))),Screen.Color.white)
      Model.mecanum_move_xyz(0,20,Math.round_up(Utils.parseToNumber(_E6_97_8B_E8_BD_AC_E5_80_BC)))
      if (AIVision.check_single_track_intersection(AIVision.Intersection.noline)):
          Model.mecanum_stop()
          break

      Screen.print_text_newline(((str('旋转值:') + str(Utils.parseToNumber(_E6_97_8B_E8_BD_AC_E5_80_BC)))),Screen.Color.yellow)

Event.register_start(on_start_event)

 

  

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。