Skip to content

Commit

Permalink
use workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
stelzo committed May 16, 2024
1 parent 8696830 commit ed0c08a
Show file tree
Hide file tree
Showing 38 changed files with 107 additions and 673 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/crates.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/r2r_galactic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build . --file ./tests/Dockerfile_r2r_galactic --tag r2r_galactic
- run: docker build . --file ./rpcl2/tests/Dockerfile_r2r_galactic --tag r2r_galactic
- run: docker run r2r_galactic cargo test --features r2r_msg,derive,nalgebra,rayon
2 changes: 1 addition & 1 deletion .github/workflows/r2r_humble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build . --file ./tests/Dockerfile_r2r_humble --tag r2r_humble
- run: docker build . --file ./rpcl2/tests/Dockerfile_r2r_humble --tag r2r_humble
- run: docker run r2r_humble cargo test --features r2r_msg,derive,nalgebra,rayon
2 changes: 1 addition & 1 deletion .github/workflows/r2r_iron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build . --file ./tests/Dockerfile_r2r_iron --tag r2r_iron
- run: docker build . --file ./rpcl2/tests/Dockerfile_r2r_iron --tag r2r_iron
- run: docker run r2r_iron cargo test --features r2r_msg,derive,nalgebra,rayon
2 changes: 1 addition & 1 deletion .github/workflows/rclrs_humble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build . --file ./tests/Dockerfile_rclrs_humble --tag rclrs_humble
- run: docker build . --file ./rpcl2/tests/Dockerfile_rclrs_humble --tag rclrs_humble
- run: docker run rclrs_humble cargo test --features derive,nalgebra,rayon
2 changes: 1 addition & 1 deletion .github/workflows/rclrs_iron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build . --file ./tests/Dockerfile_rclrs_iron --tag rclrs_iron
- run: docker build . --file ./rpcl2/tests/Dockerfile_rclrs_iron --tag rclrs_iron
- run: docker run rclrs_iron cargo test --features derive,nalgebra,rayon
64 changes: 3 additions & 61 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,63 +1,5 @@
[package]
name = "ros_pointcloud2"
version = "0.5.0-rc.1"
edition = "2021"
authors = ["Christopher Sieh <stelzo@steado.de>"]
description = "Customizable conversions for working with sensor_msgs/PointCloud2."
repository = "https://github.com/stelzo/ros_pointcloud2"
license = "MIT OR Apache-2.0"
keywords = ["ros", "pointcloud2", "pointcloud", "message"]
categories = [
"science::robotics",
"encoding",
"data-structures",
"api-bindings",
]
readme = "README.md"
documentation = "https://docs.rs/ros_pointcloud2"
homepage = "https://github.com/stelzo/ros_pointcloud2"
exclude = [
"**/.github/**",
"**/tests/**",
"**/examples/**",
"**/benches/**",
"**/target/**",
"**/build/**",
"**/dist/**",
"**/docs/**",
"**/doc/**",
]
rust-version = "1.63"
[workspace]

[dependencies]
rosrust_msg = { version = "0.1", optional = true }
rosrust = { version = "0.9.11", optional = true }
r2r = { version = "0.8.4", optional = true }
rayon = { version = "1", optional = true }
nalgebra = { version = "0.32.5", optional = true, default-features = false }
rpcl2_derive = { path = "rpcl2_derive", optional = true }
type-layout = { path = "type-layout", optional = true }

[dev-dependencies]
rand = "0.8"
criterion = { version = "0.5", features = ["html_reports"] }

[[bench]]
name = "roundtrip"
harness = false

[features]
rosrust_msg = ["dep:rosrust_msg", "dep:rosrust"]
r2r_msg = ["dep:r2r"]
rayon = ["dep:rayon"]
derive = ["dep:rpcl2_derive", "dep:type-layout"]
nalgebra = ["dep:nalgebra"]
std = ["nalgebra/std"]

default = ["std", "derive"]

[package.metadata.docs.rs]
features = ["derive", "nalgebra", "rayon"]
default-target = "x86_64-unknown-linux-gnu"
rustdoc-args = ["--cfg", "docsrs"]
members = ["rpcl2", "rpcl2-derive"]

resolver = "2"
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ Licensed under either of

at your option.

### type-layout

For compatibility reasons, a patched version of `type-layout` is included in this repository. The original crate can be found [here](https://crates.io/crates/type-layout). After the patch is applied on the original `type-layout` crate ([PR](https://github.com/LPGhatguy/type-layout/pull/9)), the local dependency will be changed to the original crate.

`type-layout` is licensed under MIT or Apache-2.0 and Copyright by Lucien Greathouse. The changes are highlighted in the diff of the PR.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
24 changes: 24 additions & 0 deletions rpcl2-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "rpcl2-derive"
description = "Derive macros for ros_pointcloud2 crate."
version = "0.1.0"
edition = "2021"
authors = ["Christopher Sieh <stelzo@steado.de>"]
homepage = "https://github.com/stelzo/ros_pointcloud2"
license = "MIT OR Apache-2.0"
keywords = ["ros", "pointcloud2", "ros_pointcloud2"]
categories = [
"science::robotics",
"encoding",
"data-structures",
"api-bindings",
]
repository = "https://github.com/stelzo/ros_pointcloud2"

[lib]
proc-macro = true

[dependencies]
syn = "2.0"
quote = "1.0"
proc-macro2 = "1.0"
8 changes: 8 additions & 0 deletions rpcl2-derive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<p align="center">
<h3 align="center">ROS PointCloud2</h3>
<p align="center">Derive macros for the ros_pointcloud2 library.</p>
<p align="center"><a href="https://crates.io/crates/ros_pointcloud2"><img src="https://img.shields.io/crates/v/ros_pointcloud2.svg" alt=""></a> <a href="https://github.com/stelzo/ros_pointcloud2/tree/main/tests"><img src="https://github.com/stelzo/ros_pointcloud2/actions/workflows/tests.yml/badge.svg" alt=""></a>
</p>
</p>

This crate should be used in combination with the `ros_pointcloud2` crate.
9 changes: 4 additions & 5 deletions rpcl2_derive/src/lib.rs → rpcl2-derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! This crate provides macros for `ros_pointcloud2` and should be used in combination with said crate.
extern crate proc_macro;

use std::collections::HashMap;
Expand Down Expand Up @@ -30,7 +31,7 @@ fn struct_field_rename_array(input: &DeriveInput) -> Vec<String> {

let mut field_names = Vec::with_capacity(fields.len());
for f in fields.iter() {
if f.attrs.len() == 0 {
if f.attrs.is_empty() {
field_names.push(f.ident.as_ref().unwrap().to_token_stream().to_string());
} else {
f.attrs.iter().for_each(|attr| {
Expand Down Expand Up @@ -186,12 +187,10 @@ pub fn ros_point_derive(input: TokenStream) -> TokenStream {
impl ros_pointcloud2::PointConvertible<#field_len_token> for #name {}
};

let out = TokenStream::from(quote! {
TokenStream::from(quote! {
#field_impl
#from_my_point
#from_custom_point
#convertible
});

TokenStream::from(out)
})
}
63 changes: 63 additions & 0 deletions rpcl2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[package]
name = "ros_pointcloud2"
version = "0.5.0-rc.1"
edition = "2021"
authors = ["Christopher Sieh <stelzo@steado.de>"]
description = "Customizable conversions for working with sensor_msgs/PointCloud2."
repository = "https://github.com/stelzo/ros_pointcloud2"
license = "MIT OR Apache-2.0"
keywords = ["ros", "pointcloud2", "pointcloud", "message"]
categories = [
"science::robotics",
"encoding",
"data-structures",
"api-bindings",
]
readme = "README.md"
documentation = "https://docs.rs/ros_pointcloud2"
homepage = "https://github.com/stelzo/ros_pointcloud2"
exclude = [
"**/.github/**",
"**/tests/**",
"**/examples/**",
"**/benches/**",
"**/target/**",
"**/build/**",
"**/dist/**",
"**/docs/**",
"**/doc/**",
]
rust-version = "1.63"

[dependencies]
rosrust_msg = { version = "0.1", optional = true }
rosrust = { version = "0.9.11", optional = true }
r2r = { version = "0.8.4", optional = true }
rayon = { version = "1", optional = true }
nalgebra = { version = "0.32.5", optional = true, default-features = false }
type-layout = { version = "0.2.0", package = "type-layout-syn2", optional = true }
rpcl2-derive = { version = "0.1.0", optional = true, path = "../rpcl2-derive" }

[dev-dependencies]
rand = "0.8"
criterion = { version = "0.5", features = ["html_reports"] }

[[bench]]
name = "roundtrip"
harness = false
path = "benches/roundtrip.rs"

[features]
rosrust_msg = ["dep:rosrust_msg", "dep:rosrust"]
r2r_msg = ["dep:r2r"]
rayon = ["dep:rayon"]
derive = ["dep:rpcl2-derive", "dep:type-layout"]
nalgebra = ["dep:nalgebra"]
std = ["nalgebra/std"]

default = ["std", "derive"]

[package.metadata.docs.rs]
features = ["derive", "nalgebra", "rayon"]
default-target = "x86_64-unknown-linux-gnu"
rustdoc-args = ["--cfg", "docsrs"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions rpcl2_derive/Cargo.toml

This file was deleted.

27 changes: 0 additions & 27 deletions type-layout/Cargo.toml

This file was deleted.

Loading

0 comments on commit ed0c08a

Please sign in to comment.