GithubHelp home page GithubHelp logo

marscatapi's Introduction

MarsCat 开发手册

开发前的准备

  • 连接显示器、鼠标、键盘

  • 连接wifi后,用ssh或vnc等远程连接

    注 账户和密码都是 pi

  • 在开发前需要停止猫咪的开机自启服务

    cd ~/marsai
    ./tools/stop-systemd-services.sh
    ./tools/disable-systemd-services.sh
    
  • 如果你要放弃了,重启猫的服务

    cd ~/marsai
    ./tools/enable-systemd-services.sh
    ./tools/start-systemd-services.sh
    

基本运动

# file: move/movement.py
# See this file for more functions

import movement

mv = movement.MoveMent()
mv.set_walk(step = 2, speed = 0.7)
...

触摸检测

# file: sensor/touch.py

import touch

tc = touch.Touch()
tc.test_touch()

显示眼睛

# file: eye/eyedisplay.py

import eyedisplay

eyes = eyedisplay.EyeDisplay()
eyes.display_eye(ball_num = 1, lid_num = 1, ball_type = 'eye_ball', dx = 0, dy = 0)

"""
args:
    ball_num --> int:
        normal eye_ball : 1~10 [e.g. eye_ball]
	eyes with animation : 1~3 [e.g. flip, hug, ball, etc]

        # Eyeball size
    lid_num --> int:
        1~14, 31~40
        # Eyelid size
    ball_type --> str:
        [eye_ball, ball, face, flip, heat, hug, teaser, voice,
                         low_power, charging, dizzy, bowlorhungry, sleep
                         high_temperature, hw_error]
        # To select which folder the picture comes from
        # eye/eyeball/
    dx,dy --> int:
        # Coordinates of eyeball
        # (0, 0) in the middle
"""

播放声音

# file: sound/catsound.py

import catsound

s = CatSound()
s.meow()

图像识别

# file: vision/vision_base.py

import vision_base

vision = vision_base.Vision()
vision.test()

可以对人脸、蓝色的小球以及配套的二维码进行识别。

语音识别

# file: voice/voice_base.py

import voice_base
voice_base.test_voice()

选择语音识别语言

# file: voice/voice_base.py 28行
def speak_config(self):
    language = "Chinese"

语音唤醒

唤醒词

# file: voice/voice_base.py 142行

ACTIVATION_WORDS = [
                            'HI MARSCAT', 'MARSCAT', 'MASSCAT', 'MASKCAT', 'MARS',
                            'ASSCAT', 'MASS', '咪咪', '小猫', '猫'
                        ]
# file: voice/voice_base.py 152行
if ff:
    唤醒成功,进入聆听模式

voice/corpus/***.dic的文件中包含了三种语言的所有可用于识别的词

marscatapi's People

Contributors

eheech avatar mothnox avatar anla-xu 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.