## **Lab 4** | Working with ROS ### Design of Autonomous Systems ### CSCI 6907/4907 - Section 86 ### Prof. **Sibin Mohan** --- ## **Objectives** - Install and configure the Intel RealSense IMU - Understand the fundamentals of the Robot Operating System (ROS) - Install ROS and set up a workspace - Access and process IMU data using ROS --- ## **Installing RealSense IMU** ### **Prerequisites** - **Hardware:** Intel RealSense device (e.g., D435i, L515) with a USB 3.0 port - **Software:** Ubuntu 18.04 or later, Python 3.6+ - **Dependencies:** Install `librealsense2` SDK --- ## **Step 1: Install Librealsense SDK** ### **1. Add the Intel RealSense Repository** ```bash sudo apt-key adv --keyserver keys.gnupg.net --recv-key 49B9A1F8 sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo $(lsb_release -sc) main" -u ``` ### **2. Install required packages** ```bash sudo apt-get install librealsense2-dkms librealsense2-utils librealsense2-dev librealsense2-dbg ``` ### **3. Verify installation** ```bash realsense-viewer ``` --- ## **Step 2: Enable IMU Streams** 1. Open **RealSense Viewer** 2. Select your device and enable **IMU Streams** 3. Observe **Accelerometer and Gyroscope data** --- ## **Step 3: Access IMU Data Programmatically** ### **Install Python API** ```bash pip install pyrealsense2 ``` Note: Check github for sample script --- ## **What is ROS?** ### **Robot Operating System (ROS)** - Open-source framework for robotic applications - Facilitates sensor integration and motion planning - Supports distributed computing and modularity --- ## **Key Features of ROS** - **Distributed System:** Multiple nodes communicate via topics - **Interoperability:** Standardized message passing via `sensor_msgs` - **Simulation & Visualization:** Tools like `Gazebo` and `rviz` --- ## **Lab Assignment** ### **Create a ROS workspace and demonstrate a basic hello_world ROS node.** Follow these steps 1. **Create the workspace:** 2. **Create a new package:** 3. **Create a Python script for the node:** 4. **Add the following code to `hello_world.py`:** 5. **Make the script executable:** 6. **Run the node:** --- ## **Summary** - Installed and configured the Intel RealSense IMU - Understood the basics of ROS and its architecture - Installed ROS Noetic and set up a workspace - Accessed IMU data programmatically and via ROS - Created a ROS workspace and demonstrated a basic `hello_world` ROS node