ark::ros

Variables

Defined in “ark/ros/schema_protocol.hh”:

  • constexpr auto CDR_SCHEMA_PROTOCOL= “cdr”
    The schema protocol of ROS2 channels, whose schema is the .msg definition text.

Classes

  • ark::ros::BagReader
    This class allows you to read ROS ‘bag’ files and pull out various pieces of metadata and/or objects.

  • ark::ros::RosCommStage

  • ark::ros::RosmsgRegistry
    This registry allows you to access schema information for all of your rosmsg definitions, providing convenient accessors over the standard SchemaRegistry for ROS-specific types.

  • ark::ros::BagTopic
    Topic information, storing enough information about a connection to deserialize further.

  • ark::ros::BaggedObject
    A bagged object contains the raw data of the message, along with various pieces of topic information suitable for printing out.

  • ark::ros::ParsedRosmsgResult
    A result from parsing rosmsg (parse_rosmsg). See comments there for more details.

Functions

Declared in “ark/ros/ros2msg_parser.hh”:

  • ParsedRosmsgResult parse_ros2msg(const std::string & ros_type_name, const std::filesystem::path & file_path, const std::string_view & definition)
    Parses a ROS2 .msg definition (e.g. “sensor_msgs/msg/Imu”, with any === sub-definitions) into a schema registry. “File Path” is only used for error messages.

  • std::string ros2_type_to_schema_name(const std::string & ros_type_name)
    Converts a ROS2 type name (“sensor_msgs/msg/Imu”) into its schema registry name (“sensor_msgs::msg::Imu”).

Declared in “ark/ros/rosmsg_generator.hh”:

  • std::string generate_rosmsg_definition(const serialization::SchemaRegistry & registry, const std::string & root_type)
    Generate the rosmsg definition string for the type given schema registry. NOTE: This does not account for constants at this time.

  • std::string compute_rosmsg_md5_text(const serialization::SchemaRegistry & registry, const std::string & root_type)
    Generate the rosmsg md5sum string for the type given schema registry. NOTE: This does not account for constants at this time.

Declared in “ark/ros/rosmsg_helpers.hh”:

  • std::string ros_name_from_type_name(const std::string & type_name)
    Convert from an object type name (e.g. std_msgs::String) to the rosmsg name (std_msgs/String).

  • std::string type_name_from_ros_name(const std::string & ros_name)
    Convert from a rosmsg type name (e.g. std_msgs/String) to the object type name (std_msgs::String)

  • std::string remove_ros_package_from_ros_name(const std::string & name)
    Remove the ros package name from the given ros type name. e.g. ‘std_msgs/String’ -> ‘String’.

Declared in “ark/ros/rosmsg_parser.hh”:

  • std::string path_to_ros_type(const std::filesystem::path & path)
    Converts a path into a ROS type name, based on ROS conventions.

  • ParsedRosmsgResult parse_rosmsg(const std::filesystem::path & file_path, const std::string_view & definition)
    This API parses a single rosmsg message definition into a schema registry. Note that one rosmsg definition can contain multiple individual schemas (with the === separators), and this will return all of them.

    This is a convenience API, and will take the file path and derive a ROS type name from it. The first (primary) type will be returned as well.

  • ParsedRosmsgResult parse_rosmsg(const std::string & ros_type_name, const std::filesystem::path & file_path, const std::string_view & definition)
    This API parses a single rosmsg message definition into a schema registry. Note that one rosmsg definition can contain multiple individual schemas (with the === separators), and this will return all of them.

    “File Path” here is used for debugging (for outputting error messages). The first (primary) type will be returned as well.

Declared in “ark/ros/schema_protocol.hh”:

  • bool has_rbuf_schema_registry(const std::string & schema_protocol)
    Returns true if payloads of this schema protocol decode through an rbuf schema registry.

  • serialization::SchemaRegistry to_rbuf_schema_registry(const std::string & schema_protocol, const std::string & type_name, const std::string & schema_registry, const std::string & source)
    Builds the rbuf schema registry for a channel, parsing the .msg text for CDR. “Source” is used for errors.

  • std::string to_rbuf_type_name(const std::string & schema_protocol, const std::string & type_name)
    Returns the name of a channel’s type within its rbuf schema registry.

  • core::ByteBuffer json_to_cdr(const std::string & ros_type_name, const std::string & msg_definition, const serialization::JsonBlob & json)
    Encodes JSON as the CDR payload of a ROS2 message, given its type name (“std_msgs/msg/String”) and .msg text.