From b9ed6c01bdb6a7122d4cc025de14db0c26c7e921 Mon Sep 17 00:00:00 2001 From: Eric Kapilik Date: Wed, 22 Jul 2020 14:56:42 -0500 Subject: [PATCH 1/2] change scale of wireframe cuboid --- include/rviz_visual_tools/rviz_visual_tools.h | 4 ++-- src/rviz_visual_tools.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/rviz_visual_tools/rviz_visual_tools.h b/include/rviz_visual_tools/rviz_visual_tools.h index 1f7eca1..5de10b8 100644 --- a/include/rviz_visual_tools/rviz_visual_tools.h +++ b/include/rviz_visual_tools/rviz_visual_tools.h @@ -726,7 +726,7 @@ class RvizVisualTools * \return true on success */ bool publishWireframeCuboid(const Eigen::Isometry3d& pose, double depth, double width, double height, - colors color = BLUE, const std::string& ns = "Wireframe Cuboid", std::size_t id = 0); + colors color = BLUE, scales scale = SMALL, const std::string& ns = "Wireframe Cuboid", std::size_t id = 0); /** * \brief Publish transformed wireframe cuboid. Useful eg to show an oriented bounding box. @@ -739,7 +739,7 @@ class RvizVisualTools * \return true on success */ bool publishWireframeCuboid(const Eigen::Isometry3d& pose, const Eigen::Vector3d& min_point, - const Eigen::Vector3d& max_point, colors color = BLUE, + const Eigen::Vector3d& max_point, colors color = BLUE, scales scale = SMALL, const std::string& ns = "Wireframe Cuboid", std::size_t id = 0); /** diff --git a/src/rviz_visual_tools.cpp b/src/rviz_visual_tools.cpp index 6f5cf36..2eddd6b 100644 --- a/src/rviz_visual_tools.cpp +++ b/src/rviz_visual_tools.cpp @@ -2143,16 +2143,16 @@ bool RvizVisualTools::publishPolygon(const geometry_msgs::Polygon& polygon, colo } bool RvizVisualTools::publishWireframeCuboid(const Eigen::Isometry3d& pose, double depth, double width, double height, - colors color, const std::string& ns, std::size_t id) + colors color, scales scale, const std::string& ns, std::size_t id) { Eigen::Vector3d min_point, max_point; min_point << -depth / 2, -width / 2, -height / 2; max_point << depth / 2, width / 2, height / 2; - return publishWireframeCuboid(pose, min_point, max_point, color, ns, id); + return publishWireframeCuboid(pose, min_point, max_point, color, scale, ns, id); } bool RvizVisualTools::publishWireframeCuboid(const Eigen::Isometry3d& pose, const Eigen::Vector3d& min_point, - const Eigen::Vector3d& max_point, colors color, const std::string& ns, + const Eigen::Vector3d& max_point, colors color, scales scale, const std::string& ns, std::size_t id) { // Extract 8 cuboid vertices @@ -2188,7 +2188,7 @@ bool RvizVisualTools::publishWireframeCuboid(const Eigen::Isometry3d& pose, cons } std_msgs::ColorRGBA this_color = getColor(color); - line_list_marker_.scale = getScale(XXSMALL); + line_list_marker_.scale = getScale(scale); line_list_marker_.scale.y = 0; line_list_marker_.scale.z = 0; line_list_marker_.color = this_color; From 92526bbb63f96ac06d1d235cef69fd28820374b2 Mon Sep 17 00:00:00 2001 From: JafarAbdi Date: Thu, 23 Jul 2020 01:00:59 +0300 Subject: [PATCH 2/2] Clang-format --- include/rviz_visual_tools/imarker_simple.h | 4 ++-- include/rviz_visual_tools/rviz_visual_tools.h | 5 +++-- src/rviz_visual_tools.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/rviz_visual_tools/imarker_simple.h b/include/rviz_visual_tools/imarker_simple.h index 11aa21e..56fb0a2 100644 --- a/include/rviz_visual_tools/imarker_simple.h +++ b/include/rviz_visual_tools/imarker_simple.h @@ -54,8 +54,8 @@ namespace rviz_visual_tools { -using visualization_msgs::InteractiveMarkerFeedback; using visualization_msgs::InteractiveMarkerControl; +using visualization_msgs::InteractiveMarkerFeedback; typedef std::function IMarkerCallback; @@ -67,7 +67,7 @@ geometry_msgs::Pose getIdentityPose() pose.orientation.w = 1.0; return pose; } -} +} // namespace class IMarkerSimple { diff --git a/include/rviz_visual_tools/rviz_visual_tools.h b/include/rviz_visual_tools/rviz_visual_tools.h index 5de10b8..75da0c1 100644 --- a/include/rviz_visual_tools/rviz_visual_tools.h +++ b/include/rviz_visual_tools/rviz_visual_tools.h @@ -726,7 +726,8 @@ class RvizVisualTools * \return true on success */ bool publishWireframeCuboid(const Eigen::Isometry3d& pose, double depth, double width, double height, - colors color = BLUE, scales scale = SMALL, const std::string& ns = "Wireframe Cuboid", std::size_t id = 0); + colors color = BLUE, scales scale = XXSMALL, const std::string& ns = "Wireframe Cuboid", + std::size_t id = 0); /** * \brief Publish transformed wireframe cuboid. Useful eg to show an oriented bounding box. @@ -739,7 +740,7 @@ class RvizVisualTools * \return true on success */ bool publishWireframeCuboid(const Eigen::Isometry3d& pose, const Eigen::Vector3d& min_point, - const Eigen::Vector3d& max_point, colors color = BLUE, scales scale = SMALL, + const Eigen::Vector3d& max_point, colors color = BLUE, scales scale = XXSMALL, const std::string& ns = "Wireframe Cuboid", std::size_t id = 0); /** diff --git a/src/rviz_visual_tools.cpp b/src/rviz_visual_tools.cpp index 2eddd6b..fb955df 100644 --- a/src/rviz_visual_tools.cpp +++ b/src/rviz_visual_tools.cpp @@ -2152,8 +2152,8 @@ bool RvizVisualTools::publishWireframeCuboid(const Eigen::Isometry3d& pose, doub } bool RvizVisualTools::publishWireframeCuboid(const Eigen::Isometry3d& pose, const Eigen::Vector3d& min_point, - const Eigen::Vector3d& max_point, colors color, scales scale, const std::string& ns, - std::size_t id) + const Eigen::Vector3d& max_point, colors color, scales scale, + const std::string& ns, std::size_t id) { // Extract 8 cuboid vertices Eigen::Vector3d p1(min_point[0], min_point[1], min_point[2]);