Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change thickness of wireframe cuboid #164

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/rviz_visual_tools/imarker_simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@

namespace rviz_visual_tools
{
using visualization_msgs::InteractiveMarkerFeedback;
using visualization_msgs::InteractiveMarkerControl;
using visualization_msgs::InteractiveMarkerFeedback;

typedef std::function<void(const visualization_msgs::InteractiveMarkerFeedbackConstPtr&)> IMarkerCallback;

Expand All @@ -67,7 +67,7 @@ geometry_msgs::Pose getIdentityPose()
pose.orientation.w = 1.0;
return pose;
}
}
} // namespace

class IMarkerSimple
{
Expand Down
5 changes: 3 additions & 2 deletions include/rviz_visual_tools/rviz_visual_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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.
Expand All @@ -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,
const Eigen::Vector3d& max_point, colors color = BLUE, scales scale = XXSMALL,
const std::string& ns = "Wireframe Cuboid", std::size_t id = 0);

/**
Expand Down
10 changes: 5 additions & 5 deletions src/rviz_visual_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2143,17 +2143,17 @@ 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,
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]);
Expand Down Expand Up @@ -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;
Expand Down