From f46e119b2e4753ebc01c98a232fd6ff70cb08cbb Mon Sep 17 00:00:00 2001 From: Martin Dahl Date: Thu, 6 May 2021 22:16:20 +0200 Subject: [PATCH] Clearer env var name, version bumps, and updated readme --- Cargo.toml | 12 ++++++------ README.md | 2 ++ build.rs | 2 +- common/Cargo.toml | 3 +-- msg_gen/Cargo.toml | 10 +++++----- msg_gen/build.rs | 2 +- rcl/Cargo.toml | 4 ++-- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e272df4..802b397 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "r2r" -version = "0.0.5" +version = "0.0.6" authors = ["Martin Dahl "] description = "Minimal ros2 bindings." license = "Apache-2.0/MIT" @@ -13,15 +13,15 @@ serde_json = "1.0.62" failure = "0.1.8" failure_derive = "0.1.8" lazy_static = "1.4.0" -common = { path = "common", version = "0.0.2" } -rcl = { path = "rcl", version = "0.0.2" } -msg_gen = { path = "msg_gen", version = "0.0.2" } +common = { path = "common", version = "0.0.3" } +rcl = { path = "rcl", version = "0.0.3" } +msg_gen = { path = "msg_gen", version = "0.0.3" } [dev-dependencies] serde_json = "1.0.62" [build-dependencies] -common = { path = "common", version = "0.0.2" } -msg_gen = { path = "msg_gen", version = "0.0.2" } +common = { path = "common", version = "0.0.3" } +msg_gen = { path = "msg_gen", version = "0.0.3" } [workspace] diff --git a/README.md b/README.md index 753a07c..605de7f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ R2R - Minimal ROS2 Rust bindings Minimal bindings for ROS2 that do *not* require hooking in to the ROS2 build infrastructure. If you want a more ROS-oriented approach, see . In these bindings, convenience Rust types are created by calling into the c introspection libraries to circumvent the .msg/.idl pipeline. The convenience types can be ignored when you need to trade convenience for performance, e.g. treating large chunks of data manually. +When integration with other ROS2 software is desired, instead of the default mode of r2r, which is to build bindings to RCL and messages depending on what is currently sourced, a CMakeLists.txt file can be used to limit the binding to only include specific dependencies. This is done through additional environment variables. See the minimal example at . + Manual is available on github pages How to use diff --git a/build.rs b/build.rs index 071c7ba..58b4901 100644 --- a/build.rs +++ b/build.rs @@ -10,7 +10,7 @@ fn main() { let msg_list = if let Some(cmake_includes) = env::var("CMAKE_INCLUDE_DIRS").ok() { let packages = cmake_includes.split(":").flat_map(|i| Path::new(i).parent()).collect::>(); - let deps = env::var("CMAKE_RECURSIVE_DEPENDENCIES").unwrap_or(String::default()); + let deps = env::var("CMAKE_IDL_PACKAGES").unwrap_or(String::default()); let deps = deps.split(":").collect::>(); let msgs = common::get_ros_msgs(&packages); common::parse_msgs(&msgs).into_iter() diff --git a/common/Cargo.toml b/common/Cargo.toml index a396e26..7b418dc 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,9 +1,8 @@ [package] name = "common" -version = "0.0.2" +version = "0.0.3" authors = ["Martin Dahl "] description = "Minimal ros2 bindings." license = "Apache-2.0/MIT" edition = "2018" - diff --git a/msg_gen/Cargo.toml b/msg_gen/Cargo.toml index 1e02dc4..fc3283d 100644 --- a/msg_gen/Cargo.toml +++ b/msg_gen/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "msg_gen" -version = "0.0.2" +version = "0.0.3" authors = ["Martin Dahl "] edition = "2018" [dependencies] lazy_static = "1.4.0" -rcl = { path = "../rcl", version = "0.0.2" } -common = { path = "../common", version = "0.0.2" } +rcl = { path = "../rcl", version = "0.0.3" } +common = { path = "../common", version = "0.0.3" } [build-dependencies] bindgen = "0.57.0" -rcl = { path = "../rcl", version = "0.0.2" } -common = { path = "../common", version = "0.0.2" } +rcl = { path = "../rcl", version = "0.0.3" } +common = { path = "../common", version = "0.0.3" } heck = "0.3.2" diff --git a/msg_gen/build.rs b/msg_gen/build.rs index ea1f387..eac2f77 100644 --- a/msg_gen/build.rs +++ b/msg_gen/build.rs @@ -16,7 +16,7 @@ fn main() { builder = builder.clang_arg(format!("-I{}", p)); println!("adding include path: {}", p); } - let deps = env::var("CMAKE_RECURSIVE_DEPENDENCIES").unwrap_or(String::default()); + let deps = env::var("CMAKE_IDL_PACKAGES").unwrap_or(String::default()); let deps = deps.split(":").collect::>(); let msgs = common::get_ros_msgs(&packages); common::parse_msgs(&msgs).into_iter() diff --git a/rcl/Cargo.toml b/rcl/Cargo.toml index c88719b..6e7009b 100644 --- a/rcl/Cargo.toml +++ b/rcl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rcl" -version = "0.0.2" +version = "0.0.3" authors = ["Martin Dahl "] edition = "2018" @@ -11,4 +11,4 @@ widestring = "0.4.3" [build-dependencies] bindgen = "0.57.0" itertools = "0.10.0" -common = { path = "../common", version = "0.0.2" } +common = { path = "../common", version = "0.0.3" }