Skip to content

Micro ROS demo using PlatformIO working on both STM32 and ESP32

License

Notifications You must be signed in to change notification settings

kaizoku-oh/pio-micro-ros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Micro-ROS on PlatformIO

GitHub release GitHub issues License: MIT


GitHub Build workflow status - nucleo_u575zi_q GitHub Build workflow status - esp32dev

🛠️ 0. Install OS dependencies

sudo apt install -y git cmake python3-pip

📦 1. Install micro-ros PlatformIO library

; Add these in platformio.ini
board_microros_distro = humble
board_microros_transport = serial
lib_deps =
    https://github.com/micro-ROS/micro_ros_platformio

🐋 2. Run micro-ros agent docker image for serial (UART/USB) transport

# Run Micro-ROS agent (humble) in a container with access to serial device
docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:humble serial --dev /dev/ttyACM0 -v6

🔌 Using multiple serial ports with the same agent

# Run Micro-ROS agent (humble) in a container with access to multiple serial devices
docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:humble multiserial --devs "/dev/ttyUSB0 /dev/ttyACM0" -v6

🐋 3. Run micro-ros agent docker image for WiFi (UDP) transport

# UDPv4 micro-ROS Agent
docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:humble udp4 --port 8888 -v6

🐳 4. Run ros2 docker image

# Run container in interactive mode
docker run -it --rm osrf/ros:humble-desktop

# Return a list of all the topics currently active in the system
ros2 topic list

# To see the data being published on a topic, use
ros2 topic echo /button

# To publish data onto a topic directly from the command line
ros2 topic pub /led std_msgs/UInt8 "data: 1" --once
ros2 topic pub /led std_msgs/UInt8 "data: 0" --once