<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhishek Sachi on Medium]]></title>
        <description><![CDATA[Stories by Abhishek Sachi on Medium]]></description>
        <link>https://medium.com/@abhi.p.sachi?source=rss-02a9fd481e83------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7NG8UmEkGfsDgL1L</url>
            <title>Stories by Abhishek Sachi on Medium</title>
            <link>https://medium.com/@abhi.p.sachi?source=rss-02a9fd481e83------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 10:27:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhi.p.sachi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How‑To Guide on ROS2 Navigation]]></title>
            <link>https://medium.com/correll-lab/how-to-guide-on-ros2-navigation-4237a3b63598?source=rss-02a9fd481e83------2</link>
            <guid isPermaLink="false">https://medium.com/p/4237a3b63598</guid>
            <category><![CDATA[robot-operating-system]]></category>
            <category><![CDATA[aml]]></category>
            <category><![CDATA[turtlebot]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Abhishek Sachi]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 04:48:39 GMT</pubDate>
            <atom:updated>2025-12-22T04:48:39.202Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using Nav2 on a simulated TurtleBot3 on Windows</h4><p><em>This article provides a comprehensive how‑to guide for installing, configuring, and using the ROS2 Navigation Stack (Nav2) with the TurtleBot3 robot in simulation. It is structured as both a research‑style overview and a practical manual. Coverage includes background theory, system setup, simulation workflow, navigation algorithms, troubleshooting, and best practices.</em></p><h3>Introduction</h3><p><a href="https://www.ros.org/">Robotics Operating System 2</a> (ROS2) is a widely used framework for building autonomous robotic systems. The <a href="https://docs.nav2.org/">Navigation Stack</a> (Nav2) is a core component enabling robots to plan paths, avoid obstacles, and move autonomously in simulated or real environments. The <a href="https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/">TurtleBot3</a> robot platform serves as a lightweight, open‑source platform ideal for learning navigation concepts.</p><p>This paper acts as both an instructional guide and a research-style reference, explaining how to set up Nav2, run simulations using TurtleBot3 and Gazebo, and understand the underlying algorithms.</p><h3>Background and Motivation</h3><p><strong>ROS2 </strong>provides communication infrastructure (topics, services, actions), tools (RViz2, rqt), and middleware (DDS) for constructing distributed robotic systems. It improves upon ROS1 with real-time, safety, and multi-platform support.</p><p><strong>Nav2 </strong>replaces ROS1’s Navigation Stack and supports: — Path planning — Path following — Obstacle avoidance — Mapping — Localization using SLAM or AMCL</p><p><strong>TurtleBot3 </strong>is compact and simulation-friendly. Its open-source URDF, sensor models, and configurations simplify learning navigation.</p><h3>System Requirements</h3><h4>Software Used in Article</h4><p>· WSL (Windows Subsystem for Linux): To use Windows, we need to have WSL installed to run the Linux subsystem on a Windows machine, as ROS2 is only supported through Linux. Instructions to do so <a href="https://learn.microsoft.com/en-us/windows/wsl/install">here</a></p><p>· Ubuntu 22.04 is installed on WSL. Instructions to do so <a href="https://documentation.ubuntu.com/wsl/stable/howto/install-ubuntu-wsl2/">here</a></p><p>· <a href="https://www.docker.com/get-started/">Docker </a>and <a href="https://docs.docker.com/desktop/setup/install/windows-install/">Docker Desktop</a>: This provides containerization so any machine can run the simulation that is later stated in the article</p><p>· <a href="https://docs.ros.org/en/humble/index.html">ROS2 Humble</a> or newer (this article uses ROS2 Humble): Robotic Subsystem to run simulations later explored</p><p>· <a href="https://gazebosim.org/home">Gazebo </a>(Harmonic or Fortress): Simulation software to run the simulations later explored</p><p>· <a href="https://docs.nav2.org/">Nav2</a>: Navigation stack</p><p>· <a href="https://sourceforge.net/projects/vcxsrv/">XLaunch</a>: GUI application to run the simulations on</p><h4>Hardware</h4><p>· Minimum 4-core CPU</p><p>· At least 8GB RAM</p><p>· GPU recommended for Gazebo</p><h3>Installation Guide</h3><h4>Installing ROS2 Humble Using Docker (Recommended for Windows + WSL)</h4><p>This section provides in-depth installation instructions and a complete, Docker-based setup workflow appropriate for Windows systems using WSL, Docker Desktop, and XLaunch. This approach ensures a clean, reproducible environment for running ROS2 Humble, Nav2, and TurtleBot3 simulations.</p><h3>Prerequisites (Already Installed)</h3><p>· <strong>Docker Desktop</strong> — required to run ROS2 Humble containers.</p><p>· <strong>WSL2</strong> — backend for Docker Desktop.</p><p>· <strong>XLaunch (VcXsrv)</strong> — required to render GUI applications such as Gazebo and RViz2.</p><p>You do <strong>not</strong> need to reinstall any of these.</p><h3>Downloading ROS2 Humble Docker Image</h3><p>ROS2 Humble + Ubuntu 22.04 (Jammy Jellyfish) desktop image can be pulled directly from OSRF’s Docker registry:</p><pre>docker pull osrf/ros:humble-desktop-full-jammy</pre><p>Reference: ROS Docker images list → <a href="https://hub.docker.com/r/osrf/ros/tags">https://hub.docker.com/r/osrf/ros/tags</a></p><h3>Starting the ROS2 Container (No GUI)</h3><p>You may start a basic container using:</p><pre>docker run - name r2_humble -it osrf/ros:humble-desktop-full-jammy</pre><p>This creates a container and places you inside it.</p><p>Useful commands: <em>— docker images </em>— view pulled images <em>— docker ps </em>— view running containers</p><p>However, this setup <strong>does not support GUI applications</strong>.</p><h3>Configuring XLaunch</h3><p>Before running GUI apps such as turtlesim, Gazebo, or RViz2: 1. Open <strong>XLaunch</strong>. 2. Configure with: — <strong>Multiple windows</strong> — <strong>Display number: 0</strong> — <strong>Start no client</strong> — <strong>Disable access control</strong> (important for Docker) 3. Click <strong>Finish</strong>.</p><p>XLaunch now handles all GUI rendering for the ROS2 container.</p><p>Here is the XLaunch Download link for Windows: <a href="https://sourceforge.net/projects/vcxsrv/">https://sourceforge.net/projects/vcxsrv/</a></p><h3>Starting ROS2 Container With GUI Support (For Gazebo &amp; RViz2)</h3><p>To support GUI applications, you must link the container to your Windows host display:</p><pre>docker run - name r2_humble -e DISPLAY=host.docker.internal:0.0 -it osrf/ros:humble-desktop-full-jammy</pre><p>This sets your container’s display to: — <strong>host.docker.internal</strong> — Windows host IP — <strong>0.0</strong> — display port used by XLaunch</p><h3>Configuring DISPLAY in WSL2 (Optional)</h3><p><strong>Only use this command if you did not run the docker container as stated above with the DISPLAY port correctly initialized.</strong></p><p>Inside WSL2, run:</p><pre>export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk &#39;{print $2}&#39;):0.0</pre><p>Test GUI support:</p><p>xclock</p><p>If xclock appears on Windows, GUI integration is working.</p><p>(Optional) Install X11 test utilities:</p><pre>sudo apt install x11-apps -y</pre><p>Add the DISPLAY command to ~/.bashrc if you want it to load automatically.</p><h3>Installing Nav2 and TurtleBot3 (From Inside the Container)</h3><p>Now that we can run Gazebo and ROS2, within our environment, we can install Nav2 and TurtleBot3.</p><p>Once inside the Docker ROS2 environment:</p><h4>Step 1: Source ROS2</h4><pre>source /opt/ros/humble/setup.bash</pre><h4>Step 2: Update packages</h4><pre>sudo apt update<br>sudo apt upgrade -y</pre><h4>Step 3: Install Navigation2</h4><pre>sudo apt install ros-humble-navigation2 ros-humble-nav2-bringup -y</pre><p>This installs all core Nav2 nodes: AMCL, map server, planner/server, controller server, behavior tree navigator, etc.</p><h4>Step 4: Install TurtleBot3 Simulation</h4><pre>sudo apt install ros-humble-turtlebot3-gazebo -y</pre><h4>Step 5 (Optional but Recommended): Install Full TurtleBot3 Package Suite</h4><pre>sudo apt install ros-humble-turtlebot3* -y</pre><h3>Running the TurtleBot3 + Nav2 Simulation</h3><p>Once ROS2, Nav2, and TurtleBot3 are installed, you can launch the full navigation demo.</p><h4>Step 1: Source ROS + Set Environment Variables</h4><pre>source /opt/ros/humble/setup.bash<br>export TURTLEBOT3_MODEL=waffle<br>export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models</pre><h4>Step 2: Launch Simulation</h4><pre>ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False</pre><p>This opens: — <strong>Gazebo Classic</strong> with TurtleBot3 world — <strong>RViz2</strong> connected to the Nav2 stack</p><p><strong>Below is what should be brought up when you run the simulation:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*X1-Gw50AbTCpm-ijwLiDYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hD1ZCBOieE79kVsiVEOEyw.png" /></figure><h4>Step 3: Using RViz2 (See Section 7 for more Information)</h4><p>· Click <strong>2D Pose Estimate</strong> → select the robot’s starting pose</p><p>· Click <strong>Navigation2 Goal</strong> → choose a destination</p><p><strong>The TurtleBot3 will autonomously navigate using Nav2 and avoid structures along the way. Below is an example of how the simulation should run.</strong></p><p><a href="https://vimeo.com/1147543983?share=copy&amp;fl=sv&amp;fe=ci">https://vimeo.com/1147543983?share=copy&amp;fl=sv&amp;fe=ci</a></p><h3>Safe Shutdown and Cleanup</h3><h4>Step 1: Cleanly stop all ROS processes</h4><p>In the running terminal:</p><p>Ctrl + C</p><p>This stops: — Nav2 nodes — Gazebo — RViz2</p><h4>Step 2 (Optional): Kill any leftovers</h4><pre>pkill -f gazebo<br>pkill -f rviz2<br>pkill -f ros2</pre><h4>Step 3 (Optional): Reset ROS2 Daemon</h4><pre>ros2 daemon stop<br>ros2 daemon start</pre><h4>Step 4: Close WSL safely</h4><p>exit</p><h3>Setting Up the TurtleBot3 Simulation — Extra Optional Information</h3><h3>Launch TurtleBot3 in Gazebo</h3><pre>ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py</pre><h3>Launch RViz2</h3><pre>ros2 launch turtlebot3_bringup rviz2.launch.py</pre><h3>Launch Navigation Stack</h3><pre>ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True</pre><h3>Explanation of the Launch Files</h3><p>· <strong>world.launch.py</strong> spawns a simulation environment.</p><p>· <strong>navigation_launch.py</strong> starts localization, planning, and control nodes.</p><p>· <strong>use_sim_time:=True</strong> ensures Nav2 uses Gazebo time.</p><h3>Understanding Nav2 Components + Extra Materials to Use</h3><ul><li><strong>Localization:</strong> Nav2 typically uses Adaptive Monte Carlo Localization (AMCL) to estimate the robot’s position on a 2D map by comparing laser scan data with a known environment. In the TurtleBot3 simulation, AMCL uses the simulated LiDAR data in Gazebo to localize the robot within the provided world map.</li><li><strong>Mapping:</strong> When a map is not available, Nav2 supports SLAM using tools such as SLAM Toolbox or GMapping to build a map while the robot moves. In the TurtleBot3 simulation, SLAM Toolbox allows the robot to generate a 2D occupancy map of the Gazebo environment in real time.</li><li><strong>Planning:</strong> Navigation is divided into global and local planning, where the global planner computes an overall path and the local planner produces safe, short-term motion commands. Within the TurtleBot3 simulation, these planners enable the robot to navigate around simulated obstacles while following efficient paths to user-defined goals in RViz.</li><li><strong>Controller Servers:</strong> These servers translate planned trajectories into velocity commands that control the robot’s movement. In the TurtleBot3 simulation, controller servers publish velocity commands that drive the simulated robot model smoothly through the Gazebo environment.</li><li><strong>Recovery Behaviors:</strong> Nav2 includes recovery actions such as clearing costmaps or rotating in place to handle navigation failures. In the TurtleBot3 simulation, these behaviors can be observed when the robot becomes stuck against virtual obstacles and automatically attempts to recover.</li></ul><h3>Running Autonomous Navigation</h3><ol><li><strong>Localize the Robot:</strong> Using RViz, the initial pose of the robot is set to align its estimated position with the map. In the TurtleBot3 simulation, this initializes AMCL using the simulated sensor data so the robot’s pose in RViz matches its position in Gazebo.</li><li><strong>Set a Navigation Goal:</strong> A target location is selected in RViz by clicking the <em>2D Nav Goal</em> tool and choosing a destination on the map. In the TurtleBot3 simulation, this goal triggers the Nav2 planning stack to compute a path across the simulated environment.</li><li><strong>Observe Navigation:</strong> The robot plans a path, avoids obstacles, and moves toward the goal autonomously. In the TurtleBot3 simulation, this behavior can be visualized in real time as the robot navigates around virtual obstacles and reaches the selected destination.</li></ol><h3>Troubleshooting</h3><h3>Gazebo GUI Not Showing</h3><p>Install Xauth or Xlaunch on Windows.</p><h3>Robot Not Moving</h3><p>Check:</p><pre>ros2 topic echo /cmd_vel</pre><h3>TF Errors</h3><p>Ensure: — Correct URDF — No conflicting frames</p><h3>Poor Path Planning</h3><p>Adjust Nav2 parameters: — costmap resolution — inflation layer — planning algorithm</p><h3>Safe Shutdown Procedure</h3><p>1. Close RViz2</p><p>2. Ctrl+C the Nav2 launch</p><p>3. Ctrl+C Gazebo</p><p>4. Optional: Kill lingering nodes</p><pre>ros2 node list<br>ros2 lifecycle set &lt;node&gt; shutdown</pre><h3>Discussion and Research Context</h3><h3>Nav2 in Research</h3><p>Nav2’s plugin architecture makes it ideal for experimenting with: — Novel planners (e.g., ML-based planners) — Autonomous exploration algorithms — Multi-robot coordination</p><h3>Simulation vs Real Robots</h3><p>Simulation enables safe testing of navigation algorithms. However, real-world noise and sensor inaccuracies require tuning.</p><h3>Conclusion</h3><p>This article presents an end-to-end tutorial and research overview on ROS2 Nav2 with TurtleBot3 in simulation. Readers should now be equipped to install, configure, and experiment with advanced navigation behaviors.</p><h3>References</h3><p>· ROS2 Documentation</p><p>· Nav2 Documentation</p><p>· TurtleBot3 Manuals</p><p>· Gazebo Tutorials</p><p>· Docker Tutorials</p><p>· Informational Video: <a href="https://www.youtube.com/watch?v=qWuudNxFGOQ&amp;t=223s">https://www.youtube.com/watch?v=qWuudNxFGOQ&amp;t=223s</a></p><h3>Extended Analysis of Nav2 Architecture</h3><p>The Nav2 architecture is modular, allowing researchers and developers to replace or extend individual components without modifying the overall system. This modularity is achieved through a combination of lifecycle-managed nodes and plugin-based interfaces. Each core subsystem, localization, planning, control, recovery behaviors, and behavior trees, communicates through well-defined interfaces. This enables experimentation with alternative planning algorithms, integration of additional sensing modalities, and performance optimization across the navigation pipeline. For example, the planner server can dynamically load different global planners such as Smac or Theta*, allowing researchers to evaluate algorithmic efficiency and path optimality in various simulated environments.</p><h3>Simulation Fidelity and Its Impact on Research</h3><p>One of the major challenges in robotic research is bridging the “sim-to-real” gap. While simulation platforms like Gazebo provide accurate physics, sensor noise models, and environment rendering, they still simplify certain aspects of real-world robotics. Factors such as wheel slippage, lighting conditions, real sensor errors, and mechanical wear cannot be fully replicated in simulation. Nonetheless, simulation offers a safe, repeatable, and cost-efficient environment for initial development. Researchers often adopt a two-stage methodology: prototype in simulation to ensure functional correctness, then transfer to physical hardware for robustness testing. This workflow drastically reduces risk and accelerates the development of navigation systems.</p><h3>Advanced Navigation Techniques in Nav2</h3><p>Beyond basic point-to-point navigation, Nav2 supports the implementation of advanced navigation techniques. This includes dynamic obstacle avoidance, reactive planning, and adaptive control strategies. Behavior Trees (BTs), used extensively in Nav2, provide a flexible decision-making framework that allows robots to respond intelligently to unexpected events. For instance, a robot may replan its path when encountering a blocked hallway or perform a controlled recovery maneuver when localization confidence drops. Researchers can modify behavior trees to introduce new states, transitions, or fallback behaviors, enabling complex autonomy architectures suited for multi-goal missions, patrol cycles, or human-robot interaction tasks.</p><h3>Applications of TurtleBot3 + Nav2 in Education and Industry</h3><p>The TurtleBot3 platform paired with Nav2 is widely used in academic robotics courses, allowing students to practice navigation algorithms without requiring expensive hardware. In research settings, it supports rapid prototyping of autonomous behaviors for warehouse robotics, indoor service robots, and multi-robot systems. Because TurtleBot3 is ROS2-native, it aligns well with industry trends toward DDS-based communication and modular autonomy stacks. Companies developing commercial robots often prototype algorithms using TurtleBot3 simulations before migrating to proprietary hardware platforms.</p><h3>Future Directions for ROS2 Navigation</h3><p>The development of Nav2 continues alongside improvements to ROS2 middleware and community-driven enhancements. Future directions include real-time deterministic planning, tighter integration with machine learning models for semantic navigation, and expanded support for multi-robot collaboration. Another promising area is the fusion of 3D sensor data, such as lidar and depth cameras, into full 3D navigation stacks that extend beyond traditional 2D costmaps. As computing power and algorithmic sophistication evolve, Nav2 is expected to play a central role in enabling fully autonomous robots capable of navigating complex human environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4237a3b63598" width="1" height="1" alt=""><hr><p><a href="https://medium.com/correll-lab/how-to-guide-on-ros2-navigation-4237a3b63598">How‑To Guide on ROS2 Navigation</a> was originally published in <a href="https://medium.com/correll-lab">Toward Humanoids</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>