Improve the Controller (e.g., PD Controller): Unterschied zwischen den Versionen

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
Evrard.leuteu-feukeu@stud.hshl.de (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Evrard.leuteu-feukeu@stud.hshl.de (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
 
(10 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 3: Zeile 3:
=== [[Jetracer]] ===
=== [[Jetracer]] ===
*Requirements:
*Requirements:
#Jupyter libraries containing jetracer.nvidia_racecar must be working  
#Jupyter libraries containing jetracer.nvidia_racecar must be working
[[Datei:Python library.png|mini]]
#Install pygame library on jetson nano with sudo pip install pygame
#Install pygame library on jetson nano with sudo pip install pygame
#Create a python file that will import pygame, import NvidiaRacecar, read and write steering values.
#Create a python file that will import pygame, import NvidiaRacecar, read and write steering values.
[[Datei:Controller library.png|mini]]
{| class="wikitable"
|+ Tabelle 5:  Python Library Setup
|-
! # !! Name !! Description !! Pictures
|-
| 1 || Main python libraries || These libraries are the root libraries of the JetRacer and must be available because other libraries will depend on them. || [[Datei:Python library.png|mini|Fig. 6: Python Libraries]]
 
 
|-
| 2 || Library for Control and steering  || Since we can not use MATLAB directly on the Jetracer, we can, however, call a python code to run in the background on Matlab || [[Datei:Controller library.png|mini|Fig. 7: Controller Library Files]]
 
|-
| 3 || Python script || This script details how the inputs from the Gamepad is recorded and transmitted to Matlab thought steering_values.txt ||
[[Datei:Jtest.png|mini|Fig. 8: Controller Library script]]
|}
 


=== [[Matlab]] ===
=== [[Matlab]] ===
After the above requirements are satisfied, we then proceed to call the library in the background as shown below:
After the above requirements are satisfied, we then proceed to call the library in the background as shown below:
 
[[Datei:Image.png|mini|Fig. 9: Matlab Background Library Call]]
=== [[Results]] ===
zeigmess
jtest etc

Aktuelle Version vom 12. Juni 2025, 22:10 Uhr

Improve the Controller

As mentioned in the previous chapter, instead of recreating the Python library with MATLAB script, we create a Python library that will run all necessary libraries needed to operate the JetRacer, then run it with MATLAB in the background.

Jetracer

  • Requirements:
  1. Jupyter libraries containing jetracer.nvidia_racecar must be working
  2. Install pygame library on jetson nano with sudo pip install pygame
  3. Create a python file that will import pygame, import NvidiaRacecar, read and write steering values.
Tabelle 5: Python Library Setup
# Name Description Pictures
1 Main python libraries These libraries are the root libraries of the JetRacer and must be available because other libraries will depend on them.
Fig. 6: Python Libraries


2 Library for Control and steering Since we can not use MATLAB directly on the Jetracer, we can, however, call a python code to run in the background on Matlab
Fig. 7: Controller Library Files
3 Python script This script details how the inputs from the Gamepad is recorded and transmitted to Matlab thought steering_values.txt
Fig. 8: Controller Library script


Matlab

After the above requirements are satisfied, we then proceed to call the library in the background as shown below:

Fig. 9: Matlab Background Library Call