AI Engineer - Learn how to integrate AI into software applications
Save 40% on 3 months of Coursera Plus
Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to implement ROS 2 services using Python in this hands-on tutorial that explores the request/response communication model essential for robotic applications. Discover the fundamental differences between topics and services in ROS 2, understanding when to use synchronous service calls versus asynchronous topic broadcasting for different robotic tasks. Build a complete service server node using the rclpy library that listens for integer addition requests and responds with calculated results, implementing proper callback handling and debugging through logging. Create a service client node that generates random integers and communicates with the server using asynchronous programming techniques including call_async(), add_done_callback(), and Future objects for efficient response handling. Master the AddTwoInts example interface from example_interfaces to understand how ROS 2 services use well-defined request and response formats for reliable communication between nodes. Practice using Docker containers and ROS 2 CLI tools to build, run, and test your service implementations in a controlled development environment. Explore command-line tools and the rqt GUI for service introspection, testing, and debugging to ensure your robotic communication systems work correctly. Gain practical experience with synchronous communication patterns that are ideal for sending commands, retrieving one-time information, and coordinating actions between different components of your robotic system.
Syllabus
0:00 Intro
0:58 ROS Service Fundamentals
2:06 Writing a Service in Python
8:49 Testing the Service
12:30 Writing a Client in Python
18:55 Testing the Client
19:59 Conclusion
Taught by
Digi-Key