{ "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": [ "# TurtleBot State Estimation: From Software to Gazebo Simulation\n" ], "id": "cell-1", "metadata": {} }, { "cell_type": "markdown", "source": [ "In the [TurtleBot ROS Deployment](../python_to_ros/turtlebot_ros_deployment.ipynb) tutorial, we ran our navigation system using a software simulator node. Now we'll integrate with **Gazebo**, replacing our simple simulator with a full physics engine.\n", "\n", "**Key Insight**: Gazebo is not a visualization tool—it's a ROS node ecosystem!\n", "\n", "When you launch Gazebo with a robot model, it automatically creates:\n", "- Physics simulation node\n", "- Sensor publisher nodes (`/odom`, `/scan`, `/imu`, etc.)\n", "- Robot state publisher\n", "- Transform (TF) broadcaster\n", "\n", "Our task: **Integrate our control nodes** with Gazebo's existing nodes.\n" ], "id": "cell-2", "metadata": {} }, { "cell_type": "markdown", "source": [ "## Architecture Evolution: Software → Gazebo\n", "\n", "**Software-Only Simulation** (previous notebook):\n", "\n", "```\n", "waypoint_generator → /reference\n", " ↓\n", "velocity_controller → /cmd_vel\n", " ↓\n", "turtlebot_simulator → /odom ← WE IMPLEMENTED THIS\n", " ↓\n", "kalman_filter → /estimate\n", "```\n", "\n", "**Gazebo Integration** (this notebook):\n", "\n", "```\n", "waypoint_generator → /reference\n", " ↓\n", "velocity_controller → /cmd_vel\n", " ↓\n", "GAZEBO (physics engine) → /odom ← GAZEBO PROVIDES THIS\n", " ↓\n", "kalman_filter → /estimate\n", "```\n", "\n", "**What Changed**:\n", "- ❌ Remove: `turtlebot_simulator` node\n", "- ✓ Add: Gazebo launch\n", "- ✓ Unchanged: waypoint generator, controller, Kalman filter\n", "\n", ":::{note}\n", "The controller and observer **don't know or care** whether `/odom` comes from our simulator, Gazebo, or a real robot!\n", ":::\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/turtlebot_state_estimation.ipynb), we modeled the system as a composition of dynamical systems:\n\n