GithubHelp home page GithubHelp logo

aria-shelock / hanoi_on_loongnix Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 636 KB

A simple Hanoi recognition, solution and manipulator's motion program.

Python 27.06% Makefile 2.71% C 69.78% Shell 0.45%
hanoi-game loongnix

hanoi_on_loongnix's Introduction

龙芯上汉诺塔的演示

Five-order Hanoi

在这个文件夹中包含hanoi.py与input.txt,在使用时需要在此文件夹下存入待识别的图片(例如1.bmp),然后在终端输入

python hanoi.py --image 1.bmp

此时可以得到step.txt文件,里面记录的是操作汉诺塔的步骤

本代码支持修改汉诺塔的截止状态,打开input.txt,其自上而下的三行分别对应从左至右的三根柱子,第一列统一为柱子上盘片的数量,其后从大至小分别记录盘片

0
0
5 5 4 3 2 1

在完成一次识别-生成步骤后,务必删除step.txt文件,再进行下一次运行。

Three-order Hanoi

在这个文件夹包含final.py,mail.py,open_uart.py,input.txt,在使用时需要在此文件夹下存入待识别的图片(例如1.bmp),然后在终端输入

python final.py --image 1.bmp
python mail.py
python open_uart.py

此时可以得到control.txt文件,里面记录的是串口通信的记录,并且将操作发送至机械臂

与Five-order Hanoi相同,其记录截止状态的input.txt也可以进行更改,语法与其一致

在完成一次识别-生成步骤后,务必删除step.txt,temp.txt与control.txt文件,再进行下一次运行。

camshot-master

该文件夹保存了拍摄照片的代码实现方法

contours.py

该代码可以可视化地观察:程序识别出的汉诺塔盘片的轮廓,该程序会生成一张带有矩形轮廓和其颜色标签的图像,也可以通过此程序预先检查识别模块是否正常工作

python contours.py --image 1.bmp

hanoi_on_loongnix's People

Contributors

aria-shelock avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.