ensure no_std
This commit is contained in:
parent
927fc9a01f
commit
394bd1a9d7
|
|
@ -0,0 +1,24 @@
|
|||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- rclrs
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- rclrs
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
ubuntu:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
target: thumbv7em-none-eabihf
|
||||
- name: no_std build
|
||||
run: cargo build --target thumbv7em-none-eabihf --manifest-path rpcl2/ensure_no_std/Cargo.toml
|
||||
|
|
@ -16,15 +16,11 @@ jobs:
|
|||
ubuntu:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install latest Rust
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
rustc --version
|
||||
cargo --version
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
- name: Linting
|
||||
run: cargo clippy --all-targets --features derive,nalgebra,rayon -- -D warnings
|
||||
- name: Tests
|
||||
run: cargo test --features derive,nalgebra,rayon
|
||||
- name: no_std Tests
|
||||
run: cargo test --no-default-features --features nalgebra
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ exclude = [
|
|||
"**/dist/**",
|
||||
"**/docs/**",
|
||||
"**/doc/**",
|
||||
"**/ensure_no_std/**",
|
||||
]
|
||||
rust-version = "1.63"
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
/target
|
||||
Cargo.lock
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
[workspace]
|
||||
|
||||
[package]
|
||||
name = "ensure_no_std"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
ros_pointcloud2 = { path = "..", default-features = false, features = ["nalgebra", "derive"] }
|
||||
|
||||
[profile.dev]
|
||||
panic = "abort"
|
||||
|
||||
[profile.release]
|
||||
panic = "abort"
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(_info: &PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
|
@ -57,9 +57,9 @@
|
|||
//! - rosrust_msg — Integration with the [rosrust](https://github.com/adnanademovic/rosrust) library for ROS1 message types.
|
||||
//! - (rclrs_msg) — Integration for ROS2 [rclrs](https://github.com/ros2-rust/ros2_rust) but it currently needs [this workaround](https://github.com/stelzo/ros_pointcloud2?tab=readme-ov-file#rclrs-ros2_rust).
|
||||
//! - derive — Offers implementations for the [`PointConvertible`] trait needed for custom points.
|
||||
//! - rayon — Parallel iterator support for `_par_iter` functions. [`PointCloud2Msg::try_from_par_iter`] additionally needs the 'derive' feature.
|
||||
//! - rayon — Parallel iterator support for `_par_iter` functions.
|
||||
//! - nalgebra — Predefined points offer a nalgebra typed getter for coordinates (e.g. [`xyz`](points::PointXYZ::xyz)).
|
||||
//! - std *(enabled by default)* — Use the standard library. `no_std` only works standalone or with the 'nalgebra' feature.
|
||||
//! - std *(enabled by default)* — Omit this feature to use this library in no_std environments. ROS integrations and 'rayon' will not work with no_std.
|
||||
//!
|
||||
//! # Custom Points
|
||||
//! Implement [`PointConvertible`] for your point with the `derive` feature or manually.
|
||||
|
|
@ -474,7 +474,7 @@ fn ordered_field_names<const N: usize, C: PointConvertible<N>>() -> Vec<String>
|
|||
name,
|
||||
ty: _,
|
||||
size: _,
|
||||
} => name.to_string(),
|
||||
} => name.as_ref().into(),
|
||||
_ => unreachable!("Fields must be filtered before."),
|
||||
})
|
||||
.collect()
|
||||
|
|
|
|||
Loading…
Reference in New Issue