## **Lab 3** | Understanding and Using IMU Data on Navio2 Board [contd.] ### Design of Autonomous Systems ### CSCI 6907/4907 - Section 86 ### Prof. **Sibin Mohan** --- ## **Objectives** - Understand the working of Inertial Measurement Units (IMUs) - Read real-time IMU data from Navio2 board - Plot and analyze IMU data using Python --- ## **What is an IMU?** IMU stands for **Inertial Measurement Unit**, a sensor module used for measuring motion and orientation --- ### **Components of an IMU** - **Accelerometer**: Measures acceleration in X, Y, Z axes - **Gyroscope**: Measures angular velocity or rotational speed - **Magnetometer**: Detects magnetic fields and acts as a compass --- ### **Applications of IMUs** - Stability in drones and robots - Navigation in self-driving vehicles - Orientation tracking in smartphones --- ## **Lab Equipment** - Raspberry Pi with Navio2 shield - MicroSD Card (32GB or larger) - SSH-enabled device for remote access - Python 3 installed with necessary libraries --- ## **Part 1: Reading IMU Values** ### **Setup Steps** 1. **Prepare Hardware:** - Mount the Navio2 shield on the Raspberry Pi - Power the Raspberry Pi and access it via SSH 2. **Install Libraries:** Use the following commands to update your system and install necessary Python libraries. For detailed instructions, refer to the GitHub 3. **Python Script:** Create a script to read IMU data. Script details are available on the GitHub --- ## **Part 1: Reading IMU Values** 4. **Run Script:** Execute the Python script as instructed in the repository 5. **Observe:** IMU data for accelerometer, gyroscope, and magnetometer is displayed in real-time --- ## **Part 2: Plotting IMU Data** ### **Steps to Visualize Data** 1. **Install Matplotlib:** Use the command from the GitHub to install Matplotlib 2. **Update Script for Plotting:** Modify the script to include data plotting functionality. The full script is available in the GitHub 3. **Run Script:** Execute the updated script to collect and plot data 4. **Observe:** A plot of accelerometer data over time is displayed --- ## **Lab Assignment** 1. Show the TAs the plotted graph. 2. Submit a plot of accelerometer data collected from a Raspberry Pi swinging like a pendulum. --- ## **Summary** - Learned the fundamentals of IMU sensors - Collected real-time IMU data from Navio2 board - Visualized accelerometer data using Python and Matplotlib