mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-21 12:01:47 +02:00
90 lines
3.8 KiB
Markdown
90 lines
3.8 KiB
Markdown
# Dezibot4 Lib
|
|
## Introduction
|
|
This repository contains the Library for the Dezibot4.<br>
|
|
It is ment to serve as an Arduino-Library. Therefore the rules for arduinolibrary develop apply:<br>
|
|
* [Styleguide](https://docs.arduino.cc/learn/contributions/arduino-library-style-guide)
|
|
* [Libraryspecification](https://arduino.github.io/arduino-cli/0.35/library-specification/)
|
|
* [Submission-requirements](https://github.com/arduino/library-registry/blob/main/FAQ.md#submission-requirements)
|
|
|
|
In the following the most important points and custom conventions are introduced.
|
|
|
|
## Code Conventions
|
|
### Don't pass reference
|
|
To allow easy usability for users not familier with C++, prevent passing around references. It is better to use accessmethods
|
|
### Naming
|
|
* methods are named in lowerCamelCase
|
|
* classes are named in UpperCamelCase
|
|
* folders containing components are named in lowerCamelCase
|
|
* methods are named in lowerCamelCase
|
|
* constants are named in ALL_CAPS_SNAKE_CASE
|
|
### Bytestream
|
|
Every class that implements Byte-Based Communication needs to implement the Arduino Streaminterface
|
|
### Components
|
|
Every component has a single .h file and one or more .cpp files.<br>
|
|
Every component is placed in a seperate folder under src/ that is named equvivalent to the class.
|
|
The minimal structure of any .h file is<br>
|
|
```c++
|
|
#ifndef ClassName_h
|
|
#define ClassName_h
|
|
class ClassName{
|
|
|
|
};
|
|
#endif //ClassName_h
|
|
```
|
|
|
|
## Design Paradigm
|
|
During desgin, the Dezibot isn't describe using it's part but instead it's functionality. Under the top-level Dezibotclass, there is a class for every functionality of the robot. Each of that classes consists of two parts.
|
|
### Part Instances
|
|
Each component contains instances of every Robotpart that is used in that component. For example the Motion component contains two motorinstances, one for motorEast and one for motorWest.
|
|
Using these instances, it is possible to access more specific methods that interacts directly with the component (configure it, setSpeed,...)
|
|
### Abstractions
|
|
The components constains abstractions that combines multiple partMethods to ease the usability. For example for the motioncomponent provides an abstraction for the forwardmovement, that involves two motors and even another component (MotionDetection)
|
|
|
|
## Contributing
|
|
When contributing to the project please follow the rules below. At first, follow all rules from this readme. Further rules apply to the usage of git
|
|
### Branching
|
|
Whenever working on the project, create a new branch from the current state of Develop.
|
|
Branches should be named as `prefix/#issueid-shortdescription` where prefix is from {feature,fix,refactor}.<br>
|
|
When a branch is ready to be used in production, create a mergerequest.
|
|
### Mergerequests
|
|
The target of each Mergerequest must be the Develop-Branch. Before the merge, each request must be approved by at least one person with Owner role.<br>
|
|
The approve process should consider especially the documentation, naming, implementation.
|
|
When the merge is approved and no more commits are added, the last commit must increment the versionnumber in the library.properties file, following the rules of [Semantic Versioning](https://semver.org/)
|
|
|
|
### Commitmessages
|
|
Commitmessages must follow the [gitchangelog](https://github.com/vaab/gitchangelog/blob/master/src/gitchangelog/gitchangelog.rc.reference) pattern.
|
|
### Language
|
|
The language of the project is American English. That includes in particular but not exclusively:
|
|
* Sourcecode
|
|
* Commit Messages
|
|
* Documentation
|
|
|
|
A german documentation will be provided but does not replace the english documentation.
|
|
|
|
### Documentation
|
|
#### .h Files
|
|
```C++
|
|
/**
|
|
* @file Dezibot.h
|
|
* @author your name (you@domain.com)
|
|
* @brief
|
|
* @date 2023-11-19
|
|
*
|
|
* @copyright Copyright (c) 2023
|
|
*
|
|
*/
|
|
|
|
```
|
|
#### Methods
|
|
```C++
|
|
/**
|
|
* @brief
|
|
* @param
|
|
* ...
|
|
* @return
|
|
*
|
|
*/
|
|
```
|
|
|
|
|