Skip to main content

Building blocks for raspberry pi robot software

Project description

[![Coverage Status](](
[![Build Status](](

*This project is still under construction*

# introduction

about the project
This project is intended to provide a simple framework for quickly building source code for robotics projects:
- allows rapid development with minimal writing of code (refer to below basic example)
- multithreaded processsing based on hooks/callbacks - removes need for writing multiple loops yourself and facilitates management of robot components
- comprehensive library of classes for handing interactions with common robot components (motors, servos, ultrasounds, etc.)
- provides built-in support for multiple control methods (e.g. autonomous obstacle avoidance, remote control, etc.)

# getting started

install with pip
pip install robot-blocks

basic example

this library is meant to allow you to create software for your robot with as few lines of code as possible. Here is a minimal example for creating an obstacle avoidance robot with 2 motors and an ultrasound sensor

# imports
from robotblocks import Robot

# configure robot
my_robot = Robot()

my_robot.add_motor(position='LEFT', forward_pin=9, backward_pin=10)
my_robot.add_motor(position='RIGHT', forward_pin=8, backward_pin=7)

my_robot.add_sensor('UltrasoundSensor', position='FRONT', input_pin=17, output_pin=18)

# start movement


callbacks and hooks

this library provides a full set of hooks that you can use to trigger certain events when your robot is doing certain things. For example:

def turn_lights_on():
Turns on the robot's lights

def turn_lights_off():
turns off the robot's lights

my_robot.add_callback('ON_MOVE_FORWARDS_START', turn_lights_on)
my_robot.add_callback('ON_BRAKE', turn_lights_off)


# misc

The project is licensed under the Apache license.

for help on this project, please raise an [issue](

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

robot-blocks-0.1.0a8.tar.gz (8.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page