Function rclcpp::extract_type_identifier

Function Documentation

std::tuple<std::string, std::string, std::string> rclcpp::extract_type_identifier(const std::string &full_type)

Extract the package name, middle module, and type name from a full type string.

This function takes a full type string (e.g., “std_msgs/msg/String”) and extracts the package name, middle module (if any), and type name. The middle module is the part between the package name and the type name, which is typically used for message types. For example, for “std_msgs/msg/String”, it returns (“std_msgs”, “msg”, “String”).

Parameters:

full_type[in]

Throws:

std::runtime_error – if the input full type string is malformed or does not follow the expected format.

Returns:

A tuple containing the package name, middle module (if any), and type name.