Coder Social home page Coder Social logo

nanmu42 / robomasterpy Goto Github PK

View Code? Open in Web Editor NEW
86.0 7.0 11.0 111 KB

DJI RoboMaster Python SDK and programing framework | 大疆机甲大师的Python SDK和编程框架

Home Page: https://robomasterpy.nanmu.me

License: MIT License

Python 98.50% Makefile 0.67% Batchfile 0.83%
robomaster dji-robomaster dji robomaster-ep python3 framework robomaster-sdk library client sdk

robomasterpy's Introduction

RoboMasterPy

English | 中文

Documentation Status

RoboMasterPy is a RoboMaster Python SDK and framework:

  • Python SDK: inspect and control your Robomaster, remotely;
  • framework: development framework providing and regularising control flow and data flow, resolving common needs like pulling and parsing on video stream, events and pushes, decoupling boilerplate codes like controlling loop, logging, graceful shutdown. You may rely on the framework, implement your business logic with ease of mind and less manual labor.

The SDK(client) is straightforward to use:

>>> import robomasterpy as rm

# IP of RoboMaster is detected under router mode
>>> cmd = rm.Commander()

# check RoboMaster's API version
>>> cmd.version()
'version 00.00.00.60'

>>> cmd.get_robot_mode()
'chassis_lead'

# ensure your Robomaster has enough room to move
>>> cmd.chassis_move(x=-1, z=30)
'ok'

# activate video streaming,
# which can be handled by the framework.
>>> cmd.stream(rm.SWITCH_ON)
'ok'

# activate gimbal attitude push at 5Hz,
# which can be handled by the framework.
>>> cmd.gimbal_push_on(attitude_freq=5)
'ok'

# Watch out!
>>> cmd.blaster_fire()
'ok'

The framework lets you create complicated application easier, e.g.:

RoboMasterPy Goalkeeper

Installation

RoboMasterPy requires Python 3.6 and above.

Install Dependencies First

If you are using Python 3.6.x, you need to install dataclasses, which is already included in Python 3.7 and better:

pip install dataclasses

Install OpenCV of your flavor, suggestion::

# if you are using conda
conda install -c conda-forge opencv

# if you are using pip only
pip install opencv-contrib-python

Install RoboMasterPy

pip install robomasterpy

User Guide

Documentation is generously hosted by Read the Docs.

Health and Safety Notice

  • Your Robomaster may hurt people or pet, break stuffs or itself;
  • Make sure your RoboMaster has enough room to move; make sure the ground is clear;
  • Start slowly, avoid using high speed for debugging;
  • Use cushion;
  • Stay safe and have fun!

Paperwork

RoboMasterPy is a fan work, and it has no concern with DJI.

DJI, RoboMaster are trademarks of SZ DJI Technology Co., Ltd.

Acknowledgement

RoboMasterPy was incubated during a RoboMaster EP developing contest. The author would like to thank DJI for hardware and technical support.

License

MIT License

Copyright (c) 2020 LI Zhennan

robomasterpy's People

Contributors

dependabot[bot] avatar nanmu42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

robomasterpy's Issues

是否支持最新版本的机甲大师固件?

大概在 2022 年三月初,我的 RoboMaster EP 使用手机控制时,收到了一个固件更新,于是我更新了。
稍后我发现我之前写的代码都失效了(写了一些块方便我的学生去控制 RoboMaster 的底盘、云台运动)。
我大概是 2021 年初写的代码,那些代码一直可以正常使用,也没有修改过,直到那次固件更新后的几日。
之后我更换了不同的计算机,WiFi 环境去测试,结果都一样(我没有更新固件的 RobotMaster EP,可以正常使用,那一台更新过的无法正常使用)。

系统依赖

请问大佬,robomasterpy在windows系统下可以运行吗

关于S1中opencv安装的询问

请问一开始的pip安装opencv要在哪里输入,终端吗?如果是,该如何打开终端呢?
image
请问下这个界面是怎么打开吗?
万分感谢

关于socket通信问题

通过commander自动获取IP地址会time out
使用固定IP地址进行连接会出现计算机积极拒绝,连接失败
附图
image
image
IP地址没有错,ping得通,telnet常用端口不通。

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.