fix build and tests

This commit is contained in:
stelzo 2025-02-01 21:38:16 +01:00
parent 54c5e8f6bb
commit 506ff826a3
16 changed files with 33 additions and 17 deletions

View File

@ -18,9 +18,9 @@ jobs:
with:
components: clippy
- name: Linting
run: cargo clippy --all-targets --features derive,nalgebra,rayon -- -D warnings
run: cargo clippy --all-targets --features derive,nalgebra,rayon,serde -- -D warnings
- name: Tests
run: cargo test --features derive,nalgebra,rayon
run: cargo test --features derive,nalgebra,rayon,serde
outdated:
name: Outdated

View File

@ -18,4 +18,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- 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
- run: docker run r2r_galactic cargo test --features r2r_msg,derive,nalgebra,rayon,serde

View File

@ -18,4 +18,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- 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
- run: docker run r2r_humble cargo test --features r2r_msg,derive,nalgebra,rayon,serde

View File

@ -18,4 +18,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- 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
- run: docker run r2r_iron cargo test --features r2r_msg,derive,nalgebra,rayon,serde

View File

@ -18,4 +18,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: docker build . --file ./rpcl2/tests/Dockerfile_r2r_jazzy --tag r2r_jazzy
- run: docker run r2r_jazzy cargo test --features r2r_msg,derive,nalgebra,rayon
- run: docker run r2r_jazzy cargo test --features r2r_msg,derive,nalgebra,rayon,serde

View File

@ -18,4 +18,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: docker build . --file ./rpcl2/tests/Dockerfile_rclrs_humble --tag rclrs_humble
- run: docker run rclrs_humble cargo test --features derive,nalgebra,rayon
- run: docker run rclrs_humble cargo test --features derive,nalgebra,rayon,serde

View File

@ -18,4 +18,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: docker build . --file ./rpcl2/tests/Dockerfile_rclrs_iron --tag rclrs_iron
- run: docker run rclrs_iron cargo test --features derive,nalgebra,rayon
- run: docker run rclrs_iron cargo test --features derive,nalgebra,rayon,serde

View File

@ -18,4 +18,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: docker build . --file ./rpcl2/tests/Dockerfile_rclrs_jazzy --tag rclrs_jazzy
- run: docker run rclrs_jazzy cargo test --features derive,nalgebra,rayon
- run: docker run rclrs_jazzy cargo test --features derive,nalgebra,rayon,serde

View File

@ -105,4 +105,4 @@ jobs:
- name: test
run: |
source /opt/ros/$ROS_DISTRO/setup.bash
cargo test --features rosrust_msg,derive,nalgebra,rayon
cargo test --features rosrust_msg,derive,nalgebra,rayon,serde

View File

@ -21,8 +21,8 @@ jobs:
with:
components: clippy
- name: Linting
run: cargo clippy --all-targets --features derive,nalgebra,rayon -- -D warnings
run: cargo clippy --all-targets --features derive,nalgebra,rayon,serde -- -D warnings
- name: Build examples with features
run: cargo build --examples --features derive,nalgebra,rayon
run: cargo build --examples --features derive,nalgebra,rayon,serde
- name: Test library
run: cargo test --features derive,nalgebra,rayon
run: cargo test --features derive,nalgebra,rayon,serde

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
Cargo.lock
Cargo.lock*
.idea/
target/

View File

@ -5,6 +5,15 @@
</p>
</p>
> [!IMPORTANT]
> The optional rosrust dependency currently breaks the build of this crate because of a yanked transitive dependency on crates.io.
> Use [this workaround](https://github.com/adnanademovic/rosrust/issues/210#issuecomment-2609494830) in your project when rosrust is needed.
> If you are not using rosrust at all, you can also use the main branch of this repository, where the integration is removed at the moment.
> ```toml
> [dependencies]
> ros_pointcloud2 = { version = "0.5.2", git = "https://github.com/stelzo/ros_pointcloud2.git" }
> ```
ros_pointcloud2 uses its own type for the message `PointCloud2Msg` to keep the library framework agnostic. ROS1 and ROS2 are supported with feature flags.
Get started with the example below, check out the other use cases in the `examples` folder or see the [Documentation](https://docs.rs/ros_pointcloud2/0.5.1/) for a complete guide.

View File

@ -17,3 +17,7 @@ categories = [
[dependencies]
ros_pointcloud2 = { path = "../rpcl2", features = ["std", "derive"] }
rpcl2-derive = { path = "../rpcl2-derive" }
[patch.crates-io]
# Fixes https://github.com/adnanademovic/rosrust/issues/210
xml-rpc = { git = "https://github.com/locusrobotics/xml-rpc-rs", branch = "minimum-update" }

View File

@ -31,8 +31,8 @@ exclude = [
rust-version = "1.77"
[dependencies]
rosrust_msg = { version = "0.1", optional = true }
rosrust = { version = "0.9.11", optional = true }
#rosrust_msg = { version = "0.1", optional = true }
#rosrust = { version = "0.9.11", optional = true }
r2r = { version = "0.9", optional = true }
rayon = { version = "1", optional = true }
nalgebra = { version = "0.33", optional = true, default-features = false }
@ -51,7 +51,7 @@ path = "benches/roundtrip.rs"
[features]
serde = ["dep:serde", "nalgebra/serde-serialize-no-std"]
rosrust_msg = ["dep:rosrust_msg", "dep:rosrust"]
#rosrust_msg = ["dep:rosrust_msg"]
r2r_msg = ["dep:r2r"]
rayon = ["dep:rayon"]
derive = ["dep:rpcl2-derive"]

View File

@ -139,6 +139,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
// Setup an allocator with #[global_allocator]
// see: https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html
#![allow(unexpected_cfgs)]
pub mod points;
pub mod prelude;

View File

@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)] // TODO remove when rosrust is fixed
#[cfg(feature = "rosrust_msg")]
#[test]
fn convertxyz_rosrust_msg() {