Modifications

Sauter à la navigation Sauter à la recherche
3 069 octets ajoutés ,  28 septembre 2015 à 07:33
Ligne 10 : Ligne 10 :     
== Qu'est ce qu'un IMU? ==
 
== Qu'est ce qu'un IMU? ==
Il est équipé d'une centrale de mesure inertielle (dite IMU pou Inertial Measurement Unit) sous forme d'une puce qui inclus:
+
{{bloc-etroit|text=Il est équipé d'une centrale de mesure inertielle (dite IMU pou Inertial Measurement Unit) sous forme d'une puce qui inclus:
    
* Un gyroscope (qui mesure le ''moment'' et la rotation)
 
* Un gyroscope (qui mesure le ''moment'' et la rotation)
Ligne 22 : Ligne 22 :  
If you don't know your orientation you are in big trouble, so an IMU sensor like this one is used on all manned and unmanned spacecraft to track movements and maintain an understanding of orientation. Even the earliest spacecraft had them. Ask your grandparents if they remember the [http://en.wikipedia.org/wiki/Apollo_program Apollo missions] (''wikipedia, anglais'') that landed humans on the surface of the moon.
 
If you don't know your orientation you are in big trouble, so an IMU sensor like this one is used on all manned and unmanned spacecraft to track movements and maintain an understanding of orientation. Even the earliest spacecraft had them. Ask your grandparents if they remember the [http://en.wikipedia.org/wiki/Apollo_program Apollo missions] (''wikipedia, anglais'') that landed humans on the surface of the moon.
   −
Above is a picture of the IMU sensor from the Apollo command module. You'll notice how big it is compared to the tiny black cube on the Astro Pi; that's the difference between 1975 and 2015 technology. Incidentally, the Astro Pi IMU is probably not as accurate as the Apollo one, however it is a million times cheaper!
+
Above is a picture of the IMU sensor from the Apollo command module. You'll notice how big it is compared to the tiny black cube on the Astro Pi; that's the difference between 1975 and 2015 technology. Incidentally, the Astro Pi IMU is probably not as accurate as the Apollo one, however it is a million times cheaper!}}
   
+
 
 +
== Comment l'orientation est elle représentée? ==
 +
We all know the Earth rotates around an axis that runs between the North and South Poles. All objects in space or otherwise have three axes around which they can rotate. If you know how much rotation has happened on each axis, then you know which way the object is pointing.
 +
 
 +
Les 3 axes utilisés pour décrire le mouvement sont:
 +
* Elévation, dit "Pitch" en anglais (comme quand l'avion décolle)
 +
* Roulis/Roulement, dit "Roll" en anglais (comme un avion qui faire la rouleau de la victoire, ou une voiture qui fait un tonneau)
 +
* Lacet/Embardée, dit "Yaw" en anglais  (imaginez un avion qui dévie de sa route comme le ferait une voiture, où une voiture qui prend un virage "en lacet")
 +
 
 +
Etant donné que l'interface de programmation du Sense Hat utilise ces mêmes mots clés en anglais pour vous permettre d'accéder aux valeurs, nous allons préserver les termes "Pitch"n "Roll", "Yaw".
 +
 
 +
[[Fichier:RASP-SENSE-HAT-ASTRO-PI-Debuter-29.png|800px]]
 +
 
 +
[[Fichier:RASP-SENSE-HAT-ASTRO-PI-Debuter-30.jpg]]
 +
 
 +
Les images ci-dessus montre les 3 axes en relation avec le Sense Hat ainsi que la correspondance dans le monde réel.
 +
 
 +
Nous allons maintenant démarrer le programme d'exemple en 3D.
 +
 
 +
== Démonstration Appolo Soyuz ==
 +
The image below shows the Apollo Soyuz module that was used to take humans to the surface of the moon during the 1970s. The 3D demo we're going to play with shows this same spacecraft (but with less detail).
 +
 
 +
[[Fichier:RASP-SENSE-HAT-ASTRO-PI-Mouvement-10.jpg]]
 +
 
 +
You will need to have your Raspberry Pi and Sense HAT connected to the internet in order to download the required software.
 +
 
 +
Enter the commands below into a terminal window:
 +
 
 +
<nowiki>sudo apt-get install python3-pip
 +
sudo pip-3.2 install pi3d
 +
git clone git://github.com/astro-pi/apollo-soyuz
 +
cd apollo-soyuz
 +
sudo ./soyuz.py</nowiki>
 +
 
 +
Pi 1 users will have to wait 3 to 4 minutes for this to load. For Pi 2 users it's about 30 seconds. When you see the spacecraft appear on the screen start moving the Raspberry Pi and Sense HAT around with your hands. The the main booster is where the SD card slot is on your Pi.
 +
 
 +
See if you can get the spacecraft to do the pitch, roll and yaw movements. Refer back to the [https://www.youtube.com/watch?v=pQ24NtnaLl8 video] (''YouTube, anglais'') if you need to remind yourself which is which.
 +
 
 +
The code behind this demo is basically calling the Sense HAT {{fname|get_orientation}} function which accesses the IMU sensor. This then returns three angles between 0 and 360 degrees, one for each axis (pitch, roll and yaw). The spacecraft model is then rotated by those angles so that it points in the same direction. This is all repeating over and over very quickly to maintain the orientation of the model with what the IMU is reporting.
 +
 
 +
Press {{fname|Esc}} to exit the demo. Let's try a simpler version of this ourselves in code.
 +
 
 +
== Quelle direction est-elle pointée? ==
 +
'''1.''' Open '''Python 3''' from a terminal window as sudo by typing:
 +
 
 +
  <nowiki>sudo idle3 &</nowiki>
 
{{RASP-SENSE-HAT-ASTRO-PI-TRAILER}}
 
{{RASP-SENSE-HAT-ASTRO-PI-TRAILER}}
30 072

modifications

Menu de navigation