Skip to content
View BrickSortingMachine's full-sized avatar

Block or report BrickSortingMachine

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Brick Sorting Machine

A modular SW stack for fully automated LEGO® sorting machines.

This project is heavily inspired by numerous preceding LEGO® sorting machines, I'd like to give credit in this post. For background information visit the new blog, old blog or YouTube channel.

GitHub Workflow Status GitHub release GitHub Imports: isort Code style: black

Security Notice

This software uses network communication between its components. It's critical to understand that this communication is not secure by default. There is no authentication on messages received, meaning the system blindly trusts any client connected to the message broker. A malicious broker or client on the same broker can send commands that could potentially damage the machine, exploit your system, or harm your network. The security of the entire system depends on the security of the broker and network configuration. To operate this software safely, you must adhere to the following rules:

  • Use a Private Network: The communication is not secured by encryption, you must run this software exclusively on a private, isolated network that you fully control.
  • Trusted Clients: Ensure that all third-party clients or other software modules connected to the same broker are fully trusted by you.

If you're unsure what any of this means, we strongly advise against using this software.

Getting Started

If you want to build a LEGO® brick sorting machine yourself, I suggest to start with the DIY build instructions / plans. This repository maintains the software stack to operate LEGO® brick sorting machines.

Installation

With prerequisites Python 3.11 and Conda installed, setup conda environment:

./update_environment.sh     # Linux
update_environment_win.bat  # Windows

Adapt local config (currently no adaptions needed):

cp config.json.example config.json

Usage

Machine controller (on raspberry pi, connected to motor drivers):

python sorter.py controller [--disable_machine]

Vision service (on alternative PC):

python sorter.py vision --host=RASPBERRY_PI_IP_ADDRESS --collect_class=None

Classification service (on alternative PC):

python sorter.py classification --host=RASPBERRY_PI_IP_ADDRESS --model=models/CLASSIFIER_MODEL.h5

Notification service (on alternative PC):

python sorter.py notification --host=RASPBERRY_PI_IP_ADDRESS

Development

Install git pre-commit hooks for flake8, black and isort usage:

pre-commit install

Run unit tests:

python -m unittest discover -s test -p "test_*.py"

Run static type checking via mypy (type hints are still pretty sparse in the code so mypy support is currently limited):

python -m mypy sorter.py

Popular repositories Loading

  1. BrickSortingMachine BrickSortingMachine Public

    BrickSortingMachine - A LEGO® sorting machine software stack

    Python 18 5

  2. awesome-lego-machine-learning awesome-lego-machine-learning Public

    Forked from 360er0/awesome-lego-machine-learning

    A curated list of resources dedicated to Machine Learning applications to LEGO bricks

    3

  3. BrickSortingMachine_home BrickSortingMachine_home Public

    1 1