Skip to content

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 communicate.

License

Notifications You must be signed in to change notification settings

LMazzole/SmartFactory_Vehicle-Sortic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartFactory_Vehicle-Sortic

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.

Table of contents

The SmartFactory project - Sortic

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

Tools and technologies

The source code is written in C++. To achieve this project, the following tools and technologies were used.

Doxygen

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.

VSCode PlatformIO

The used IDE is VSCode with the PlatformIO-extension.

MQTT

For a description of the MQTT-Technologie take a look at the MQTTCommunication-ReadMe.

Documentation

Hardware

For a description of the used hardware take a look at the Vehicle-Basis-ReadMe.

Gametable

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.

Software

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.

Dependency graph

Click on the image to open doxygen-documentation.

Extern libraries:

Collaboration diagram

Click on the image to open doxygen-documentation.

Important functions and files

Configuration.h

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)

Communication

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.

Handshake with box

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.

Transfer and vehicle

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.

FAQ's

I'd like to use this code in my project. What do I need to know?

This repository is designed specifically for Sortic. You can still use it, if you stick to the following rules:

ToDo's

Software

  • Write a separate test-class

All open ToDo's can be found in the documentation on the GitHub-Page

Contributors

Changelog

V 1.0 - Release BA FS19 - Luca Mazzoleni

License

MIT License

About

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 communicate.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages