Group Project by lucaSartore (Luca Sartore), LorenzoCattai (Lorenzo Cattai), MrLakige (Michele Callegari), Technorico (Federico Peruzzo) for Embedded Software for The Internet of Things - 145996 taught by professor Kasim Sinan Yildirim at University of Trento, DISI Department.
This is a system that automates the motion of Lego trains and rail switches. You can tell the system in which station you want a train to go (either using an HTTP request or using our GUI), and the system will figure out the best way to achieve the goal, even moving trains that are on your way if necessary.
The system is implemented using 5 different components:
The Master
: This is the component that does all the calculations to find the optimal path, and then controls the trains and the switches, you can learn more about the master hereThe Client
: (Godot based client to create the train track and control/monitor the train system), you can learn more about the client hereThe Map
: The map is a support data structure (a modified graph in particular) used by the master, you can learn more about the master hereThe Common Infrastructure
: The common infrastructure defines some basic messages that all components need to communicate with each other, as well as the IPs and the hardware abstraction layer traits, you can learn more about the master hereThe Trains
: You can learn more about the code that manages the trains hereThe Switches
: You can learn more about the code that manages the switches here
- Common infrastructure documentation
- Map documentation
- Master documentation
- Railway sim map documentation
- Switch documentation
- Train documentation
Here you can find a quick list of the things you need to do, to try our project yourself.
The current implementation of the master runs on a Linux system (e.g. Raspberry Pi with Raspberry Pi OS) so to run it, you just need to install the regular rust toolchain. Given that we used a Hardware Abstraction Layer (HAL) to implement the master, with a bit more work, it can be executed on something smaller (like an ESP-32), if you are interested in this you can check out the train toolchain installation down below.
The train code is written in embedded rust, with the embedded-hal and embedded-svc crates. To install the software needed to build for our target (The ESP-32) you can follow the tutorial here.
To compile the switch code you can follow this tutorial we have written.
See Client README.md.
Files to print the switch mechanism are located here You can find a 3D printing tutorial here.
To build the switch PCB you can follow this tutorial we have written
1.mp4
2.mp4
3.mp4
4.mp4
5.mp4
FabLab UniTn for the space, tools and part of the materials used