The SmartFactory_Vehicle-Sortic is an implementation from the SmartFactory project for Sortic.
It's a Smart-Vehicle which can navigate on a known game-table and communicates this information wirelessly to its environment using the SmartFactory_MQTTCommunication and the SmartFactory_Vehicle-Basis-component.
Multiple nested Finite State Machines (FSM) based on the pattern of the ArdFSM are used to control the processes.
- The SmartFactory project - Sortic
- Tools and technologies
- Documentation
- FAQ's
- ToDo's
- Contributors
- Changelog
- License
The implementation of the SmartFactory project for Sortic looks as follows:
The associated repositories are:
SmartFactory-Sortic
SmartFactory_Box-Sortic
SmartFactory_Vehicle-Sortic
SmartFactory_Vehicle-Basis
SmartFactory_MQTTCommunication
The source code is written in C++. To achieve this project, the following tools and technologies were used.
Doxygen is used for the documentation of the source-code.
An intorduction to Doxygen and how to install it can be found in the ArdFSM-Repo.
The used IDE is VSCode with the PlatformIO-extension.
For a description of the MQTT-Technologie take a look at the MQTTCommunication-ReadMe.
For a description of the used hardware take a look at the Vehicle-Basis-ReadMe.
The Gametable consists of black lines on a white (light) background. It is composed of different sectors:
-
Handover (Sortic/Transfer)
-
Gateway (Sortic/Transfer)
-
Waiting area
-
Transit
-
(Parking)
These sectors are also separate states and can easily be customized in NavigationCtrl.
All functions and files are documented on the GitHub-Page with Doxygen.
The documentation does not include the MQTTCommunication and the SmartFactory_Vehicle-Basis-files.
If you would like the complete documentation with these files included you need to build it yourself with the Doxygen-complete file.
It's important to mention that all functions are non-blocking and as short as possible so no other process starves. This way a degree of parallelism can be achieved.
Click on the image to open doxygen-documentation.
Extern libraries:
Click on the image to open doxygen-documentation.
In Configuration.h are all important settings for the vehicle defined:
- Time between the MQTT Publishs (TIME_BETWEEN_PUBLISH)
- How long the SmartVehicle for Box-acknowledgement waits (TIMEOUT_VACKS)
- How many lines there are (SORTIC_MAX_LINE)
- The Hostname-number (DEFAUL_HOSTNAME_NUMBER)
- The Hostname "SV"+ Hostname-number (DEFAULT_HOSTNAME)
The SmartVehicle communicates via the SmartFactory_MQTTCommunication to an MQTT-Broker, who distributes the messages. The communication works by subscribing to various topics. The subscribed topics change depending on action and position of the Vehicle. The topic-tree looks like this:
The Vehicle is constantly subscribed to the topics: error, Vehicle/error, Vehicle/vehicle.id/error and also always publishes its status to Vehicle/vehicle.id/status.
More information about the communication process and the complete procedure is documented in SmartFactroy-Sortic-ReadMe.
For a handshake with a box the topic Vehicle/vehicle.id/handshake is used. The confirmation of the new position is sent from the vehicle to the Box/box.id/position.
Before the vehicle can bring the box to its new destination, it has to find out where its load is needed and whether that space is available. For this it subscribes to the topic Transfer/Handover and evaluates the received messages.
This repository is designed specifically for Sortic. You can still use it, if you stick to the following rules:
- Use the same handshake and communication sequence for your carrier as documented in SmartFactory-Sortic and Communication.
- Write a separate test-class
All open ToDo's can be found in the documentation on the GitHub-Page
V 1.0 - Release BA FS19 - Luca Mazzoleni
MIT License