Browse Source

Merge branch 'master' of gitlab.cs.hs-fulda.de:fdai5253/roboter

master
Yves Ehrlich 4 years ago
parent
commit
1302ac98ed
  1. 48
      Code/libraries/Joystick/Steuerung.cpp
  2. BIN
      Latex/main.pdf
  3. 36
      Latex/main.tex
  4. 11
      Latex/references.bib

48
Code/libraries/Joystick/Steuerung.cpp

@ -12,51 +12,55 @@ void Steuerung::mapReadingsToMatchPWMValues() {
}
void Steuerung::applyPWMValuesDependingOnReadings() {
if ((abs(this -> xValue) > (joystick -> spaceing)) || (abs(this -> yValue) > (joystick -> spaceing))) {
//TODO faktor für die Bedinungen um die abweichung von left zu right auszugleichen
//float leftFaktor = (left -> highestValue) / 255
//
//vorher aber testen ob nur die this -> vor left und right vergessen wurde.
if ((abs(this -> xValue) > (this -> joystick -> spaceing)) || (abs(this -> yValue) > (this -> joystick -> spaceing))) {
if (this -> yValue >= 0) {
if (this -> xValue >= 0) {
//+y , +x
(left -> PWMValue) = this -> yValue;
(right -> PWMValue) = (this -> yValue) - (this -> xValue);
(this -> left -> PWMValue) = this -> yValue;
(this -> right -> PWMValue) = (this -> yValue) - (this -> xValue);
if ((this -> xValue) >= (this -> yValue)) {
(left -> PWMValue) = left -> highestValue;
(right -> PWMValue) = right -> lowestValue;
(this -> left -> PWMValue) = this -> left -> highestValue;
(this -> right -> PWMValue) = this -> right -> lowestValue;
}
} else {
//+y , -x
(left -> PWMValue) = this -> yValue;
(right -> PWMValue) = (this -> yValue) + (this -> xValue);
(this -> left -> PWMValue) = this -> yValue;
(this -> right -> PWMValue) = (this -> yValue) + (this -> xValue);
if (abs(this -> xValue) >= (this -> yValue)) {
(left -> PWMValue) = left -> lowestValue;
(right -> PWMValue) = right -> highestValue;
(this -> left -> PWMValue) = this -> left -> lowestValue;
(this -> right -> PWMValue) = this -> right -> highestValue;
}
}
} else {
if (this -> xValue >= 0) {
//-y , +x
(left -> PWMValue) = this -> yValue;
(right -> PWMValue) = (this -> yValue) + (this -> xValue);
(this -> left -> PWMValue) = this -> yValue;
(this -> right -> PWMValue) = (this -> yValue) + (this -> xValue);
if (this -> xValue >= abs(this -> yValue)) {
(left -> PWMValue) = left -> highestValue;
(right -> PWMValue) = right -> lowestValue;
(this -> left -> PWMValue) = this -> left -> highestValue;
(this -> right -> PWMValue) = this -> right -> lowestValue;
}
} else {
//-y , -x
(left -> PWMValue) = this -> yValue;
(right -> PWMValue) = (this -> yValue) - (this -> xValue);
(this -> left -> PWMValue) = this -> yValue;
(this -> right -> PWMValue) = (this -> yValue) - (this -> xValue);
if (abs(this -> xValue) >= abs(this -> yValue)) {
(left -> PWMValue) = left -> lowestValue;
(right -> PWMValue) = right -> highestValue;
(this -> left -> PWMValue) = this -> left -> lowestValue;
(this -> right -> PWMValue) = this -> right -> highestValue;
}
}
}
if (abs(this -> xValue) < (joystick -> spaceing)) {
(left -> PWMValue) = this -> yValue;
(right -> PWMValue) = this -> yValue;
if (abs(this -> xValue) < (this -> joystick -> spaceing)) {
(this -> left -> PWMValue) = this -> yValue;
(this -> right -> PWMValue) = this -> yValue;
}
} else {
(left -> PWMValue) = 0;
(right -> PWMValue) = 0;
(this -> left -> PWMValue) = 0;
(this -> right -> PWMValue) = 0;
}
}

BIN
Latex/main.pdf

36
Latex/main.tex

@ -45,9 +45,39 @@
% INTRODUCTION
%----------------------------------------------------------------------------------------
\section*{Vorwort} % Unnumbered section
\section{Vorwort} % Unnumbered section
\paragraph{Motivation}
Eine Platform bieten ist etwas was momentan sehr stark im Trend liegt, sei es im Software oder im Hardware bereich. Im Softwarebereich zeigt sich dies meist durch opensource libaries, welche möglichst varriable einsetzbaren Code für jeden frei zugänglich machen. \\
Ein solches Projekt war auch von einem der Projektmitglieder (Yves Ehrlich) als Privates Projekt geplant und so kahm die Überlegung dies innerhalb des Modules Embedded Networking zu wählen.\linebreak
\paragraph{Basis des Projektes}
Als Basis des Projektes dient einer schon bereits von Yves Ehrlich angefertigter Arduino Nano Shield samt Code,
\cite{nanoGame} welcher als Fernsteuerung verwendet wird.
\paragraph{Ziel des Projektes}
Ziel des Projektes ist eine ferngesteuerte, OpenSource basierende Roboterplatform.
\newpage
\section{Funksteuereung} %Lukas
Wie schon zuvor erwähnt wird für die Basis der Funksteuerung das Arduino Shield verwendet, welches mit einem RF24 Chip erweitert wurde.
\subsection{RF24} %Oder nur als paragraph je nachdem wie viel zusammen kommt.
\newpage
\section{SPI}
\newpage
\section{Arduino Libaries} %Lukas
\newpage
\section{Joystick Integration} %Lukas
\newpage
\section{Motorsteuerung} %Yves
%Folgende beiden ließen sich auch durch subsections mittels sensoric als section realisieren, kommt aber auf die menge des textes an subsections sollten nicht über eine halbe seite lang sein.
\newpage
\section{Thermosensor} %Nick
\newpage
\section{Ultraschallsensor} %Nick
Motivation, Basis, Ziel des Projektes.
\newpage
%----------------------------------------------------------------------------------------
@ -132,7 +162,7 @@ sys.stdout.write("Hello World!\n")
\bibliographystyle{unsrt}
\bibliography{sample.bib}
\bibliography{references.bib}
%----------------------------------------------------------------------------------------

11
Latex/references.bib

@ -1,3 +1,4 @@
% Encoding: UTF-8
@BOOK{Smith:2012qr,
title = {{B}ook {T}itle},
publisher = {Publisher},
@ -16,4 +17,12 @@
number = {52},
month = {March},
publisher = {Publisher}
}
}
@Unpublished{nanoGame,
author = {Yves Ehrlich},
note = {Repository Nano Game},
title = {https://gitlab.informatik.hs-fulda.de/fdai5253/nanogame},
}
@Comment{jabref-meta: databaseType:bibtex;}
Loading…
Cancel
Save