ROS Client Library (rclcpp / rclpy)
ROS 客户端库RCLAdvancedThe programming API used to write ROS nodes — rclcpp for C++, rclpy for Python.
A client library is the API developers call directly when writing ROS programs — creating nodes, publishing and subscribing to topics, calling services, reading parameters, and so on. In the ROS 1 era, the main client libraries were roscpp (C++) and rospy (Python). ROS 2 switched to a layered design: at the bottom is rcl, a general-purpose library written in C, on top of which each language gets its own wrapper — the official ones are rclcpp for C++ and rclpy for Python, with community-maintained versions for Rust, Java, and others. This means the communication logic only has to be written once, and behavior stays consistent across languages. In general, control nodes with strict real-time requirements tend to use rclcpp, while rapid prototyping and hooking up deep learning models tend to use rclpy.
ExampleIn Python, import rclpy, subclass rclpy.node.Node to write a node, subscribe to a camera topic, and feed the images into a VLA model for inference.
- Also called
- rcl, rclcpp, rclpy, rospy, roscpp
- Related
- Robot Operating System 2 · Robot Operating System · Node (ROS) · ROS Middleware Interface (RMW) · ROS 2 Executor & Callback Groups · Python and C++
- Sources
- ROS 2 Documentation: Client libraries