chore: add publish script for urdf and stl + unify all releases by de… (#727)

* chore: add publish script for urdf and stl + unify all releases by default

* better cross platform publish support

* publish in dry run within ci

* publish scripts better errors, abort if a publish fails, with an exit code.

* chore(rapier_urdf): fix warnings

* chore(rapier-urdf): typo fix

---------

Co-authored-by: Sébastien Crozet <developer@crozet.re>
This commit is contained in:
Thierry Berger
2024-09-03 21:48:10 +02:00
committed by GitHub
parent 58785ce257
commit 98f9199abc
7 changed files with 82 additions and 43 deletions

View File

@@ -32,10 +32,7 @@ use rapier3d::{
JointAxis, MassProperties, MultibodyJointHandle, MultibodyJointSet, RigidBody,
RigidBodyBuilder, RigidBodyHandle, RigidBodySet, RigidBodyType,
},
geometry::{
Collider, ColliderBuilder, ColliderHandle, ColliderSet, MeshConverter, SharedShape,
TriMeshFlags,
},
geometry::{Collider, ColliderBuilder, ColliderHandle, ColliderSet, SharedShape, TriMeshFlags},
math::{Isometry, Point, Real, Vector},
na,
};
@@ -493,7 +490,7 @@ fn urdf_to_rigid_body(options: &UrdfLoaderOptions, inertial: &Inertial) -> Rigid
fn urdf_to_collider(
options: &UrdfLoaderOptions,
mesh_dir: &Path,
_mesh_dir: &Path, // NOTO: this isnt used if there is no external mesh feature enabled (like stl).
geometry: &Geometry,
origin: &Pose,
) -> Option<Collider> {
@@ -514,17 +511,18 @@ fn urdf_to_collider(
Geometry::Sphere { radius } => SharedShape::ball(*radius as Real),
Geometry::Mesh { filename, scale } => {
let path: &Path = filename.as_ref();
let scale = scale
let _scale = scale
.map(|s| Vector::new(s.x as Real, s.y as Real, s.z as Real))
.unwrap_or_else(|| Vector::<Real>::repeat(1.0));
match path.extension().and_then(|ext| ext.to_str()) {
#[cfg(feature = "stl")]
Some("stl") | Some("STL") => {
let full_path = mesh_dir.join(filename);
use rapier3d::geometry::MeshConverter;
let full_path = _mesh_dir.join(filename);
match rapier3d_stl::load_from_path(
full_path,
MeshConverter::TriMeshWithFlags(options.trimesh_flags),
scale,
_scale,
) {
Ok(stl_shape) => {
shape_transform = stl_shape.pose;