JetRacer: Spurführung mit künstlicher Intelligenz: Unterschied zwischen den Versionen

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
 
(12 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 8: Zeile 8:
'''Betreuer:''' [[Benutzer:Ulrich_Schneider| Prof. Schneider]]<br/>
'''Betreuer:''' [[Benutzer:Ulrich_Schneider| Prof. Schneider]]<br/>
== Einführung ==
== Einführung ==
 
== [[Installation der virtuellen Maschine VirtualBox|Installation der virtuellen Maschine VirtualBox]] ==
== Aufgabenstellung ==
== Aufgabenstellung ==
# Einarbeitung in das bestehende Framwework
# Einarbeitung in das bestehende Framwework
Zeile 14: Zeile 14:
# Optimierung des Reglers (z.&thinsp;B. PD-Regler)
# Optimierung des Reglers (z.&thinsp;B. PD-Regler)
# Nutzung von MATLAB zum Anlernen des Jetson Nano.
# Nutzung von MATLAB zum Anlernen des Jetson Nano.
# Drive the JetRacer in the right lane counterclockwise with the gamepad controller. Limit the speed via Software to a maximum (e.&thinsp;g. 1&thinsp;m/s).
# Take a video while driving a lap with MATLAB<sup>®</sup> using a MATLAB<sup>®</sup>-script.
# Load the pretrained NN.
# Train the pretrained NN with MATLAB<sup>®</sup> with a MATLAB<sup>®</sup>-App (GUI) by clicking the desired path in the images.
# Option: Use classic lane tracking algorithms to teach the NN automatically.
# Write a PD-contoller that uses the NN to drive in the right lane. Program this in MATLAB<sup>®</sup> and let it run on the JetRacer-GPU using GPU Coder.
# Goal: the car should drive autonomously several laps in the right lane as fast as possible.
<!--
# Nutzung von ROS2 zum Anlernen des Jetson Nano.
# Nutzung von ROS2 zum Anlernen des Jetson Nano.
# Bewertung der Vor- und Nachteile der Programmierumgebungen.  
# Bewertung der Vor- und Nachteile der Programmierumgebungen.  
# Auswahl einer KI-Entwicklungsumgebung
# Auswahl einer KI-Entwicklungsumgebung
-->
# Dokumentation nach wissenschaftlichem Stand im HSHL-Wiki
# Dokumentation nach wissenschaftlichem Stand im HSHL-Wiki


Zeile 34: Zeile 43:
*[[Studentische_Arbeiten_bei_Prof._Schneider|Studentische Arbeiten bei Prof. Schneider]]
*[[Studentische_Arbeiten_bei_Prof._Schneider|Studentische Arbeiten bei Prof. Schneider]]
*[[Anforderungen_an_eine_wissenschaftlich_Arbeit| Anforderungen an eine wissenschaftlich Arbeit]]
*[[Anforderungen_an_eine_wissenschaftlich_Arbeit| Anforderungen an eine wissenschaftlich Arbeit]]
==Projektplan==
[[Datei:MK-Projektplan_neu.png|900px|thumb|left|Abb.2: Projektplan<nowiki></nowiki>]]
<br clear = all>


== SVN-Repositorium ==
== SVN-Repositorium ==
Zeile 46: Zeile 59:
*[[Software_Planung| PAP Designer Einstieg]]
*[[Software_Planung| PAP Designer Einstieg]]
*[[Software_Versionsverwaltung_mit_SVN| Einführung in SVN]]
*[[Software_Versionsverwaltung_mit_SVN| Einführung in SVN]]
== [[Understand the existing system framework]] ==
== [[Optimize AI for speed and robustness in the lab]] ==
== [[Improve the controller (e.g., PD controller)]] ==
== [[Use MATLAB to train on Jetson Nano]] ==
== [[Drive JetRacer counterclockwise using a gamepad, limiting speed (e.g., 1 m/s)]] ==
== [[Record a lap using a MATLAB script]] ==
== [[Load and retrain a pretrained NN with a MATLAB GUI]] ==
== [[Optionally, automate NN training with classic lane tracking]] ==
== [[Develop a PD controller using the NN, coded in MATLAB for JetRacer GPU]] ==
== Summary==
* Firstly connecting to the Jetracer and MATLAB according to the [https://de.mathworks.com/help/coder/nvidia/ref/jetson.html#mw_82bd63bc-9f39-4bf7-8b06-794227589348] MATLAB documentation, which help up to setup the full process.
* For modeling the project it can be make as simple as possible to understand the steps to follow, in this paper [https://www.researchgate.net/publication/289116142_Implementation_and_evaluation_of_image_processing_techniques_on_a_vision_navigation_line_follower_robot],it shows some of the ideas and implementation can be done.
* A outline of the line following algorithm diagram can be:
    [[Datei:Model diagram.png|frame]]
* Firstly the camera configuration, Detecting the Jetracer camera then creating a video input object to set all the parameter like frame rate, resolution and others. Then the image acquisition can start its video labeling. [https://de.mathworks.com/help/supportpkg/usbwebcams/ug/webcam.html]
* For image acquisition after setting up camera, it start capturing image on fixed parameter which has been set. Image Processing for the line following starts as a capture the lane data from track, then convert it to grayscale image. Also applying edge detection(Canny), thresholding to locate the line and process the data. Then it continues the loop for the full process.
 
[[Datei:Image-processing.png|frame]]
* After getting all the data its time for analyze and make it setup for the Jetracer. While from the frame capture extracting the following line feature is main goal. Line positioning, direction of car, prediction of the path to follow next is also part of the process. All the analysis process the speed and steering control gets calculated to create a PID controller.
* Controlling the Jetracer with PID controller has various complex steps to follow such as maintaining the speed, line, steering angle. Setting up the PID values to minimum at first then after identifying the error rate of the predicted line. Then tuning the parameters of the PID help to get the control results.
* The structure of the model is divided in various part: 
main.m: Contains the main loop and integrates other modules.
camera.m: Contains code for camera initialization.
processimage.m: Handles image processing & find line to follow.
PID_controller.m: Manages the PID control logic.
adjustSteering.m: Contains the code to adjust the Jetracer's steering.


== Mögliche Folgethemen ==
== Mögliche Folgethemen ==
Zeile 56: Zeile 122:
* [https://de.mathworks.com/videos/matlab-and-simulink-robotics-arena-deep-learning-with-nvidia-jetson-and-ros--1542015526909.html Deep Learning with MATLAB, NVIDIA Jetson, and ROS]
* [https://de.mathworks.com/videos/matlab-and-simulink-robotics-arena-deep-learning-with-nvidia-jetson-and-ros--1542015526909.html Deep Learning with MATLAB, NVIDIA Jetson, and ROS]
* [https://github.com/NVIDIA-AI-IOT/jetracer NVidia: JetRacer]
* [https://github.com/NVIDIA-AI-IOT/jetracer NVidia: JetRacer]
* [https://www.formulaedge.org/what-is-jetracer]
* [https://www.formulaedge.org/what-is-jetracer formulaedge.org]
* [https://www.waveshare.com/wiki/JetRacer_AI_Kit Waveshare Wiki]
* [https://www.waveshare.com/wiki/JetRacer_AI_Kit Waveshare Wiki]
* [https://de.mathworks.com/matlabcentral/answers/2072946-matlab-to-control-jetracer-jetson-nano-tx1-motor/?s_tid=ans_lp_feed_leaf FAQ: Matlab to control jetracer(jetson nano tx1) motor]
* [https://de.mathworks.com/matlabcentral/answers/2072946-matlab-to-control-jetracer-jetson-nano-tx1-motor/?s_tid=ans_lp_feed_leaf FAQ: Matlab to control jetracer(jetson nano tx1) motor]
* [https://arxiv.org/html/2404.06229v1 Towards Autonomous Driving with Small-Scale Cars: A Survey of Recent Development]
* [https://www.mathworks.com/help/ros/ug/lane-detection-in-ros2-using-deep-learning-with-matlab.html Lane Detection in ROS 2 Using Deep Learning with MATLAB]
* [https://www.mathworks.com/help/reinforcement-learning/ug/train-dqn-agent-for-lane-keeping-assist.html Train DQN Agent for Lane Keeping Assist]
* [https://developer.nvidia.com/blog/deep-learning-automated-driving-matlab/ Build Neural Networks for Self-Driving Cars with MATLAB]
* [https://developer.nvidia.com/blog/dli-training-deep-learning-for-autonomous-vehicles/ DLI Training: Deep Learning for Autonomous Vehicles]
* [https://www.mathworks.com/videos/machine-learning-with-simulink-and-nvidia-jetson-1653572407665.html Machine Learning with Simulink and NVIDIA Jetson]
* [https://www.researchgate.net/publication/365940001_Comparative_Transfer_Learning_Models_for_End-to-End_Self-Driving_Car Comparative Transfer Learning Models for End-to-End Self-Driving Car]
* [https://www.researchgate.net/publication/349219294_Multi-task_deep_learning_with_optical_flow_features_for_self-driving_cars Multi-task deep learning with optical flow features for self-driving cars]
* [https://www.mathworks.com/help/reinforcement-learning/ug/train-dqn-agent-for-lane-keeping-assist.html Train DQN Agent for Lane Keeping Assist]
* [https://www.researchgate.net/publication/372281750 Real-Time End-to-End Self-Driving Car Navigation]
* [https://github.com/dusty-nv/jetson-inference Hello AI World]
* [https://developer.nvidia.com/embedded/learn/jetson-ai-certification-programs Jetson AI Courses and Certifications]
* [https://forums.developer.nvidia.com/ NVIDIA Developer Forums]
* [[ChatGPT Anleitung für einen Lane Following Algorithmus]]


== Literatur ==
S<span style="font-variant:small-caps">chreiber</span>, C.: ''KI-gestützte „Follow-Me“-Funktion am Beispiel des JetRacer''. Mittweida, Hochschule Mittweida – University of Applied Sciences, Fakultät Ingenieurwissenschaften,
Masterarbeit, 2023. URL: [https://monami.hs-mittweida.de/frontdoor/deliver/index/docId/14754/file/MA_55114_Christian-Schreiber_geschwaerzt.pdf]


----
----
→ zurück zum Hauptartikel: [[Studentische_Arbeiten|Studentische Arbeiten]]
→ zurück zum Hauptartikel: [[Studentische_Arbeiten|Studentische Arbeiten]]

Aktuelle Version vom 18. Oktober 2024, 14:44 Uhr

Abb. 1: JetRacer AI Pro von Waveshare

Autor: Evrard Leuteu
Art: Projektarbeit
Starttermin: TBD
Abgabetermin: TBD
Betreuer: Prof. Schneider

Einführung

Installation der virtuellen Maschine VirtualBox

Aufgabenstellung

  1. Einarbeitung in das bestehende Framwework
  2. Optimierung der KI für den Rundkurs im Labor Autonome Systeme (Geschwindigkeit, Robustheit).
  3. Optimierung des Reglers (z. B. PD-Regler)
  4. Nutzung von MATLAB zum Anlernen des Jetson Nano.
  5. Drive the JetRacer in the right lane counterclockwise with the gamepad controller. Limit the speed via Software to a maximum (e. g. 1 m/s).
  6. Take a video while driving a lap with MATLAB® using a MATLAB®-script.
  7. Load the pretrained NN.
  8. Train the pretrained NN with MATLAB® with a MATLAB®-App (GUI) by clicking the desired path in the images.
  9. Option: Use classic lane tracking algorithms to teach the NN automatically.
  10. Write a PD-contoller that uses the NN to drive in the right lane. Program this in MATLAB® and let it run on the JetRacer-GPU using GPU Coder.
  11. Goal: the car should drive autonomously several laps in the right lane as fast as possible.
  12. Dokumentation nach wissenschaftlichem Stand im HSHL-Wiki

Anforderungen

Das Projekt erfordert Vorwissen in den nachfolgenden Themengebieten. Sollten Sie die Anforderungen nicht erfüllen müssen Sie sich diese Kenntnisse anhand im Rahmen der Arbeit anhand von Literatur/Online-Kursen selbst aneignen.

  • Erfahrungen mit Künstlicher Intelligenz/Deep Learning
  • Programmierung in C++, Python
  • Dokumentenversionierung mit SVN

Anforderungen an die wissenschaftliche Arbeit

Projektplan

Abb.2: Projektplan


SVN-Repositorium

Getting started

Lesen Sie zum Einstieg diese Artikel


Understand the existing system framework

Optimize AI for speed and robustness in the lab

Improve the controller (e.g., PD controller)

Use MATLAB to train on Jetson Nano

Drive JetRacer counterclockwise using a gamepad, limiting speed (e.g., 1 m/s)

Record a lap using a MATLAB script

Load and retrain a pretrained NN with a MATLAB GUI

Optionally, automate NN training with classic lane tracking

Develop a PD controller using the NN, coded in MATLAB for JetRacer GPU

Summary

  • Firstly connecting to the Jetracer and MATLAB according to the [1] MATLAB documentation, which help up to setup the full process.
  • For modeling the project it can be make as simple as possible to understand the steps to follow, in this paper [2],it shows some of the ideas and implementation can be done.
  • A outline of the line following algorithm diagram can be:





  • Firstly the camera configuration, Detecting the Jetracer camera then creating a video input object to set all the parameter like frame rate, resolution and others. Then the image acquisition can start its video labeling. [3]
  • For image acquisition after setting up camera, it start capturing image on fixed parameter which has been set. Image Processing for the line following starts as a capture the lane data from track, then convert it to grayscale image. Also applying edge detection(Canny), thresholding to locate the line and process the data. Then it continues the loop for the full process.






  • After getting all the data its time for analyze and make it setup for the Jetracer. While from the frame capture extracting the following line feature is main goal. Line positioning, direction of car, prediction of the path to follow next is also part of the process. All the analysis process the speed and steering control gets calculated to create a PID controller.
  • Controlling the Jetracer with PID controller has various complex steps to follow such as maintaining the speed, line, steering angle. Setting up the PID values to minimum at first then after identifying the error rate of the predicted line. Then tuning the parameters of the PID help to get the control results.
  • The structure of the model is divided in various part:
main.m: Contains the main loop and integrates other modules.
camera.m: Contains code for camera initialization.
processimage.m: Handles image processing & find line to follow.
PID_controller.m: Manages the PID control logic.
adjustSteering.m: Contains the code to adjust the Jetracer's steering.

Mögliche Folgethemen

  • Kreuzungserkennung
  • Vorfahrterkennung
  • Hinderniserkennung und Umfahrung
  • Schildererkennung

Nützliche Artikel

Literatur

Schreiber, C.: KI-gestützte „Follow-Me“-Funktion am Beispiel des JetRacer. Mittweida, Hochschule Mittweida – University of Applied Sciences, Fakultät Ingenieurwissenschaften, Masterarbeit, 2023. URL: [4]


→ zurück zum Hauptartikel: Studentische Arbeiten