Skip to content

Commit

Permalink
Update k and urdf-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Apr 28, 2023
1 parent 864f2f4 commit 736ebe2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ updates:
interval: daily
commit-message:
prefix: ''
ignore:
# These dependencies need to be updated at the same time with k.
- dependency-name: urdf-rs
labels: []
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ assimp = ["assimp-crate", "assimp-sys"]
# Note: k, kiss3d, serde, structopt, tokio, urdf-rs, and wasm-bindgen are public dependencies.
[dependencies]
crossbeam-queue = "0.3.5"
k = "0.29"
k = "0.30"
kiss3d = "0.35"
mesh-loader = "0.0.2"
parking_lot = "0.12"
Expand All @@ -29,7 +29,7 @@ serde = { version = "1.0", features = ["derive"] }
structopt = "0.3"
thiserror = "1.0"
tracing = "0.1"
urdf-rs = "0.6.9"
urdf-rs = "0.7.1"

assimp-crate = { package = "assimp", version = "0.3.1", optional = true }
assimp-sys = { version = "0.3.1", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion examples/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
crate-type = ["cdylib"]

[target.'cfg(target_family = "wasm")'.dependencies]
urdf-viz = { version = "*", path = "../..", default-features = false }
urdf-viz = { path = "../..", default-features = false }
console_error_panic_hook = "0.1"
tracing-wasm = "0.2"
wasm-bindgen = "0.2"
Expand Down
12 changes: 5 additions & 7 deletions src/urdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,17 @@ pub fn add_geometry(
if let Some(replaced_filename) =
crate::utils::replace_package_with_path(&filename, package_path)
{
filename = Cow::Owned(replaced_filename);
filename = replaced_filename.into();
}
};
let replaced_filename = urdf_rs::utils::expand_package_path(&filename, base_dir);
if !replaced_filename.starts_with("https://")
&& !replaced_filename.starts_with("http://")
&& !Path::new(&replaced_filename).exists()
&& !Path::new(&*replaced_filename).exists()
{
return Err(Error::from(format!("{replaced_filename} not found")));
}
// TODO: remove Cow::Owned once https://github.com/openrr/urdf-rs/pull/41
// is released in the next breaking release of urdf-rs.
filename = Cow::Owned(replaced_filename);
filename = replaced_filename.into_owned().into();
}
let na_scale = na::Vector3::new(scale[0] as f32, scale[1] as f32, scale[2] as f32);
debug!("filename = {filename}");
Expand All @@ -110,7 +108,7 @@ pub fn add_geometry(

// Use material which is defined as root materials if found.
// Root material is used for PR2, but not documented.
pub fn rgba_from_visual(urdf_robot: &urdf_rs::Robot, visual: &urdf_rs::Visual) -> [f64; 4] {
pub fn rgba_from_visual(urdf_robot: &urdf_rs::Robot, visual: &urdf_rs::Visual) -> urdf_rs::Vec4 {
match urdf_robot
.materials
.iter()
Expand All @@ -136,4 +134,4 @@ pub fn rgba_from_visual(urdf_robot: &urdf_rs::Robot, visual: &urdf_rs::Visual) -
}

// https://github.com/openrr/urdf-rs/pull/3/files#diff-0fb2eeea3273a4c9b3de69ee949567f546dc8c06b1e190336870d00b54ea0979L36-L38
const DEFAULT_MESH_SCALE: [f64; 3] = [1.0f64; 3];
const DEFAULT_MESH_SCALE: urdf_rs::Vec3 = urdf_rs::Vec3([1.0f64; 3]);

0 comments on commit 736ebe2

Please sign in to comment.