<commit_before>[![PyPI version](https://badge.fury.io/py/picraftzero.svg)](https://badge.fury.io/py/picraftzero) 
[![Build Status](https://travis-ci.org/WayneKeenan/picraftzero.svg?branch=master)](https://travis-ci.org/WayneKeenan/picraftzero) 
[![codecov](https://codecov.io/gh/WayneKeenan/picraftzero/branch/master/graph/badge.svg)](https://codecov.io/gh/WayneKeenan/picraftzero)

# PiCraftZero


PiCraftZero is:

 + a universal remote control supporting virtual (web) and physical (handheld) controllers.
 + a collection of gpiozero compatible Python components for:
   + receiving joystick updates
   + auto discovering and controlling i2c based motor & servo add-ons for the Raspberry Pi
   + 'steering mixers' for converting joystick axis values to motor speeds 
   + websocket messaging
 + a camera streaming server and web client for single or dual cameras where:
   + remote stereo viewing can use a mobile phone with Google Cardboard 
   + the mobile phones gyro can control a pan/tilt camera mount 
 
 + cross platform, tested to work on Pi, Linux, Mac & Windows.
 + able to run without any additional hardware (e.g. Pi HATs or joypads), handy for dev & testing.
 + able to use desktop connected gamepads and mobile paired gamepads if your PC or mobile webbrowser supports the HTML5 Gamepad API
  
  
 

 
 


# Example

This is example is for robot that has 2 motors. It can be control using game controllers and web browsers on most desktop and mobile platforms. 
If a camera is attached then video can be streamed to the client.  

 
```python
#!/usr/bin/python3

from picraftzero import Joystick, Wheelbase, steering_mixer, start

joystick= Joystick()                         
motors = Wheelbase(left=0, right=1)  

motors.source = steering_mixer(joystick.values)

start()
```

A commented version of the code can be found [here](examples/tiny4wd.py) along with other [examples](examples).
 
 
You can see it in action off-road [here](https://twitter.com/cannonfodder/status/875368943661318146). 
You can see a selection of physical, virtual controllers and remote camera viewer (inc. GoogleCardboard VR viewer) on various desktop and mobile form factors [here](https://twitter.com/wkeenan/status/858679184784338944) and [here](https://twitter.com/wkeenan/status/858695772497465344).

Below is a 'screenshot' of PiCraftZero running in the Chromium browser on a RaspberryPi fitted with a [Pimoroni HyperPixel](https://shop.pimoroni.com/collections/raspberry-pi/products/hyperpixel) touchscreen. The remote control is communicating via WiFi to the [Coretec Robotics Tiny4WD](http://www.core-tec.co.uk/tiny-4wd/) robot. 

![PiCraftZero on a HyperPixel controling are Coretec Tiny4WD][demopic]

[demopic]: docs/source/images/picraftzero_hyperpixel_tiny4wd.jpg


   
# Status

PiCraft is in beta and all feedback is welcomed. For any feature requests, questions and bug reports please raise a [GitHub issue](https://github.com/WayneKeenan/picraftzero/issues) 

This README is currently the only documentation fit for end-user consumption, please ignore the 'docs' folder as that is mostly a collection of badly formatted notes, and is very much a work in progress.  

Pleae note that whilst PiCraftZero is in beta the API's may change, breaking backwards compatibility.<commit_msg>updated video links<commit_after>[![PyPI version](https://badge.fury.io/py/picraftzero.svg)](https://badge.fury.io/py/picraftzero) 
[![Build Status](https://travis-ci.org/WayneKeenan/picraftzero.svg?branch=master)](https://travis-ci.org/WayneKeenan/picraftzero) 
[![codecov](https://codecov.io/gh/WayneKeenan/picraftzero/branch/master/graph/badge.svg)](https://codecov.io/gh/WayneKeenan/picraftzero)

# PiCraftZero


PiCraftZero is:

 + a universal remote control supporting virtual (web) and physical (handheld) controllers.
 + a collection of gpiozero compatible Python components for:
   + receiving joystick updates
   + auto discovering and controlling i2c based motor & servo add-ons for the Raspberry Pi
   + 'steering mixers' for converting joystick axis values to motor speeds 
   + websocket messaging
 + a camera streaming server and web client for single or dual cameras where:
   + remote stereo viewing can use a mobile phone with Google Cardboard 
   + the mobile phones gyro can control a pan/tilt camera mount 
 
 + cross platform, tested to work on Pi, Linux, Mac & Windows.
 + able to run without any additional hardware (e.g. Pi HATs or joypads), handy for dev & testing.
 + able to use desktop connected gamepads and mobile paired gamepads if your PC or mobile webbrowser supports the HTML5 Gamepad API
  
  
 

 
 


# Example

This is example is for robot that has 2 motors. It can be control using game controllers and web browsers on most desktop and mobile platforms. 
If a camera is attached then video can be streamed to the client.  

 
```python
#!/usr/bin/python3

from picraftzero import Joystick, Wheelbase, steering_mixer, start

joystick= Joystick()                         
motors = Wheelbase(left=0, right=1)  

motors.source = steering_mixer(joystick.values)

start()
```

A commented version of the code can be found [here](examples/tiny4wd.py) along with other [examples](examples).
 
 
You can see it in action off-road [here](https://twitter.com/cannonfodder/status/875368943661318146). 
You can see a selection of physical, virtual controllers and remote camera viewer (inc. GoogleCardboard VR viewer) on various desktop and mobile form factors [here](https://youtu.be/pUz_y9WAkc8) and [here](https://youtu.be/DPYABspXSOo).

Below is a 'screenshot' of PiCraftZero running in the Chromium browser on a RaspberryPi fitted with a [Pimoroni HyperPixel](https://shop.pimoroni.com/collections/raspberry-pi/products/hyperpixel) touchscreen. The remote control is communicating via WiFi to the [Coretec Robotics Tiny4WD](http://www.core-tec.co.uk/tiny-4wd/) robot. 

![PiCraftZero on a HyperPixel controling are Coretec Tiny4WD][demopic]

[demopic]: docs/source/images/picraftzero_hyperpixel_tiny4wd.jpg


   
# Status

PiCraft is in beta and all feedback is welcomed. For any feature requests, questions and bug reports please raise a [GitHub issue](https://github.com/WayneKeenan/picraftzero/issues) 

This README is currently the only documentation fit for end-user consumption, please ignore the 'docs' folder as that is mostly a collection of badly formatted notes, and is very much a work in progress.  

Pleae note that whilst PiCraftZero is in beta the API's may change, breaking backwards compatibility.
{'fraction_non_alphanumeric': 0.08228816151728358, 'fraction_numerical': 0.014683389415723462, 'mean_word_length': 4.417564208782104, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 22, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3558306', 'n_tokens_mistral': 2072, 'n_tokens_neox': 1878, 'n_words': 715}