Skip to content

This project demonstrates the implementation of a Micro-ROS subscriber on an ESP32. The ESP32 listens to the /led_control topic and controls an LED based on received messages. The project integrates ESP-IDF and Micro-ROS to enable communication between the ESP32 and a ROS 2 system.

Notifications You must be signed in to change notification settings

Chinmay-ESP/Sub-LED_IDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Micro-ROS LED Subscriber on ESP32

Overview

This project demonstrates the implementation of a Micro-ROS subscriber on an ESP32. The ESP32 subscribes to the /led_control topic and controls an LED based on the received messages.

Features

  • Implements a Micro-ROS subscriber to listen for LED control commands.
  • Uses urosHandler for managing Micro-ROS nodes and subscriptions.
  • Controls an LED using GPIO on the ESP32.
  • Compatible with the std_msgs/msg/Int32 message type.

Repository Structure

├── main.cpp             # Entry point for the Micro-ROS application
├── sim_sub.cpp          # Implements the subscriber functionality
├── sim_sub.hpp          # Header file for the subscriber class
├── urosHandler          # External repository for handling Micro-ROS elements

Dependencies

  • ESP-IDF (ESP32 Development Framework)
  • Micro-ROS (ROS2 client for microcontrollers)

Installation & Setup

  1. Clone this repository:
    git clone https://github.com/your-username/your-repository.git
    cd your-repository
  2. Initialize submodules:
    git submodule update --init --recursive
  3. Install ESP-IDF: Follow the official ESP-IDF installation guide.
  4. Set up Micro-ROS:
    idf.py menuconfig
    Configure Micro-ROS settings if required.

Building and Flashing

  1. Build the project:
    idf.py build
  2. Flash the firmware to ESP32:
    idf.py flash
  3. Monitor the serial output:
    idf.py monitor

Usage

  • The ESP32 subscribes to the /led_control topic.
  • Sending std_msgs/msg/Int32 messages with values:
    • 1 → Turns the LED ON
    • 0 → Turns the LED OFF
  • Example command to publish a message from ROS 2:
    ros2 topic pub /led_control std_msgs/msg/Int32 '{"data": 1}'

About

This project demonstrates the implementation of a Micro-ROS subscriber on an ESP32. The ESP32 listens to the /led_control topic and controls an LED based on received messages. The project integrates ESP-IDF and Micro-ROS to enable communication between the ESP32 and a ROS 2 system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published