{"id":28164317,"url":"https://github.com/mgonzs13/esp32_ros","last_synced_at":"2025-05-15T11:17:48.328Z","repository":{"id":273675317,"uuid":"919727678","full_name":"mgonzs13/esp32_ros","owner":"mgonzs13","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-22T09:38:45.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T10:28:46.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgonzs13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-20T22:34:55.000Z","updated_at":"2025-01-22T09:38:48.000Z","dependencies_parsed_at":"2025-01-22T10:39:04.708Z","dependency_job_id":null,"html_url":"https://github.com/mgonzs13/esp32_ros","commit_stats":null,"previous_names":["mgonzs13/esp32_ros"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgonzs13%2Fesp32_ros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgonzs13%2Fesp32_ros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgonzs13%2Fesp32_ros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgonzs13%2Fesp32_ros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgonzs13","download_url":"https://codeload.github.com/mgonzs13/esp32_ros/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328342,"owners_count":22052635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-15T11:17:44.375Z","updated_at":"2025-05-15T11:17:48.307Z","avatar_url":"https://github.com/mgonzs13.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp32_ros\n\nThis repository demonstrates a simple use case of **micro-ROS** with an ESP32 board (specifically the ESP32-S3) to publish Wi-Fi scan data. Additionally, it provides a service to control the board's LED.\n\n## Installation and Usage\n\n### 1. Install micro-ROS Setup and Agent\n\nFollow the [official micro-ROS installation guide](https://micro.ros.org/docs/tutorials/core/first_application_linux/) to set up micro-ROS. Below is a summary of the steps:\n\n```bash\n# Source the ROS 2 installation\nsource /opt/ros/$ROS_DISTRO/setup.bash\n\n# Create a workspace and download the micro-ROS tools\nmkdir microros_ws\ncd microros_ws\ngit clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup\n\n# Update dependencies using rosdep and pip\nsudo apt update \u0026\u0026 rosdep update\nrosdep install --from-paths src --ignore-src -y\nsudo apt-get install python3-pip\n\n# Build micro-ROS tools and source them\ncolcon build\nsource install/local_setup.bash\n\n# Download micro-ROS-Agent packages\nros2 run micro_ros_setup create_agent_ws.sh\nros2 run micro_ros_setup build_agent.sh\nsource install/local_setup.bash\n```\n\n### 2. Install the Arduino IDE\n\nInstall the Arduino IDE using the following commands:\n\n```bash\nsudo apt install flatpak -y\nsudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo\nflatpak install flathub cc.arduino.arduinoide -y\n```\n\n### 3. Prepare micro-ROS for Arduino\n\n1. Download the [micro_ros_arduino](https://github.com/micro-ROS/micro_ros_arduino/releases/tag/v2.0.7-humble) library and place it in `~/Arduino/libraries`.\n2. Create custom interfaces for the `esp32_msgs` package:\n\n```bash\n# Copy the message package to the extra_packages directory\ncp -r esp32_msgs ~/Arduino/libraries/micro_ros_arduino/extras/library_generation/extra_packages\n\n# Modify the colcon.meta file to use the parameter server in micro_ros_arduino\n# You have to increase the max services to 6\n# Take a look at the provided colcon.meta file in this repository\nnano ~/Arduino/libraries/micro_ros_arduino/extras/library_generation/colcon.meta\n\n# Create the code for Arduino\ncd ~/Arduino/libraries/micro_ros_arduino\ndocker run -it --rm -v $(pwd):/project --env MICROROS_LIBRARY_FOLDER=extras microros/micro_ros_static_library_builder:humble\n\n# Optional: Copy the ESP32 library for the ESP32-S3 board\ncd ~/Arduino/libraries/micro_ros_arduino/src\ncp -r esp32 esp32s3\n```\n\n### 4. Configure the Arduino IDE\n\n1. Open the Arduino IDE.\n2. Install the **Adafruit_NeoPixel** library via `Tools \u003e Manage Libraries`.\n3. Install the **ESP32 board support package** via `Tools \u003e Board \u003e Board Manager`.\n4. Select the correct port (`/dev/ttyACM0`) and the board (`ESP32S3 DEV Module`).\n\n### 5. Load the Code and Run the micro-ROS Agent\n\n1. Load the code from the `esp32_node` directory onto the ESP32 board using the Arduino IDE.\n2. Start the micro-ROS agent:\n\n```bash\nros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0\n```\n\n### 6. Verify the Setup\n\n- Check the `/wifi_scan` topic:\n\n```bash\nros2 topic echo /wifi_scan\n```\n\n- Test the `/set_led_color` service:\n\n```bash\nros2 service call /set_led_color esp32_msgs/srv/SetLedColor \"{'color': {'r': 1, 'g': 0, 'b': 1}}\"\n```\n\n## Additional Notes\n\n- The `esp32_msgs` package defines the custom message and service types used in this project.\n- Ensure all dependencies are properly installed to avoid build or runtime issues.\n\n---\n\nThis project showcases the seamless integration of an ESP32-S3 board with ROS 2 using micro-ROS, providing an excellent starting point for robotics projects requiring lightweight and efficient communication between devices.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgonzs13%2Fesp32_ros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgonzs13%2Fesp32_ros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgonzs13%2Fesp32_ros/lists"}