Final Product: Mission Complete

This is the complete program that combines everything we have learned! It captures data, calculates speed using two methods, decides which one is best, and saves the result.

1. Setup & Tools

We import libraries like SenseHat for sensors, Camera for taking photos, ISS for orbit info, and cv2 (OpenCV) for image processing. We also set up some constants like RAIO_TERRA (Earth radius).

2. Helper Function

calcular_distancia_coords uses the Haversine formula. This is a special math way to measure distance on a sphere (like Earth) given two points (latitude/longitude).

3. Step 1: Collect Coordinates

We use a loop to grab the ISS coordinates 10 times, waiting 10 seconds between each grab. This gives us a path of points over time.

4. Step 2: Capture Photos

Another loop takes 10 photos, also 10 seconds apart. We save their filenames so we can analyze them later.

5. Step 3: Speed from Coordinates

We calculate the speed between each pair of coordinates (Distance / Time). Then we find the median (middle value) to ignore any weird errors.

6. Step 4: Speed from Photos

This is the advanced part! We use OpenCV’s ORB to find "key points" (like corners) in each photo. We match these points between two photos to see how far the ground moved in pixels. We convert pixels to km using KM_POR_PIXEL and calculate speed.

7. Step 5: Decision & Save

We compare the two speeds. If the photo speed is close to the coordinate speed (within 1 km/s), we trust it. Otherwise, we stick to the coordinate speed as a backup. Finally, we write the answer to result.txt.

Mission Control Interface

Loading Python environment...
Output Terminal
Ready to execute...
â–¼ Visual Output
Click to collapse
LED Matrix
Camera Feed
📷
No image