{ "cells": [ { "cell_type": "markdown", "source": [ "[← ROS Nodes and Gazebo](../../../getting_started/ros_to_gazebo/ros_nodes_and_gazebo.rst)\n" ], "id": "cell-0", "metadata": {} }, { "cell_type": "markdown", "source": [ "# Crazyflie Multi-Sensor Fusion: From Software to Gazebo\n" ], "id": "cell-1", "metadata": {} }, { "cell_type": "markdown", "source": "In the [Crazyflie ROS Deployment](../python_to_ros/crazyflie_ros_deployment.ipynb) tutorial, we created a multi-sensor fusion system with **three separate sensor nodes** in software. Now we'll integrate with Gazebo's Crazyflie model, which provides its own sensor suite.\n\n**Key Insight**: Gazebo maintains the same 3-sensor architecture!\n\nIn software (theory + ROS deployment), we had:\n- `/mocap`: Motion capture (3D position)\n- `/baro`: Barometer (altitude) \n- `/imu`: IMU (velocity)\n\nGazebo's Crazyflie provides the **same sensors**:\n- `/mocap`: Simulated motion capture (3D position)\n- `/baro`: Simulated barometer (altitude)\n- `/imu`: Simulated IMU (velocity)\n\nThis tutorial demonstrates **seamless architecture preservation** from software simulation to Gazebo, maintaining the 7D measurement fusion throughout the pipeline.", "id": "cell-2", "metadata": {} }, { "cell_type": "markdown", "source": "## Architecture Evolution: Software → Gazebo\n\n**Software Simulation** (previous notebook):\n\n```\nsetpoint_node → /setpoint\n ↓\ncontroller_node → /cmd_vel\n ↓\ncrazyflie_simulator → /mocap, /baro, /imu ← 3 SEPARATE SENSORS\n ↓ ↓ ↓\n └─────────┴─────────┘\n ↓\n kalman_filter → /estimate\n```\n\n**Gazebo Integration** (this notebook):\n\n```\nsetpoint_node → /setpoint\n ↓\ncontroller_node → /cmd_vel\n ↓\nGAZEBO → /mocap, /baro, /imu ← SAME 3 SENSORS!\n ↓ ↓ ↓\n └─────────┴─────────┘\n ↓\n kalman_filter → /estimate\n```\n\n**Architecture Preservation**:\n- Software: 3 sensor topics (`/mocap`, `/baro`, `/imu`) → 7D measurement\n- Gazebo: **Same** 3 sensor topics (`/mocap`, `/baro`, `/imu`) → 7D measurement\n- No adaptation needed - **identical architecture**!\n\n:::{note}\nUnlike TurtleBot (which uses unified `/odom`), Crazyflie Gazebo simulates **individual sensors** to match the multi-sensor fusion from theory. This demonstrates how Gazebo can model realistic heterogeneous sensor suites!\n:::", "id": "cell-3", "metadata": {} }, { "cell_type": "markdown", "id": "cell-arch-diagram", "metadata": {}, "source": "## Conceptual Foundation: From Dynamical Systems to Gazebo\n\n### Theory: Composition of Dynamical Systems\n\nFrom the [theory notebook](../theory_to_python/crazyflie_sensor_fusion.ipynb), we modeled the system as a composition of dynamical systems:\n\n