Coordinated Autonomy:
Goal-Oriented Navigation with TurtleBot and ESP32

Autonomous navigation made smart, fast, and affordable — our ROS2-powered system fuses multi-sensor data, real-time control, and live insights to drive intelligent decisions on low-cost hardware.

▶ View Gallery
TurtleBot Robot Model

Project Description

Scope

The system implements a goal-oriented autonomous navigation framework where an ESP32 equipped with an IMU publishes a target location to a ROS 2 topic. The TurtleBot4, after autonomously mapping its environment, listens to this goal and performs real-time path planning and navigation while avoiding obstacles. The architecture emphasizes modularity, real-time processing, and seamless hardware-to-ROS integration.

Data Collection

  • Current Position: Estimated through /rpi_07/amcl_pose, based on adaptive Monte Carlo localization
  • Goal Position: Received via /esp32_07/goal as a geometry_msgs/Point
  • Path and Map: SLAM-based mapping through auto_map.launch.py, with the map saved via auto_save.py
  • Wheel Velocity: Entirely computed on a dedicated VM—the RPi simply forwards topic data over Ethernet—minimizing onboard load and reducing latency

Initial Data Collection

At the start, the intent was to directly use raw IMU readings for velocity control—manipulating wheel speeds via /cmd_vel based on tilt. This approach proved inconsistent and lacked precision. Recognizing this, the data strategy was shifted to interpreting the IMU's global position estimate as a goal, which the robot could reach using the more robust Nav2 planner.

  • Learning: IMU as a goal provider rather than motion controller was a turning point in shaping a stable, achievable project scope.
  • Cmd_Vel Integration: The obstacle_avoid.py node continuously processes LiDAR data from /rpi_07/scan to detect obstacles and dynamically publishes velocity commands to /rpi_07/cmd_vel. By adjusting both linear and angular speeds in real time, it ensures smooth forward motion while safely steering around any detected obstructions.
  • Python Code Flow: esp32_goal.py receives the ESP32 goal and sends it to the NavigateToPose action server, ensuring smooth execution within Nav2.

Filtering

Although no ML training was conducted, filtering was essential. The ESP32 data likely underwent low-pass filtering (or smoothing) on-device to avoid goal jitter. On the TurtleBot side, stability was maintained by ignoring rapid goal updates and sending the navigation goal only once per session.

This passive filtering ensured reliability and reduced misbehavior in dynamic environments.

How ROS Was Used

    ROS 2 formed the communication and control backbone of our system: sensor data (IMU goals, LiDAR scans, odometry) was published and subscribed on topics like /esp32_07/goal, /rpi_07/scan, and /rpi_07/amcl_pose, while motion commands flowed on /rpi_07/cmd_vel. We leveraged the NavigateToPose action server for asynchronous goal execution and feedback, and organized our nodes into modular launch files (mapping, localization, navigation, obstacle avoidance, map saving). This architecture provided real-time responsiveness, clear separation of concerns, and easy extensibility across all autonomy components.

  • Pub/Sub:
    • ESP32 → /esp32_07/goal
    • Odometry → /rpi_07/odom, Localization → /rpi_07/amcl_pose
    • Velocity control → /rpi_07/cmd_vel
  • Action Server:
    • Goal execution through /rpi_07/navigate_to_pose using esp32_goal.py
  • Launch Architecture:
    • Mapping via auto_map.launch.py (calls SLAM + RViz + obstacle_avoid + auto_save)
    • Navigation via navigation_with_local.launch.py (loads map, localization, Nav2 stack, and goal subscriber)

Validation

  • Console Echo: Verifying /esp32_07/goal reception and value range to ensure the ESP32 IMU topic is published and configured correctly.
  • Visual Feedback:
    • Goal markers visualized using RViz and /goal_marker
    • Map and pose tracking via /rpi_07/map, /rpi_07/odom, and AMCL particles
  • Real-world Evidence:
    • Recorded videos demonstrate successful navigation from initial pose to dynamic goal using Nav2’s global and local planners with AMCL-based localization while seamlessly integrating real-time obstacle avoidance; trajectory visualizations confirm convergence to goal.
    • Trajectory visualization confirms convergence to goal
  • Graphing (Optional):
    • Position and path data can be logged via /rpi_07/amcl_pose alongside Nav2 planner metrics to evaluate localization accuracy, path planning efficiency, and trajectory smoothness.

Introduction

Portfolio of Topics Learned

  • ROS 2 concepts including nodes, publishers/subscribers, actions, and launch files
  • SLAM (Simultaneous Localization and Mapping) using Nav2 and TurtleBot 4
  • Autonomous navigation and localization using YAML map files
  • LiDAR-based obstacle avoidance
  • Action server communication for goal-based navigation (NavigateToPose)
  • Real-time goal communication via ESP32 and IMU integration
  • Map saving and loading using map_saver_cli
  • Offloading heavy computation to a ROS 2–enabled VM for performance optimization

Assist Future Students to Define Their Project Scope

This project serves as an excellent reference for students interested in:

  • Multi-agent communication (e.g., ESP32 and TurtleBot coordination)
  • Modular ROS 2 launch and execution design
  • Real-world autonomous navigation tasks
  • Incorporating embedded sensors like IMUs for higher-level decision making
  • Designing hybrid control systems (manual + autonomous)

Shaping the Class: Integrating Potential Creative Solutions

A unique aspect of this project is the seamless interaction between an ESP32 and a robot platform through ROS 2 middleware. Instead of hard-coding goals or relying on GUI inputs, the robot reacts to real-world sensor inputs from a lightweight embedded device. This concept opens up creative applications such as:

  • Swarm coordination
  • Mobile robot dispatch
  • Remote exploration or search-and-rescue simulations

Key Takeaways

This project showcased a successful transition from raw sensor-based motion attempts to a robust goal-oriented autonomous system powered by ROS 2. Challenges in initial control logic gave way to a more reliable architecture that used filtered IMU data to guide navigation. The integration of mapping, obstacle detection, action-based goal navigation, and real-time ROS messaging serves as a blueprint for future mobile robotic systems with embedded remote input sources.

Topics Learned

  • ROS 2 architecture and launch system
  • Obstacle avoidance using LiDAR
  • Map saving and localization techniques
  • Using ActionClient and goal markers in real time
  • Bridging sensor data from ESP32 to a ROS 2 navigation stack

Problems Faced

  • Slight inaccuracy in the final goal position
  • Manual setup required for robot pose initialization
  • CPU load bottlenecks on the TurtleBot 4’s onboard RPi
  • Initial latency in ESP32 goal communication

Solutions Found

  • All computation runs on a dedicated VM— the RPi only forwards topics to the VM over Ethernet, which also lowers system latency.
  • Added startup delay and turning logic to obstacle_avoid.py for smoother performance
  • Introduced a keypress-triggered map save node for intuitive map storage
  • Ensured consistent namespace usage and topic remapping to streamline communication between nodes

Pose Estimation & Model Fitting

Integration into ROS 2

ROS 2 orchestrates communication between the ESP32 goal bridge, SLAM Toolbox mapping, Nav2 planning, IMU filtering, and data logging via DDS and pub/sub, enabling distributed, real-time autonomy and seamless debugging.

Validation & Success Metrics

Updated Project Goals

Our comprehensive objectives align all efforts toward a single hardware testbed: receiving goals wirelessly, mapping and planning with ROS 2, and logging performance metrics—laying groundwork for EKF-based fusion.

Original Aim

  • Explore full multi-sensor fusion vs. simulation
  • Benchmark advanced SLAM pipelines

Current Aim

  • Ensure robust ESP32→TurtleBot goal interface
  • Demonstrate repeatable navigation with metrics
  • Prepare for future EKF fusion

Project Process & Workflow

We progress through key features week-by-week—from TurtleBot activation and camera node, through filtering, SLAM, planning, GUI, to final integration and demo. The timeline below maps each feature to its scheduled week.

Task
Wk 7
Wk 8
Wk 9
Wk 10
Wk 11
Wk 12
Wk 13
Wk 14
Wk 15
Wk 16
TurtleBot Activation
Camera Node
IMU Filtering + GUI
LiDAR + SLAM
Mapping with SLAM
ESP32 + IMU Setup
Path Planning
GUI: Live Data
Full Integration
Final Demo

Flowchart

This flowchart illustrates our entire ROS 2–based navigation pipeline from system startup through autonomous goal execution and parameter tuning. Each box represents a node or step, arrows show data flow, and the decision diamond marks whether the TurtleBot has reached its target.

graph TB A[Start System Initialization] A -->|Power Up & Self Check| B[TurtleBot4: Activate Sensor Suite
IMU, LiDAR, Camera, Odometry] B --> C[Perform SLAM & Build Map
LiDAR-based Environment Mapping] C --> D[ESP32 + IMU: Transmit Target Coordinates
Over Wireless Interface] D --> E[ROS 2: Convert Coordinates to Goal Pose
Apply TF Transformations] E --> F[Nav2 Stack: Perform Global & Local Planning
Pathfinding with Obstacle Avoidance] F --> G[TurtleBot4: Execute Motion Plan
Navigate Autonomously to Target] G --> H[Collect Real-time Sensor Data
IMU for Stability, LiDAR for Collision Avoidance] H --> I[Check Goal Reachability
Feedback Loop from Navigation Result] I --> J{Has TurtleBot4 Reached Target?} J -->|No| F J -->|Yes| K[Log Metrics & Final Position
Store for Analysis] K --> L[Optimize Parameters
Update SLAM, TF, Nav Configs] L --> F

Finalized System & ROS 2 Architecture

Our ROS 2 Humble–based architecture ties together the ESP32 bridge, SLAM Toolbox, Nav2 controller, IMU filter, and data-logger into a unified navigation pipeline.

Project Architecture Flowchart

Topics & Data

TopicData
/rpi_07/mapOccupancy grid map generated from SLAM Toolbox
/rpi_07/scanRaw laser scan data from the LiDAR sensor
/rpi_07/waypointsWaypoint list used by navigate_through_poses
/rpi_07/navigate_to_pose/_action/feedbackNavigation action feedback (distance remaining, etc.)
/rpi_07/navigate_to_pose/_action/statusNavigation goal status (e.g., succeeded, aborted)
/rpi_07/navigate_through_poses/_action/feedbackFeedback for multi-goal navigation
/rpi_07/tf, /rpi_07/tf_staticTransform messages for frame tracking
/rpi_07/global_costmap/costmap, /local_costmapRepresents global and local planning costmaps
/rpi_07/goal_poseFinal goal sent by ESP32 or UI to initiate navigation

Nodes & Descriptions

Node NameDescription
/rpi_07/slam_toolboxReal-time SLAM mapping using LiDAR and odometry data
/rpi_07/obstacle_avoidProcesses LiDAR data to avoid collisions
/rpi_07/navigate_to_poseNav2 action server for navigation to a single goal
/rpi_07/navigate_through_posesNav2 action server for sequential waypoint navigation
/rpi_07/transform_listener_impl_*Listens to TF tree transformations
/rpi_07/rviz2RViz2 visualization of robot state and map
/rpi_07/controller_server, /behavior_server, /planner_serverNav2 core modules for planning and control
/rpi_07/lifecycle_manager_navigationManages lifecycle transitions of navigation nodes

RQt Visualizations

SLAM Toolbox RQt Overview
SLAM Toolbox RQt Overview
Goal Autonomy RQt Metrics
Goal Autonomy RQt Metrics

⚙ System Constraints and Practical Trade-offs

Final Demonstration Plan

Setup: TurtleBot in indoor arena; ESP32 sends target & heading to Pi.

Execution: Pi maps environment, plans path, TurtleBot navigates while GUI displays live data.

Metrics:

  • Goal-reaching accuracy
  • Map quality
  • Obstacle avoidance
  • GUI latency

Testing & Evaluation Plan

1. Unit Testing

  • ESP32 IMU transmission
  • ROS 2 topic publishing
  • Nav2 local planner

2. Integration Testing

  • Live sensor path planning
  • Reaction to goal updates
  • 3. Error Handling

    • ESP32 dropout recovery
    • Navigation collision recovery

    4. Performance Metrics

    • Distance error
    • Completion time
    • Obstacle handling success

Project Impact

This project demonstrates how low-cost autonomous robots can be enhanced through ROS 2–based multi-sensor fusion and decentralized coordination using microcontrollers. By integrating LiDAR, camera, IMU, and wireless goal delivery, we lay the groundwork for reliable indoor navigation on affordable hardware. Potential applications include assistive robots for elderly care, automated inventory transport in warehouses, and hands-on robotics education platforms.

Advising & Resource Needs

Advisor: Prof. Daniel M. Aukes
Prof. Aukes brings deep expertise in SLAM, multi-robot coordination, and real-world system deployment. He will guide our technical design, help troubleshoot integration challenges, and advise on tuning SLAM and Nav2 parameters. Through his lab, we will access high-precision sensors and test facilities, and his industry connections may assist in securing additional funding and hardware resources. His mentorship is vital for ensuring our system meets state-of-the-art performance and remains aligned with current robotics research.