cad2025 電腦輔助設計與實習

  • Home
    • SMap
    • reveal
    • blog
  • About
    • Mind-Map
    • AI
      • Teams
      • Prompts
    • Homework
      • HW2
      • Plotter
  • Topics
    • Network
    • ICMP
    • IPv6
    • DNS
    • Proxy
    • Web
      • Codespaces
  • Software
    • Git
    • CMSiMDE
      • Flask
    • Solvespace
      • Compile
    • NX2312
      • License
    • Onshape
    • Webots
      • Fourbar
      • TimeStep
      • Clouds
      • Talks
      • Blender
      • Ardupilot
  • Tutorial
    • Stage1
      • Tutorial1
      • Tutorial2
    • Stage2
      • Tutorial3
      • Distancesensor
      • Tutorial4
      • Tutorial5
    • Stage3
      • Tutorial6
      • Tutorial7
      • Stream
      • Webots Server
  • Projects
    • Control
    • Printer
    • Otto
    • Otto_ninja-1
      • Simplify
    • OpenDuck
    • Pupper
    • JetAcker
  • Brython
  • Ref
    • Reeborg
      • ex1
      • Otto_ninja-2
    • Pyodide
    • Pyodide_ex
    • Pyodide2
      • robot.py
      • Example2
    • Pyodide3
      • png_files
      • Harvest
Example2 << Previous Next >> png_files

Pyodide3

Pyodide3 則在 Pyodide 與 Pyodide2 頁面架構下,進一步導入 robot_w_world.py,在既有的水平圍牆 north.png 與垂直圍牆 east.png 檔案之外,加入 carrot.png、grass.png 與 pale_grass.png 等圖檔。並且擴充可從 URL 讀進 json 格式的 world 變數功能,以便製作出更多元的場景任務,要求機器人執行。

其中 src URL 變數,可以將網路上的機器人控制程式導入 Pyodide3 頁面外,world URL 變數則可以導入源自 Reeborg 機器人程式所設定的 json 格式場景。

由於 Reeborg 系統中的 png 圖檔均非透明背景,robot_w_world.py 必須利用 HTML 中的 CANVAS,將關鍵的白色背景,以透明的方式顯示。

src URL 變數讀進 turn_right 程式,而 world URL 變數則讀進 harvest2.json,執行結果。

讀進 harvest3.json, 執行結果。


從 1 累加到 100 part2:


Example2 << Previous Next >> png_files

Copyright © All rights reserved | This template is made with by Colorlib