Coder Social home page Coder Social logo

nanmu42 / robo-playground Goto Github PK

View Code? Open in Web Editor NEW
47.0 9.0 8.0 131 KB

Games and examples built for RoboMaster EP with RoboMasterPy | 与你的大疆机甲大师愉快玩耍,基于RoboMasterPy构建

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

License: MIT License

Python 100.00%
robomaster robomaster-ep dji robomaster-sdk python python3 examples-python robotics opencv opencv-python

robo-playground's Introduction

RoboMasterPy Playground

English | 中文

Documentation Status

Games and examples built for RoboMaster EP with RoboMasterPy.

RoboMasterPy Goalkeeper

Press Start

RoboMasterPy Playground requires Python 3.6 and above.

# optional, suggested
virtualenv venv

# Python 3.6.x
pip install -r requirements-py36.txt
# Python 3.7 and above
pip install -r requirements.txt

Drive your robomaster using keyboard

Live video stream is displayed on your screen.

$ python drive.py --help
Usage: drive.py [OPTIONS]

Options:
  --ip TEXT        (Optional) IP of Robomaster EP
  --timeout FLOAT  (Optional) Timeout for commands
  --help           Show this message and exit.

Key bindings:

  • W, A, S, D: forward, leftward, backward, rightward;
  • space bar: blaster fire
  • up, down: gimbal pitch up, gimbal pitch down
  • left, right: chassis roll left, chassis roll right
  • 1~5: gears

Make your robomaster a goalkeeper

There is a blog post explaining Goalkeeper's implementation: https://nanmu.me/en/posts/2020/build-a-goalkeeper-robomaster/

You need tweak GREEN_LOWER and GREEN_UPPER per your luminance to get good experience. The default values works okay under daylight shade.

$ python goalkeeper.py --help
Usage: goalkeeper.py [OPTIONS]

Options:
  --ip TEXT          (Optional) IP of Robomaster EP
  --timeout FLOAT    (Optional) Timeout for commands
  --max-width FLOAT  (Optional) Field width
  --max-depth FLOAT  (Optional) Field depth
  --xy-speed FLOAT   (Optional) Speed in x and y direction
  --z-speed FLOAT    (Optional) Speed in z direction(chassis roll)
  --help             Show this message and exit.

RoboMasterPy User Guide

https://robomasterpy.nanmu.me/

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 Playground is a fan work, and it has no concern with DJI.

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

Acknowledgement

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

License

RoboMasterPy Playground is released under MIT license.

robo-playground'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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robo-playground's Issues

drive.py can't move wheels

I tried using your script for controlling a rooted robomaster s1 using the keyboard. The gimbal, video stream and blaster all worked but the "w s a d" controls were not workin and the wheels are not moving. do you have any idea why? Can it be caused by the root?

Issues between robomasterpy and multiprocessing

hi,

unfortunately both examples don't work for me.
At least for me it seems like this is a issue with how robomasterpy works with pythons multiprocessing.
See the following error:

[h264 @ 000001a5ff495440] missing picture in access unit with size 6
2023-03-14 16:52:28,044 vision       : INFO     signal received, closing...
Process vision:
Traceback (most recent call last):
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\multiprocessing\managers.py", line 810, in _callmethod
    conn = self._tls.connection
AttributeError: 'ForkAwareLocal' object has no attribute 'connection'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\site-packages\robomasterpy\framework.py", line 297, in _build_worker_and_run
    worker()
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\site-packages\robomasterpy\framework.py", line 164, in __call__
    self.work()
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\site-packages\robomasterpy\framework.py", line 559, in work
    self._outlet(processed)
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\site-packages\robomasterpy\framework.py", line 193, in _outlet
    self._out.put(payload, block=True, timeout=self.QUEUE_TIMEOUT)
  File "<string>", line 2, in put
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\multiprocessing\managers.py", line 814, in _callmethod
    self._connect()
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\multiprocessing\managers.py", line 801, in _connect
    conn = self._Client(self._token.address, authkey=self._authkey)
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\multiprocessing\connection.py", line 505, in Client
    c = PipeClient(address)
  File "C:\Users\eddiw\.pyenv\pyenv-win\versions\3.10.6\lib\multiprocessing\connection.py", line 707, in PipeClient
    _winapi.WaitNamedPipe(address, 1000)
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden

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.