Power BI Fundamentals - Create visualizations and dashboards from scratch
Our career paths help you become job ready faster
Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to build and run publisher and subscriber nodes in ROS 2 using C++ in this hands-on tutorial that demonstrates leveraging the rclcpp API for high-performance robotics applications. Explore the advantages and trade-offs between Python and C++ in the ROS 2 ecosystem, understanding how Python excels at rapid prototyping and AI integration while C++ offers superior runtime performance and deterministic behavior for real-time and embedded systems. Create a new ROS 2 package from scratch and master dependency management with ament_cmake, learning to properly configure CMakeLists.txt and package.xml files for successful compilation. Implement a minimal publisher that sends messages over topics using smart pointers and timers for regular message intervals, then build your workspace using colcon and test functionality with ros2 CLI tools. Develop a subscriber node that listens to topics and logs incoming messages, utilizing lambda functions and std::bind for callback connections while visualizing topic communication through rqt_graph. Discover ROS 2's cross-language interoperability by swapping C++ and Python nodes seamlessly, demonstrating how both languages can communicate through shared topics in the same system. Follow step-by-step instructions to write, compile, and execute both publisher and subscriber nodes, gaining practical experience with C++ development patterns specific to robotics applications. Access accompanying written guides, GitHub repositories with Docker images, and example code to reinforce learning and provide additional context for building modular and efficient ROS 2 applications.
Syllabus
0:00 Intro
0:41 Python vs. C++ for ROS
2:26 Creating a ROS Package for C++
7:17 Writing a Publisher in C++
19:08 Testing the Publisher
24:33 Writing a Subscriber in Python
31:27 Testing the Subscriber
34:57 Conclusion
Taught by
Digi-Key