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
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/goalas ageometry_msgs/Point - Path and Map: SLAM-based mapping through
auto_map.launch.py, with the map saved viaauto_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.pynode continuously processes LiDAR data from/rpi_07/scanto 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.pyreceives 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
- Pub/Sub:
- ESP32 →
/esp32_07/goal - Odometry →
/rpi_07/odom, Localization →/rpi_07/amcl_pose - Velocity control →
/rpi_07/cmd_vel
- ESP32 →
- Action Server:
- Goal execution through
/rpi_07/navigate_to_poseusingesp32_goal.py
- Goal execution through
- 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)
- Mapping via
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.
Validation
- Console Echo: Verifying
/esp32_07/goalreception 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
- Goal markers visualized using RViz and
- 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_posealongside Nav2 planner metrics to evaluate localization accuracy, path planning efficiency, and trajectory smoothness.
- Position and path data can be logged via
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.pyfor 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
- IMU-Based Goal Publishing & Filtering: The ESP32 captures orientation data and publishes target positions to
/esp32_07/goalasgeometry_msgs/Pointmessages. A low-pass filter on the ESP32 side smooths out noise, ensuring only stable goal updates are transmitted. - LiDAR-Based Mapping & Odometry: TurtleBot 4 consumes LiDAR scans from
/rpi_07/scanvia SLAM Toolbox (launched inauto_map.launch.py), builds the map in real time, saves it withauto_save.py, and publishes odometry on/rpi_07/odom. - Filtering Strategy: Dual-layered filtering ensures robustness: on the ESP32, a low-pass filter smooths IMU-derived goals; on the TurtleBot, rapid successive goal updates are ignored so the robot commits to one stable goal per session.
- Comparative Analysis & Visualization:
- Console Monitoring of
/esp32_07/goalto verify stability. - RViz display of
/rpi_07/amcl_pose,/rpi_07/odom, and goal markers for real-time feedback. - Trajectory logging to analyze convergence and obstacle avoidance.
- Optional graphing of position and path data to evaluate localization accuracy and planning efficiency.
- Console Monitoring of
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
- Goal Accuracy: % of trials where the TurtleBot stops within 0.2 m of the target.
- Map Consistency: Overlay successive maps to quantify drift.
- Latency: Time from ESP32 goal publish to first motion command.
- Path Efficiency: Ratio of actual path length vs. optimal distance.
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.
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.
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.
Topics & Data
| Topic | Data |
|---|---|
/rpi_07/map | Occupancy grid map generated from SLAM Toolbox |
/rpi_07/scan | Raw laser scan data from the LiDAR sensor |
/rpi_07/waypoints | Waypoint list used by navigate_through_poses |
/rpi_07/navigate_to_pose/_action/feedback | Navigation action feedback (distance remaining, etc.) |
/rpi_07/navigate_to_pose/_action/status | Navigation goal status (e.g., succeeded, aborted) |
/rpi_07/navigate_through_poses/_action/feedback | Feedback for multi-goal navigation |
/rpi_07/tf, /rpi_07/tf_static | Transform messages for frame tracking |
/rpi_07/global_costmap/costmap, /local_costmap | Represents global and local planning costmaps |
/rpi_07/goal_pose | Final goal sent by ESP32 or UI to initiate navigation |
Nodes & Descriptions
| Node Name | Description |
|---|---|
/rpi_07/slam_toolbox | Real-time SLAM mapping using LiDAR and odometry data |
/rpi_07/obstacle_avoid | Processes LiDAR data to avoid collisions |
/rpi_07/navigate_to_pose | Nav2 action server for navigation to a single goal |
/rpi_07/navigate_through_poses | Nav2 action server for sequential waypoint navigation |
/rpi_07/transform_listener_impl_* | Listens to TF tree transformations |
/rpi_07/rviz2 | RViz2 visualization of robot state and map |
/rpi_07/controller_server, /behavior_server, /planner_server | Nav2 core modules for planning and control |
/rpi_07/lifecycle_manager_navigation | Manages lifecycle transitions of navigation nodes |
⚙ System Constraints and Practical Trade-offs
-
Hardware Limitations (TurtleBot4 Raspberry Pi):
The onboard Raspberry Pi has limited CPU and memory, which cannot handle SLAM, RViz, and real-time navigation reliably.
Mitigation: Offloaded all ROS 2 processing (Nav2, SLAM Toolbox, RViz) to a powerful external VM via network connection.
-
Sensor Accuracy (ESP32 IMU):
The ESP32 IMU provides noisy positional estimates, lacking consistent global frame accuracy or drift correction.
Mitigation: Used IMU only for static goal publishing, not continuous motion control. Applied soft filtering to suppress jitter.
-
Localization Requirement:
AMCL requires the robot's initial pose to be manually set after map load. Autonomous re-localization is not supported at boot time.
Mitigation: Manual RViz initialization was performed after loading the map via
navigation_with_local.launch.py. -
Single Goal Execution:
The navigation stack accepts one goal at a time. Frequent updates from ESP32 could overload or confuse the planner.
Mitigation: Designed system to send the goal only once per session (or after timeout) to reduce conflicts.
-
Real-Time Serial Communication:
Serial reading from ESP32 is synchronous and may block if data is malformed or delayed.
Mitigation: Implemented error handling and pattern matching (regex) to safely skip malformed data in
esp32_07_imu.py.
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 >
- ESP32 dropout recovery
- Navigation collision recovery
- Distance error
- Completion time
- Obstacle handling success
3. Error Handling
4. Performance Metrics
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.