This repository contains three micro-ROS-enabled Arduino/ESP32 projects for robotics applications:
- bot_control_twist_microros: Differential drive robot controller with PID motor control and ROS2 Twist command subscription.
- imu_microros: Publishes IMU sensor data to ROS2 using micro-ROS.
- oled_text_microros: Displays ROS2 String messages on an OLED screen.
Implements a differential drive robot controller. Receives velocity commands (geometry_msgs/msg/Twist) via micro-ROS, computes wheel speeds, and controls two DC motors with PID feedback and encoder support.
bot_control_twist.ino: Main Arduino sketch, ROS2 setup, and control loop.DeffBot.h/DeffBot.cpp: Differential drive robot logic.motorController.h/motorController.cpp: Motor control with PID and encoder feedback.PID.h/PID.cpp: Simple PID controller.
- Differential drive kinematics
- PID speed control for each motor
- Quadrature encoder support
- micro-ROS WiFi integration
Reads data from an LSM6 IMU sensor and publishes it as sensor_msgs/msg/Imu messages to ROS2 via micro-ROS.
IMU_MICROROS.ino: Reads IMU, formats ROS2 messages, and publishes over WiFi.
Subscribes to a ROS2 topic and displays incoming std_msgs/msg/String messages on an SSD1306 OLED display.
OLED_MICRO_ROS.ino: Sets up OLED, subscribes to ROS2, and displays messages.
- ESP32 or compatible Arduino board
- DC motors with encoders (for bot_control_twist_microros)
- Motor driver (H-bridge)
- LSM6 IMU sensor (for imu_microros)
- SSD1306 OLED display (for oled_text_microros)
- WiFi network
- Arduino IDE
- micro-ROS Arduino library
- ESP32 board support for Arduino
-
Update WiFi Credentials
Edit the.inofiles and set your WiFi SSID, password, and micro-ROS agent IP address. -
Wiring
Connect your hardware according to your setup. Update pin assignments in the code as needed. -
Build and Upload
Open the desired.inofile in Arduino IDE, select your board, and upload.
This project is for educational and research purposes.