From a4cc48a60f4d3c26b48b821baf23fe32b3a8cf5e Mon Sep 17 00:00:00 2001 From: Michael Strecke Date: Thu, 7 Aug 2025 13:15:54 +0200 Subject: [PATCH] Convert degrees to radians for inplane rotations --- .../gxf/foundationpose/foundationpose_sampling.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/isaac_ros_gxf_extensions/gxf_isaac_foundationpose/gxf/foundationpose/foundationpose_sampling.cpp b/isaac_ros_gxf_extensions/gxf_isaac_foundationpose/gxf/foundationpose/foundationpose_sampling.cpp index 05b13ce..af92550 100644 --- a/isaac_ros_gxf_extensions/gxf_isaac_foundationpose/gxf/foundationpose/foundationpose_sampling.cpp +++ b/isaac_ros_gxf_extensions/gxf_isaac_foundationpose/gxf/foundationpose/foundationpose_sampling.cpp @@ -444,13 +444,14 @@ std::vector SampleViewsIcosphere(unsigned int n_views) { std::vector MakeRotationGrid(const std::vector& symmetry_axes, const std::vector& fixed_axis_angles, unsigned int n_views = 40, - int inplane_step = 60) { + double inplane_step = 60.0) { auto cam_in_obs = SampleViewsIcosphere(n_views); GXF_LOG_DEBUG("[FoundationposeSampling] %lu poses generated from icosphere", cam_in_obs.size()); + inplane_step = inplane_step / 180.0 * M_PI; // Convert degrees to radians std::vector rot_grid; for (unsigned int i = 0; i < cam_in_obs.size(); i++) { - for (double inplane_rot = 0; inplane_rot < 360; inplane_rot += inplane_step) { + for (double inplane_rot = 0; inplane_rot < 2.0 * M_PI; inplane_rot += inplane_step) { Eigen::Matrix4f cam_in_ob = cam_in_obs[i]; auto R_inplane = Eigen::Affine3f::Identity(); R_inplane.rotate(Eigen::AngleAxisf(0, Eigen::Vector3f::UnitX()))