大疆机甲大师 python_RoboMasterPy

RoboMasterPy

English | 中文

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.:

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 installdataclasses

Install OpenCV of your flavor, suggestion::

# if you are using conda

conda install -c conda-forge opencv

# if you are using pip only

pip installopencv-contrib-python

Install RoboMasterPy

pip installrobomasterpy

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值