diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03413c9..0034ba8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,9 +54,9 @@ jobs: if: startsWith(matrix.os, 'windows') - run: cargo fmt --all --check - - run: cargo clippy --all-targets + - run: cargo clippy --all-features --all-targets - run: cargo hack build --feature-powerset - - run: cargo test + - run: cargo test --all-features wasm: runs-on: ubuntu-20.04 @@ -68,7 +68,7 @@ jobs: targets: wasm32-unknown-unknown - name: Install wasm-pack uses: taiki-e/install-action@wasm-pack - - run: cargo build --target wasm32-unknown-unknown --no-default-features --lib + - run: cargo build --target wasm32-unknown-unknown --lib - run: cargo build --target wasm32-unknown-unknown -p urdf-viz-wasm - name: Build wasm example run: npm install && npm run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 229a3b0..a39f832 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,6 +72,8 @@ jobs: with: bin: urdf-viz include: ${{ matrix.include-files }} + # TODO: Should we enable assimp feature for pre-built binary? + # all-features: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_PROFILE_RELEASE_LTO: true diff --git a/Cargo.toml b/Cargo.toml index 1b9f249..bb154bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ exclude = [".github/*", "img/*"] members = ["examples/wasm"] [features] -default = ["assimp"] +default = [] assimp = ["dep:assimp", "assimp-sys", "tempfile"] # Note: k, kiss3d, serde, structopt, tokio, urdf-rs, and wasm-bindgen are public dependencies. diff --git a/README.md b/README.md index cf61447..1692e5c 100644 --- a/README.md +++ b/README.md @@ -15,22 +15,18 @@ If you are using rust-lang already and `cargo` is installed, you can install by cargo install urdf-viz ``` -If you don't use mesh other than `.obj`, `.stl`, and `.dae` files, you can skip install -of assimp by disabling the `assimp` feature like below. +If you want to use mesh other than `.obj`, `.stl`, and `.dae` files, you need to install +with assimp like below. ```bash -cargo install urdf-viz --no-default-features +cargo install urdf-viz --features assimp ``` -Note: When the `assimp` feature is disabled, materials are not fully supported yet. - ### Pre-requirements for build #### Common -You need [cmake](https://cmake.org/download/) to use assimp (mesh loader). -It can be skipped if you use `--no-default-features`, but it will make it -fail to show mesh files other than `.obj`, `.stl`, and `.dae`. +If you want to use `--features assimp` to use mesh other than `.obj`, `.stl`, and `.dae` files, you need [cmake](https://cmake.org/download/). #### On Linux @@ -241,7 +237,7 @@ curl http://127.0.0.1:7777/get_urdf_text * [kiss3d](https://github.com/sebcrozet/kiss3d): `urdf-viz` is strongly depend on `kiss3d`, which is super easy to use, great 3D graphic engine. * [nalgebra](https://github.com/sebcrozet/nalgebra): linear algebra library. * [k](https://github.com/openrr/k): kinematics library which is based on [nalgebra](https://github.com/sebcrozet/nalgebra). It can load URDF files using `urdf-rs`. -* [assimp-rs](https://github.com/Eljay/assimp-rs): assimp rust interface. `kiss3d` supports `.obj` files natively, but urdf contains `dae` or `stl` files. These files are converted to kiss3d mesh model by `assimp-rs` +* [mesh-loader](https://github.com/openrr/mesh-loader): Mesh files (`.obj`, `.stl`, and `.dae`) loader. * [urdf-rs](https://github.com/openrr/urdf-rs): URDF file loader. * [structopt](https://github.com/TeXitoi/structopt): super easy command line arguments parser. diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index ebd4c07..295ec64 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" crate-type = ["cdylib"] [target.'cfg(target_family = "wasm")'.dependencies] -urdf-viz = { path = "../..", default-features = false } +urdf-viz = { path = "../.." } console_error_panic_hook = "0.1" tracing-wasm = "0.2" wasm-bindgen = "0.2"