Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Introduction to ROS Part 12 - Talking to Microcontrollers

Digi-Key via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to bridge the gap between ROS 2 simulation and real-world robotics by integrating middleware with actual robot hardware in this comprehensive 30-minute tutorial. Discover why ROS 2 functions as middleware rather than including direct hardware control libraries, and understand the critical role of microcontrollers in handling time-sensitive tasks like PWM motor control and interrupt handling. Explore the architecture using a Raspberry Pi 4B running Ubuntu 24.04 and ROS 2 Jazzy as the high-level computer, paired with a Raspberry Pi RP2350-based controller on the XRP educational robotics platform for low-level motor control. Master setting up serial communication over USB, writing Arduino firmware to parse motor commands, and building Python ROS 2 nodes that send real-time commands to hardware. Understand practical considerations including Linux's non-deterministic scheduling limitations and why the SBC + MCU architecture scales effectively to complex robotic systems. Follow along with installing ROS 2 on Raspberry Pi, configuring SSH and VS Code for remote development, setting up Python virtual environments, and creating custom ROS 2 packages with colcon. Implement a driver node with a state machine that controls robot movement through serial commands, demonstrating clean separation between high-level ROS 2 logic and low-level hardware control. Advance to computer vision integration using OpenCV to create a vision node that tracks colored objects and publishes bounding box data, while a driver node subscribes to this data to steer the robot toward targets in real-time, showcasing ROS 2's power in combining perception, decision-making, and hardware control into scalable robotic systems.

Syllabus

Intro
Overview of the hardware
Writing the Arduino motor controller
Setting up ROS on the Raspberry Pi
Writing the ROS node
Running the simple ROS demo on real hardware
Ball tracking vision demo
Conclusion

Taught by

Digi-Key

Reviews

Start your review of Introduction to ROS Part 12 - Talking to Microcontrollers

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.