Skip to main content

RoboMaster Python SDK and framework.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robomasterpy-0.1.1.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

robomasterpy-0.1.1-py2.py3-none-any.whl (21.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file robomasterpy-0.1.1.tar.gz.

File metadata

  • Download URL: robomasterpy-0.1.1.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for robomasterpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 15789253a408e7868bc92fbb7e035e5792b69f1c6c767cba9d8ef365f34960db
MD5 010d06793f54c57edfc9b8fe2f0c5ac3
BLAKE2b-256 ccd33b838fe0ba662956667be441da772141341b84e3f6c47a089474d6566c06

See more details on using hashes here.

File details

Details for the file robomasterpy-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: robomasterpy-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for robomasterpy-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fe0c0177ecf7217e5dfe9688cc9ab3007a1751deac78ec41b8045149e0979b1f
MD5 e03fcc44133f1ef0844c38794473f776
BLAKE2b-256 ebff614baaefdf9d0f4d07ff9367b7d161f817604801237b865719ac0445f8b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page