r2a 0.1.0

A Rust library provides a typesafe way to convert ROS2 messages into Apache Arrow format
docs.rs failed to build r2a-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: r2a-0.1.7

R2A - A Rust library provides a typesafe way to convert ROS2 messages into Apache Arrow format

The library is essentially a wrapper on top of the amazing R2R library. The two main components are r2a::ArrowSupport and r2a::RowBuilder.

This build was mainly tested with ROS2 Humble. I also tested it with Jazzy locally (by switching to the master branch r2r)

Install

cargo add r2a

Examples

use r2a::ArrowSupport;
use r2a::RowBuilder;

let fields = r2r::std_msgs::msg::Header::arrow_fields();
let mut row_builder = r2r::std_msgs::msg::Header::new_row_builder(fields.iter().collect()); //We keep all the fields, convert to Vec<&Field>

let my_message = r2r::std_msgs::msg::Header {
               stamp: r2r::builtin_interfaces::msg::Time {
                   sec: 0,
                   nanosec: 0,
               },
               frame_id: "test_frame".to_string(),
           };
row_builder.add_row(&my_message).unwrap();
let arrow_arrays = row_builder.to_arc_arrays();
// store arrow_arrays as Parquet, etc..

For more elaborate examples see the examples folder.