##  ◆  publishPath()  [1/9]


bool RvizVisualTools::publishLines(const EigenSTL::vector_Vector3d& aPoints, const EigenSTL::vector_Vector3d& bPoints,
                                   const std::vector<colors>& colors, scales scale)
{
  BOOST_ASSERT_MSG(aPoints.size() == bPoints.size() && bPoints.size() == colors.size(), "Mismatching vector sizes: "
                                                                                "aPoints, bPoints, and colors");


Definition at line [ 1447 ](rviz__visual__tools_8cpp_source.html#l01447) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  // Set the namespace and id for this marker.  This serves to create a unique
  // ID
  triangle_marker_.ns = ns;


true on success


Definition at line [ 2785 ](rviz__visual__tools_8cpp_source.html#l02785) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


     point  |
---|---

Returns


  // Overwrite ID or increment?
  if (id == 0)
  {
    sphere_marker_.id++;
  }
  else
  {
    sphere_marker_.id = id;
  }


[ Point cloud to Octomap? No map received ](/question/51037/point-cloud-to-
octomap-no-map-received/)


scales RvizVisualTools::intToRvizScale(std::size_t scale)
{
  // clang-format off
  switch (scale)
  {
    case 1: return XXXXSMALL; break;
    case 2: return XXXSMALL; break;
    case 3: return XXSMALL; break;
    case 4: return XSMALL; break;
    case 5: return SMALL; break;
    case 6: return MEDIUM; break;
    case 7: return LARGE; break;
    case 8: return XLARGE; break;
    case 9: return XXLARGE; break;
    case 10: return XXXLARGE; break;
    case 11: return XXXXLARGE; break;
    default: throw std::runtime_error("Unknown size");
  }
  // clang-format on
  return MEDIUM;  // dumy value
}


Definition at line [ 1470 ](rviz__visual__tools_8cpp_source.html#l01470) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Definition at line [ 721 ](rviz__visual__tools_8cpp_source.html#l00721) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Eigen::Isometry3d RvizVisualTools::convertFromXYZRPY(double tx, double ty, double tz, double rx, double ry, double rz,
                                                     EulerConvention convention)
{
  Eigen::Isometry3d result;


  * [ About Open3D ](../introduction.html)
  * [ Getting Started ](../getting_started.html)
  * [ Compiling from source ](../compilation.html)
  * [ Building Documentation ](../builddocs.html)
  * [ Contributing to Open3D ](../contribute.html)


##  ◆  publishCylinder()  [5/6]


  sphere_marker_.pose = pose.pose;
  sphere_marker_.color = getColor(color);
  sphere_marker_.scale = scale;
  sphere_marker_.ns = ns;


    if (!ros::ok())
    {
      return false;
    }
  }
  pub_rviz_markers_connected_ = true;


|  const std::array< [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) , 14 >
rviz_visual_tools::RvizVisualTools::all_rand_colors_
---
static  protected

**Initial value:**


std::mt19937 RvizVisualTools::mt_random_engine_(std::chrono::system_clock::now().time_since_epoch().count());


bool rviz_visual_tools::RvizVisualTools::publishSphere  |  (  |  const [
geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
& |  _point_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  const std::string & |  _ns_ = ` "Sphere" ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Definition at line [ 1131 ](rviz__visual__tools_8cpp_source.html#l01131) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  p[2].x = -1.0 * scale;
  p[2].y = 0;
  p[2].z = -1.0 * scale;


()
|  Reset the id's of all published markers so that they overwrite themselves
in the future NOTE you may prefer [ deleteAllMarkers()
](classrviz__visual__tools_1_1RvizVisualTools.html#a93e7ee229b27f759bb2efd6e2e4fbffd
"Tell Rviz to clear all markers on a particular display. ") More...

|  [ RvizVisualTools
](classrviz__visual__tools_1_1RvizVisualTools.html#abfebf8a2c29adb748a0127dbe6a81f47)
(std::string base_frame, std::string marker_topic= [ RVIZ_MARKER_TOPIC
](namespacerviz__visual__tools.html#ae7916e71b4856fc29f96b07902e6910b) , [
ros::NodeHandle ](../../../api/roscpp/html/classros_1_1NodeHandle.html) nh= [
ros::NodeHandle ](../../../api/roscpp/html/classros_1_1NodeHandle.html) ("~"))
|  Constructor.  More...

void  |  [ setAlpha
](classrviz__visual__tools_1_1RvizVisualTools.html#a091e47ef1571981b29de1bde35eac6c6)
(double alpha)
|  Change the transparency of all markers published.  More...

void  |  [ setBaseFrame
](classrviz__visual__tools_1_1RvizVisualTools.html#a1840c62b7e75514dffc669381e1db742)
(const std::string &base_frame)
|  Change the global base frame Note: this might reset all your current
markers.  More...

void  |  [ setGlobalScale
](classrviz__visual__tools_1_1RvizVisualTools.html#aa6be67317c603d9b389a96fe4698f8de)
(double global_scale)
|  Setter for the global scale used for changing size of all markers.  More...

void  |  [ setLifetime
](classrviz__visual__tools_1_1RvizVisualTools.html#a4bf9cfda91bff10c7162185f367dc856)
(double lifetime)
|  Set the lifetime of markers published to rviz.  More...

void  |  [ setMarkerTopic
](classrviz__visual__tools_1_1RvizVisualTools.html#afb18e1debf0237303cedf1f824932f6b)
(const std::string &topic)
|  Set marker array topic.  More...


  cuboid_marker_.header.frame_id = base_frame_;
  // Set the namespace and id for this marker.  This serves to create a unique
  // ID
  cuboid_marker_.ns = "Cuboid";
  // Set the marker type.
  cuboid_marker_.type = visualization_msgs::Marker::CUBE;
  // Set the marker action.  Options are ADD and DELETE
  cuboid_marker_.action = visualization_msgs::Marker::ADD;
  // Lifetime
  cuboid_marker_.lifetime = marker_lifetime_;
  // Constants
  cuboid_marker_.pose = getIdentityPose();


bool rviz_visual_tools::RvizVisualTools::publishXZPlane  |  (  |  const [
geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _pose_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ TRANSLUCENT
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3ada8357de2c7d31bdc0a27e7814e0ac85)
` ,
|  |  double  |  _scale_ = ` 1.0 `
|  )  |  |

Definition at line [ 1022 ](rviz__visual__tools_8cpp_source.html#l01022) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


     pose  |  \- the position of the plane
---|---
color  |  \- the color of the plane
scale  |  \- the size of the vizualized plane

Returns


     pose  |  \- the location to publish the marker with respect to the base frame
---|---
scale  |  \- size of axis
length  |  \- geometry of cylinder
radius  |  \- geometry of cylinder
ns  |  \- namespace

Returns


Parameters


  spheres_marker_.header.frame_id = base_frame_;
  // Set the namespace and id for this marker.  This serves to create a unique
  // ID
  spheres_marker_.ns = "Spheres";
  // Set the marker type.
  spheres_marker_.type = visualization_msgs::Marker::SPHERE_LIST;
  // Set the marker action.  Options are ADD and DELETE
  spheres_marker_.action = visualization_msgs::Marker::ADD;
  // Lifetime
  spheres_marker_.lifetime = marker_lifetime_;
  // Constants
  spheres_marker_.pose = getIdentityPose();


bool rviz_visual_tools::RvizVisualTools::publishGraph  |  (  |  const
graph_msgs::GeometryGraph & |  _graph_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ ,
|  |  double  |  _radius_
|  )  |  |

Display a graph.


  return true;
}


##  ◆  slerp()


##  ◆  publishAxisInternal()


Eigen::Isometry3d RvizVisualTools::convertFromXYZRPY(const std::vector<double>& transform6, EulerConvention convention)
{
  if (transform6.size() != 6)
  {
    ROS_ERROR_STREAM_NAMED(LOGNAME, "Incorrect number of variables passed for 6-size transform");
    throw;
  }


  line_list_marker_.points.push_back(convertPoint(p1));
  line_list_marker_.points.push_back(convertPoint(p5));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


// C++
#include <chrono>
#include <cmath>  // for random poses
#include <random>
#include <set>
#include <string>
#include <utility>
#include <vector>


_property_ ` x_axis ` Â¶


##  ◆  convertPoint32ToPose()


path and colors vectors must be the same size


[ ![xuningy gravatar image](/m/default/media/images/nophoto.png?v=27)
](/users/18591/xuningy/) [ xuningy ](/users/18591/xuningy/) (  2014-06-17
14:20:41 -0500  )  edit


  // Provide a new id every call to this function
  line_list_marker_.id++;


##  ◆  publishPath()  [9/9]


_property_ ` center ` Â¶


##  ◆  publishGraph()


` __init__ ` (  _*args_ , _**kwargs_ )  Â¶


Returns max bounds for geometry coordinates.


void  |  [ setPsychedelicMode
](classrviz__visual__tools_1_1RvizVisualTools.html#a444522110647153dae2fb667e9617de7)
(bool psychedelic_mode=true)
|  Setter for PsychedelicMode.  More...

bool  |  [ trigger
](classrviz__visual__tools_1_1RvizVisualTools.html#a4497fb175c96a2538e5b175c05667732)
()
|  Trigger the publish function to send out all collected markers.  More...

bool  |  [ triggerEvery
](classrviz__visual__tools_1_1RvizVisualTools.html#afca2e8d8ee80b77065c5c93cc77a50ed)
(std::size_t queueSize)
|  Trigger the publish function to send out all collected markers IF there are
at leats queueSize number of markers ready to be published. a * Warning: when
using this in a loop be sure to call [ trigger()
](classrviz__visual__tools_1_1RvizVisualTools.html#a4497fb175c96a2538e5b175c05667732
"Trigger the publish function to send out all collected markers. ") at end of
loop in case there are any remainder markers in the queue.  More...

void  |  [ waitForMarkerPub
](classrviz__visual__tools_1_1RvizVisualTools.html#a9fad810b810c16b937a2cc8bcc51bd04)
()
|  Optional blocking function to call _after_ calling [ loadMarkerPub()
](classrviz__visual__tools_1_1RvizVisualTools.html#a40922a05c41f8ef17ceb017979d51462
"Load publishers as needed. ") . Allows you to do some intermediate processing
before wasting cycles waiting for the marker pub to find a subscriber.
More...

void  |  [ waitForMarkerPub
](classrviz__visual__tools_1_1RvizVisualTools.html#a61310a8b1d2a71e130c580acc841e4bb)
(double wait_time)
bool  |  [ waitForSubscriber
](classrviz__visual__tools_1_1RvizVisualTools.html#aef6dc27d85f95f58d84c9c5c5c683356)
(const [ ros::Publisher ](../../../api/roscpp/html/classros_1_1Publisher.html)
&pub, double wait_time=0.5, bool blocking=false)
|  Wait until at least one subscriber connects to a publisher.  More...

|  [ ~RvizVisualTools
](classrviz__visual__tools_1_1RvizVisualTools.html#acd69fa6c28a1170c75968ad4f40cd784)


bool RvizVisualTools::loadRvizMarkers()
{
  // Load reset marker -------------------------------------------------
  reset_marker_.header.frame_id = base_frame_;
  reset_marker_.header.stamp = ros::Time();
  reset_marker_.ns = "deleteAllMarkers";  // helps during debugging
  reset_marker_.action = 3;               // TODO(davetcoleman): In ROS-J set to visualization_msgs::Marker::DELETEALL;
  reset_marker_.pose.orientation.w = 1;


Parameters


bool


bool RvizVisualTools::publishYArrow(const geometry_msgs::PoseStamped& pose, colors color, scales scale, double length)
{
  Eigen::Isometry3d arrow_pose = convertPose(pose.pose) * Eigen::AngleAxisd(M_PI / 2, Eigen::Vector3d::UnitZ());
  geometry_msgs::PoseStamped new_pose = pose;
  new_pose.pose = convertPose(arrow_pose);
  return publishArrow(new_pose, color, scale, length);
}


Definition at line [ 2451 ](rviz__visual__tools_8cpp_source.html#l02451) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool RvizVisualTools::publishArrow(const geometry_msgs::Pose& pose, colors color, scales scale, double length,
                                   std::size_t id)
{
  // Set the frame ID and timestamp.
  arrow_marker_.header.stamp = ros::Time::now();
  arrow_marker_.header.frame_id = base_frame_;


bool RvizVisualTools::publishSphere(const Eigen::Vector3d& point, const std_msgs::ColorRGBA& color,
                                    const geometry_msgs::Vector3 scale, const std::string& ns, std::size_t id)
{
  geometry_msgs::Pose pose_msg = getIdentityPose();
  tf2::convert(point, pose_msg.position);
  return publishSphere(pose_msg, color, scale, ns, id);
}


##  ◆  loadMarkerPub()


  return result;
}


  return publishMarker(triangle_marker_);
}


bool RvizVisualTools::publishLineStrip(const std::vector<geometry_msgs::Point>& path, colors color, scales scale,
                                       const std::string& ns)
{
  if (path.size() < 2)
  {
    ROS_WARN_STREAM_NAMED(LOGNAME, "Skipping path because " << path.size() << " points passed in.");
    return true;
  }


  * [ Docs ](../index.html) »
  * [ open3d.geometry ](open3d.geometry.html) »
  * open3d.geometry.OrientedBoundingBox
  *


, double scale=1.0)
bool  |  [ publishYArrow
](classrviz__visual__tools_1_1RvizVisualTools.html#aaa5964ee4c33386c29f7ab8240811f93)
(const Eigen::Isometry3d &pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ GREEN
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a54300acbac130f358566327dd13a1fd2)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, double [ length
](../../../api/tf2/html/namespacetf2.html#ab20034dc53b40043a702876ff38c78a1)
=0.0)
|  Display an arrow along the y-axis of a pose.  More...

bool  |  [ publishYArrow
](classrviz__visual__tools_1_1RvizVisualTools.html#aa83f70e4e1f5899ea64a11fbe9bbcad2)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ GREEN
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a54300acbac130f358566327dd13a1fd2)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, double [ length
](../../../api/tf2/html/namespacetf2.html#ab20034dc53b40043a702876ff38c78a1)
=0.0)
bool  |  [ publishYArrow
](classrviz__visual__tools_1_1RvizVisualTools.html#a1dcc9556532f34641d099b3286314ca4)
(const geometry_msgs::PoseStamped &pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ GREEN
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a54300acbac130f358566327dd13a1fd2)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM


##  ◆  publishCuboid()  [1/4]


Returns


  // Load Text ----------------------------------------------------
  // Set the namespace and id for this marker.  This serves to create a unique
  // ID
  text_marker_.ns = "Text";
  // Set the marker action.  Options are ADD and DELETE
  text_marker_.action = visualization_msgs::Marker::ADD;
  // Set the marker type.
  text_marker_.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
  // Lifetime
  text_marker_.lifetime = marker_lifetime_;
  // Constants
  text_marker_.pose = getIdentityPose();


  // Add each point pair to the line message
  line_list_marker_.points.push_back(convertPoint(p1));
  line_list_marker_.points.push_back(convertPoint(p2));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


bool rviz_visual_tools::RvizVisualTools::publishXYPlane  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ TRANSLUCENT
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3ada8357de2c7d31bdc0a27e7814e0ac85)
` ,
|  |  double  |  _scale_ = ` 1.0 `
|  )  |  |

Display the XY plane of a given pose.


     lifetime  |  seconds of how long to show markers. 0 for inifinity
---|---

Definition at line [ 350 ](rviz__visual__tools_8cpp_source.html#l00350) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  sphere_marker_.pose = pose;
  sphere_marker_.color = color;
  sphere_marker_.scale = scale;
  sphere_marker_.ns = ns;


bool rviz_visual_tools::RvizVisualTools::publishAxisLabeled  |  (  |  const [
geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _pose_ ,
---|---|---|---
|  |  const std::string & |  _label_ ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ WHITE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a23885a26fe14a38b7ec48819c423fd9a)
`
|  )  |  |

Definition at line [ 1407 ](rviz__visual__tools_8cpp_source.html#l01407) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  // Cache the reusable markers
  loadRvizMarkers();
}


  arrow_marker_.header.frame_id = base_frame_;
  // Set the namespace and id for this marker.  This serves to create a unique
  // ID
  arrow_marker_.ns = "Arrow";
  // Set the marker type.
  arrow_marker_.type = visualization_msgs::Marker::ARROW;
  // Set the marker action.  Options are ADD and DELETE
  arrow_marker_.action = visualization_msgs::Marker::ADD;
  // Lifetime
  arrow_marker_.lifetime = marker_lifetime_;
  // Constants
  arrow_marker_.pose = getIdentityPose();


  double height = 0.001;  // very thin
  publishCuboid(pose, x_width, y_width, height, color);


[ ![xuningy gravatar image](/m/default/media/images/nophoto.png?v=27)
](/users/18591/xuningy/)


##  Question Tools


geometry_msgs::Pose RvizVisualTools::convertPointToPose(const geometry_msgs::Point& point)
{
  geometry_msgs::Pose pose_msg;
  pose_msg.orientation.x = 0.0;
  pose_msg.orientation.y = 0.0;
  pose_msg.orientation.z = 0.0;
  pose_msg.orientation.w = 1.0;
  pose_msg.position = point;
  return pose_msg;
}


Definition at line [ 2719 ](rviz__visual__tools_8cpp_source.html#l02719) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


_property_ ` color ` Â¶


](classrviz__visual__tools_1_1RvizVisualTools.html#a5cce45d50bc5b992e2f2c8233e6e0f3b)
bool  |  [ frame_locking_enabled_
](classrviz__visual__tools_1_1RvizVisualTools.html#aab1749a94dcbf43139d65622360af6ba)
= false
double  |  [ global_scale_
](classrviz__visual__tools_1_1RvizVisualTools.html#ac594f320882301c8167e0ed98b8e84b4)
= 1.0
visualization_msgs::Marker  |  [ line_list_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#a746f91057fb08a87e9c3efa6532921bc)
visualization_msgs::Marker  |  [ line_strip_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#a74b5700bf05b7e8cc446e86d348ed68d)
[ ros::Duration ](../../../api/rostime/html/classros_1_1Duration.html) |  [
marker_lifetime_
](classrviz__visual__tools_1_1RvizVisualTools.html#a9c79e5796767a645764126d9961fb7cd)
std::string  |  [ marker_topic_
](classrviz__visual__tools_1_1RvizVisualTools.html#ae05b9d69c9ca96044c97de4cf112bc05)
visualization_msgs::MarkerArray  |  [ markers_
](classrviz__visual__tools_1_1RvizVisualTools.html#a16e5c9c8b294a5482e87eb2a2a6344db)
visualization_msgs::Marker  |  [ mesh_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#a5a864af9dc5741c0e2eb76f46932222c)
[ ros::NodeHandle ](../../../api/roscpp/html/classros_1_1NodeHandle.html) |  [
nh_
](classrviz__visual__tools_1_1RvizVisualTools.html#a1d6250bcc494ef61181bddbe614e8934)
bool  |  [ psychedelic_mode_
](classrviz__visual__tools_1_1RvizVisualTools.html#aedf18c0564d423f69ef9ffa07f6c5e1f)
= false
[ ros::Publisher ](../../../api/roscpp/html/classros_1_1Publisher.html) |  [
pub_rviz_markers_
](classrviz__visual__tools_1_1RvizVisualTools.html#a1a4ade8ee2aae85d78b3d4b16f5bb57d)
bool  |  [ pub_rviz_markers_connected_
](classrviz__visual__tools_1_1RvizVisualTools.html#ac1461d413bd7185b2e8f2ec77d35b75d)
= false
bool  |  [ pub_rviz_markers_waited_
](classrviz__visual__tools_1_1RvizVisualTools.html#a05a64c2d9d5b8084f48ba3e8747f6f81)
= false
[ RemoteControlPtr
](namespacerviz__visual__tools.html#a86b96f423e9a60fd4df818a41e065921) |  [
remote_control_
](classrviz__visual__tools_1_1RvizVisualTools.html#a16e38376c68455093951ce0aea1b02c0)
visualization_msgs::Marker  |  [ reset_marker_


  // Helper for publishing rviz markers
  return publishMarker(line_list_marker_);
}


bool rviz_visual_tools::RvizVisualTools::publishZArrow  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  double  |  _length_ = ` 0.0 ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Display an arrow along the z-axis of a pose.


##  ◆  line_list_marker_


  std_msgs::ColorRGBA this_color = getColor(color);
  line_strip_marker_.scale = getScale(scale);
  line_strip_marker_.scale.z = 0;
  line_strip_marker_.scale.y = 0;
  line_strip_marker_.color = this_color;
  line_strip_marker_.points.clear();
  line_strip_marker_.colors.clear();


Definition at line [ 557 ](rviz__visual__tools_8cpp_source.html#l00557) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  publishCone()  [2/2]


|  [ ros::NodeHandle ](../../../api/roscpp/html/classros_1_1NodeHandle.html)
rviz_visual_tools::RvizVisualTools::nh_
---
protected

Definition at line [ 1059 ](rviz__visual__tools_8h_source.html#l01059) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


  // Create the cylinders
  for (std::size_t i = 1; i < path.size(); ++i)
  {
    publishCylinder(convertPoint(path[i - 1]), convertPoint(path[i]), color, radius, ns);
  }


|  bool rviz_visual_tools::RvizVisualTools::psychedelic_mode_ = false
---
protected

Definition at line [ 1103 ](rviz__visual__tools_8h_source.html#l01103) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


bool RvizVisualTools::publishYZPlane(const geometry_msgs::Pose& pose, colors color, double scale)
{
  triangle_marker_.header.stamp = ros::Time::now();
  triangle_marker_.id++;


Definition at line [ 880 ](rviz__visual__tools_8cpp_source.html#l00880) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


void RvizVisualTools::generateRandomCuboid(geometry_msgs::Pose& cuboid_pose, double& depth, double& width,
                                           double& height, RandomPoseBounds pose_bounds,
                                           RandomCuboidBounds cuboid_bounds)
{
  // Size
  depth = fRand(cuboid_bounds.cuboid_size_min_, cuboid_bounds.cuboid_size_max_);
  width = fRand(cuboid_bounds.cuboid_size_min_, cuboid_bounds.cuboid_size_max_);
  height = fRand(cuboid_bounds.cuboid_size_min_, cuboid_bounds.cuboid_size_max_);


  Eigen::Isometry3d pose;
  pose.translation() = center;


[ RemoteControlPtr
](namespacerviz__visual__tools.html#a86b96f423e9a60fd4df818a41e065921) &
rviz_visual_tools::RvizVisualTools::getRemoteControl  |  (  |  |  )  |
---|---|---|---|---

Ability to load remote control on the fly.


  std_msgs::ColorRGBA start;
  std_msgs::ColorRGBA end;


##  ◆  publishLines()  [2/2]


|  Add an identity rotation matrix to make a point have a full pose.  More...

static Eigen::Isometry3d  |  [ convertPointToPose
](classrviz__visual__tools_1_1RvizVisualTools.html#a909cf8c4b5c648e83576ef3e963049e0)
(const Eigen::Vector3d &point)
static [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
|  [ convertPose
](classrviz__visual__tools_1_1RvizVisualTools.html#a2dc00f85d1b8a220c0c5570056dbaf56)
(const Eigen::Isometry3d &pose)
|  Convert an [ Eigen ](../../../api/rviz/html/c++/namespaceEigen.html) pose
to a geometry_msg pose.  More...

static Eigen::Isometry3d  |  [ convertPose
](classrviz__visual__tools_1_1RvizVisualTools.html#a2376dd41e74c9ededde9375a85f93a2f)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose)
|  Convert a geometry_msg pose to an [ Eigen
](../../../api/rviz/html/c++/namespaceEigen.html) pose Note: Not thread safe
but very convenient.  More...

static void  |  [ convertPoseSafe
](classrviz__visual__tools_1_1RvizVisualTools.html#ad1dadf0f9098e82636fe3947b8406b59)
(const Eigen::Isometry3d &pose, [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose_msg)
|  Convert an [ Eigen ](../../../api/rviz/html/c++/namespaceEigen.html) pose
to a geometry_msg pose - thread safe.  More...

static void  |  [ convertPoseSafe
](classrviz__visual__tools_1_1RvizVisualTools.html#ad58b2dbaffad37a6868da1f26dcab330)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose_msg, Eigen::Isometry3d &pose)
|  Convert a geometry_msg pose to an [ Eigen
](../../../api/rviz/html/c++/namespaceEigen.html) pose - thread safe.  More...

static [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)


Definition at line [ 608 ](rviz__visual__tools_8cpp_source.html#l00608) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Definition at line [ 2065 ](rviz__visual__tools_8cpp_source.html#l02065) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool RvizVisualTools::publishLine(const Eigen::Vector3d& point1, const Eigen::Vector3d& point2,
                                  const std_msgs::ColorRGBA& color, double radius)
{
  geometry_msgs::Vector3 scale;
  scale.x = radius * global_scale_;
  scale.y = radius * global_scale_;
  scale.z = radius * global_scale_;
  return publishLine(convertPoint(point1), convertPoint(point2), color, scale);
}


##  ◆  convertPoseSafe()  [2/2]


true on success


  line_list_marker_.points.push_back(convertPoint(p5));
  line_list_marker_.points.push_back(convertPoint(p8));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


bool rviz_visual_tools::RvizVisualTools::publishLine  |  (  |  const
Eigen::Vector3d & |  _point1_ ,
---|---|---|---
|  |  const Eigen::Vector3d & |  _point2_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
`
|  )  |  |

Definition at line [ 1746 ](rviz__visual__tools_8cpp_source.html#l01746) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  text_marker_


Definition at line [ 848 ](rviz__visual__tools_8cpp_source.html#l00848) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  publishPath()  [2/9]


* **rotation** ( _numpy.ndarray_ _[_ _float64_ _[_ _3_ _,_ _1_ _]_ _]_ ) â A 3D vector that either defines the three angles for Euler rotation, or in the axis-angle representation the normalized vector defines the axis of rotation and the norm the angle around this axis.


  return true;
}


First time here? Check out the FAQ!


##  ◆  generateEmptyPose()


  Eigen::Quaterniond quaternion(Eigen::AngleAxis<double>(static_cast<double>(angle), axis));
  pose = Eigen::Translation3d(pose.translation().x(), pose.translation().y(), pose.translation().z()) * quaternion;
}


` LineSet ` _= Type.LineSet_ Â¶


##  ◆  getRemoteControl()


Parameters


Returns


##  ◆  publishZArrow()  [4/4]


[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, double [ length
](../../../api/tf2/html/namespacetf2.html#ab20034dc53b40043a702876ff38c78a1)
=0.0)
bool  |  [ publishXYPlane
](classrviz__visual__tools_1_1RvizVisualTools.html#a43ebc282d0c034db0188d2f7e2bf88b2)
(const Eigen::Isometry3d &pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ TRANSLUCENT
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3ada8357de2c7d31bdc0a27e7814e0ac85)
, double scale=1.0)
|  Display the XY plane of a given pose.  More...

bool  |  [ publishXYPlane
](classrviz__visual__tools_1_1RvizVisualTools.html#a6649420bd62ea71c8d06fdb9bbf05200)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ TRANSLUCENT
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3ada8357de2c7d31bdc0a27e7814e0ac85)
, double scale=1.0)
bool  |  [ publishXZPlane
](classrviz__visual__tools_1_1RvizVisualTools.html#a20a58467321df6d8525db774d132b1d9)
(const Eigen::Isometry3d &pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ TRANSLUCENT
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3ada8357de2c7d31bdc0a27e7814e0ac85)
, double scale=1.0)
|  Display the XY plane of a given pose.  More...

bool  |  [ publishXZPlane
](classrviz__visual__tools_1_1RvizVisualTools.html#a441db37c43b3f2fbb262f062d99a7088)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ TRANSLUCENT
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3ada8357de2c7d31bdc0a27e7814e0ac85)


  * [ rviz_visual_tools ](namespacerviz__visual__tools.html)
  * [ RvizVisualTools ](classrviz__visual__tools_1_1RvizVisualTools.html)


Definition at line [ 1017 ](rviz__visual__tools_8cpp_source.html#l01017) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


` PointCloud ` _= Type.PointCloud_ Â¶


* **scale** ( _float_ ) â The scale parameter that is multiplied to the points/vertices of the geometry


|  bool rviz_visual_tools::RvizVisualTools::posesEqual  |  (  |  const
Eigen::Isometry3d & |  _pose1_ ,
---|---|---|---
|  |  const Eigen::Isometry3d & |  _pose2_ ,
|  |  double  |  _threshold_ = ` 0.000001 `
|  )  |  |
static

Test if two [ Eigen ](../../../api/rviz/html/c++/namespaceEigen.html) poses
are close enough.


bool RvizVisualTools::publishAxisLabeled(const geometry_msgs::Pose& pose, const std::string& label, scales scale,
                                         colors color)
{
  publishAxis(pose, scale, label);


int


Apply scaling to the geometry coordinates.


true on success


##  ◆  getCenterPoint()


[ Create collision map from Kinect with nodelet ](/question/39329/create-
collision-map-from-kinect-with-nodelet/)


` float64  ` array of shape ` (3,  )  `


  line_list_marker_.points.push_back(convertPoint(p4));
  line_list_marker_.points.push_back(convertPoint(p1));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


bool RvizVisualTools::publishMarkers(visualization_msgs::MarkerArray& markers)
{
  if (pub_rviz_markers_ == nullptr)
  {  // always check this before publishing
    loadMarkerPub();
  }


  triangle_marker_.points.clear();
  for (std::size_t i = 0; i < 32; i++)
  {
    p[0].x = 0;
    p[0].y = 0;
    p[0].z = 0;


  if (id == 0)
  {
    arrow_marker_.id++;
  }
  else
  {
    arrow_marker_.id = id;
  }


_property_ ` z_axis ` Â¶


##  ◆  intToRvizColor()


Definition at line [ 1699 ](rviz__visual__tools_8cpp_source.html#l01699) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Parameters


bool RvizVisualTools::publishSpheres(const std::vector<geometry_msgs::Point>& points,
                                     const std::vector<std_msgs::ColorRGBA>& colors,
                                     const geometry_msgs::Vector3& scale, const std::string& ns)
{
  spheres_marker_.header.stamp = ros::Time();
  spheres_marker_.ns = ns;


Definition at line [ 1421 ](rviz__visual__tools_8cpp_source.html#l01421) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


     alpha  |  \- value 0 - 1 where 0 is invisible
---|---

Definition at line [ 256 ](rviz__visual__tools_8h_source.html#l00256) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


  // R-P-Y / X-Y-Z / 0-1-2 Euler Angle Standard
  Eigen::Vector3d vec = pose.rotation().eulerAngles(0, 1, 2);
  roll = vec[0];
  pitch = vec[1];
  yaw = vec[2];
}


Definition at line [ 504 ](rviz__visual__tools_8cpp_source.html#l00504) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  if (pub.getTopic().empty())
  {
    ROS_ERROR_STREAM_NAMED(LOGNAME, "loadMarkerPub() has not been called yet, unable to wait for subscriber.");
  }


Random color from colors


bool rviz_visual_tools::RvizVisualTools::publishYArrow  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ GREEN
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a54300acbac130f358566327dd13a1fd2)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  double  |  _length_ = ` 0.0 `
|  )  |  |

Display an arrow along the y-axis of a pose.


  // Helper for publishing rviz markers
  return publishMarker(spheres_marker_);
}


[ Can Octomap use multiple point clouds as sources? ](/question/44055/can-
octomap-use-multiple-point-clouds-as-sources/)


  return publishPath(point_path, color, getScale(scale).x, ns);
}


  arrow_marker_.pose = pose;
  arrow_marker_.color = getColor(color);
  arrow_marker_.scale = getScale(scale);


##  ◆  generateRandomPose()  [1/2]


](classrviz__visual__tools_1_1RvizVisualTools.html#a74a538c33a748a5336be34984cf0aaac)
visualization_msgs::Marker  |  [ sphere_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#ae2d97ae0731af652e776e912965cf3a6)
visualization_msgs::Marker  |  [ spheres_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#abfe53094f386c6c1d4ff72e38cdf8377)
visualization_msgs::Marker  |  [ text_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#a83e2fd918687e1eea0e7481b72196d28)
visualization_msgs::Marker  |  [ triangle_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#a7435edbc1f0aa934c77472e1046a68c0)

##  Static Protected Attributes

---
static const std::array< [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) , 14 >
|  [ all_rand_colors_
](classrviz__visual__tools_1_1RvizVisualTools.html#a04fb5b2a6aafaef19b8801b7f9fa0a83)
static [ RVIZ_VISUAL_TOOLS_DECL
](rviz__visual__tools_8h.html#aeedbda9230c9f2a7736b170bebe349aa) const
std::string  |  [ name_
](classrviz__visual__tools_1_1RvizVisualTools.html#af6725ca7a5ccf5529eb50d9ab3f150f9)
= "visual_tools"

##  Private Member Functions

---
void  |  [ initialize
](classrviz__visual__tools_1_1RvizVisualTools.html#aa27f4cdfcb2544668b1a7b0f16f32391)
()
|  Shared function for initilization by constructors.  More...

bool  |  [ publishAxisInternal
](classrviz__visual__tools_1_1RvizVisualTools.html#a124ea18bf2621e5b0ee0b3882542b142)
(const Eigen::Isometry3d &pose, double [ length
](../../../api/tf2/html/namespacetf2.html#ab20034dc53b40043a702876ff38c78a1)
=0.1, double radius=0.01, const std::string &ns="Axis")
|  Display a red/green/blue coordinate axis - the 'internal' version does not
do a batch publish.  More...


Definition at line [ 2764 ](rviz__visual__tools_8cpp_source.html#l02764) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool  |  [ publishMesh
](classrviz__visual__tools_1_1RvizVisualTools.html#afd39947977e7042e9a03509daf288d13)
(const Eigen::Isometry3d &pose, const std::string &file_name, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ CLEAR
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a3a91cf12667283beafe6e3732e8bdd20)
, double scale=1, const std::string &ns="mesh", std::size_t id=0)
|  Display a mesh from file.  More...

bool  |  [ publishMesh
](classrviz__visual__tools_1_1RvizVisualTools.html#a1b4e84c6958fd434bbcb2e2277a78cd8)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, const std::string &file_name, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ CLEAR
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a3a91cf12667283beafe6e3732e8bdd20)
, double scale=1, const std::string &ns="mesh", std::size_t id=0)
bool  |  [ publishPath
](classrviz__visual__tools_1_1RvizVisualTools.html#a795dff9e819abd28aace2fedb7913a5a)
(const std::vector< [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
> &path, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ RED
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a269d2451e2a4b2d6744d2d958a8a8467)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, const std::string &ns="Path")
|  Display a marker of a series of connected cylinders.  More...

bool  |  [ publishPath
](classrviz__visual__tools_1_1RvizVisualTools.html#a3d33715345bc1c3eeb6a9982aff95084)
(const std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> &path, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
[ scales


Returns whether the geometry is 2D or 3D.


bool rviz_visual_tools::RvizVisualTools::publishLine  |  (  |  const
Eigen::Vector3d & |  _point1_ ,
---|---|---|---
|  |  const Eigen::Vector3d & |  _point2_ ,
|  |  const std_msgs::ColorRGBA & |  _color_ ,
|  |  double  |  _radius_
|  )  |  |

Definition at line [ 1767 ](rviz__visual__tools_8cpp_source.html#l01767) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  return publishMarker(triangle_marker_);
}


**arg0** ( _numpy.ndarray_ _[_ _float64_ _[_ _4_ _,_ _4_ _]_ _]_ ) â


Definition at line [ 70 ](rviz__visual__tools_8cpp_source.html#l00070) of file
[ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


    case ZYX:
      result = Eigen::Translation3d(tx, ty, tz) * Eigen::AngleAxisd(rz, Eigen::Vector3d::UnitZ()) *
               Eigen::AngleAxisd(ry, Eigen::Vector3d::UnitY()) * Eigen::AngleAxisd(rx, Eigen::Vector3d::UnitX());
      break;


* [ collision_map ](/questions/scope:all/sort:activity-desc/tags:collision_map/page:1/)


bool rviz_visual_tools::RvizVisualTools::publishSphere  |  (  |  const
Eigen::Vector3d & |  _point_ ,
---|---|---|---
|  |  const std_msgs::ColorRGBA & |  _color_ ,
|  |  const geometry_msgs::Vector3  |  _scale_ ,
|  |  const std::string & |  _ns_ = ` "Sphere" ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Definition at line [ 1167 ](rviz__visual__tools_8cpp_source.html#l01167) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  deleteAllMarkers()


Skip to content
Toggle navigation
[ ](https://github.com/)
[ Sign in ](/login?return_to=https%3A%2F%2Fgithub.com%2Fros-
planning%2Fmoveit_visual_tools)
  * Product
    * [ Actions  Automate any workflow  ](/features/actions)
    * [ Packages  Host and manage packages  ](/features/packages)
    * [ Security  Find and fix vulnerabilities  ](/features/security)
    * [ Codespaces  Instant dev environments  ](/features/codespaces)
    * [ Copilot  Write better code with AI  ](/features/copilot)
    * [ Code review  Manage code changes  ](/features/code-review)
    * [ Issues  Plan and track work  ](/features/issues)
    * [ Discussions  Collaborate outside of code  ](/features/discussions)
Explore
    * [ All features ](/features)
    * [ Documentation  ](https://docs.github.com)
    * [ GitHub Skills  ](https://skills.github.com/)
    * [ Blog  ](https://github.blog)
  * Solutions
For
    * [ Enterprise ](/enterprise)
    * [ Teams ](/team)
    * [ Startups ](/enterprise/startups)
    * [ Education  ](https://education.github.com)
By Solution
    * [ CI/CD & Automation ](/solutions/ci-cd/)
    * [ DevOps ](/solutions/devops/)
    * [ DevSecOps  ](https://resources.github.com/devops/fundamentals/devsecops/)
Resources
    * [ Learning Pathways  ](https://resources.github.com/learn/pathways/)
    * [ White papers, Ebooks, Webinars  ](https://resources.github.com/)
    * [ Customer Stories ](/customer-stories)
    * [ Partners  ](https://partner.github.com/)
  * Open Source
    * [ GitHub Sponsors  Fund open source developers  ](/sponsors)
    * [ The ReadME Project  GitHub community articles  ](/readme)
Repositories
    * [ Topics ](/topics)
    * [ Trending ](/trending)


##  ◆  publishMesh()  [2/2]


     pose  |  \- the location to publish the marker with respect to the base frame
---|---
color  |  \- an enum pre-defined name of a color
scale  |  \- an enum pre-defined name of a size
length  |  \- the length of the arrow tail, if zero, will auto set with scale

Returns


##  ◆  convertPointToPose()  [2/2]


    // Only wait for the publisher once, after that just ignore the lack of connection
    pub_rviz_markers_waited_ = true;
  }


true on successful connection


  // Set the pose
  mesh_marker_.pose = pose;


     path  |  \- a series of points to connect with lines
---|---
color  |  \- an enum pre-defined name of a color
scale  |  \- an enum pre-defined name of a size
ns  |  \- namespace of marker

Returns


bool rviz_visual_tools::RvizVisualTools::publishWireframeCuboid  |  (  |
const Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  const Eigen::Vector3d & |  _min_point_ ,
|  |  const Eigen::Vector3d & |  _max_point_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  const std::string & |  _ns_ = ` "Wireframe Cuboid" ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Publish transformed wireframe cuboid. Useful eg to show an oriented bounding
box.


|  void rviz_visual_tools::RvizVisualTools::setAlpha  |  (  |  double  |
_alpha_ |  )  |
---|---|---|---|---|---
inline

Change the transparency of all markers published.


true on success


|  double rviz_visual_tools::RvizVisualTools::dRand  |  (  |  double  |  _min_
,
---|---|---|---
|  |  double  |  _max_
|  )  |  |
static

Get random between min and max.


[ LIME_GREEN
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a9a9f3d5a7f82b82797b6dcc4f204925d)
, [ PURPLE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3ae736e532468e1fc25dee3371cf7f94fd)
, [ CYAN
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3af461e9b8c5f1a9b6c3a37f80c9300c8a)
, [ MAGENTA
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a2ca30973144840065309e7de3e2dabe6)
}


Parameters


std_msgs::ColorRGBA rviz_visual_tools::RvizVisualTools::createRandColor  |  (
|  |  )  |  const
---|---|---|---|---

Create a random color that is not too light.


##  ◆  getIdentityPose()


Definition at line [ 828 ](rviz__visual__tools_8cpp_source.html#l00828) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  return true;
}


std::string RvizVisualTools::scaleToString(scales scale)
{
  // clang-format off
  switch (scale)
  {
    case XXXXSMALL: return "XXXXSMALL"; break;
    case XXXSMALL: return "XXXSMALL"; break;
    case XXSMALL: return "XXSMALL"; break;
    case XSMALL: return "XSMALL"; break;
    case SMALL: return "SMALL"; break;
    case MEDIUM: return "MEDIUM"; break;
    case LARGE: return "LARGE"; break;
    case XLARGE: return "XLARGE"; break;
    case XXLARGE: return "XXLARGE"; break;
    case XXXLARGE: return "XXXLARGE"; break;
    case XXXXLARGE: return "XXXXLARGE"; break;
    default: throw std::runtime_error("Unknown size");
  }
  // clang-format on
  return "MEDIUM";  // dumy value
}


Returns


bool rviz_visual_tools::RvizVisualTools::publishPath  |  (  |  const [
EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
& |  _path_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ RED
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a269d2451e2a4b2d6744d2d958a8a8467)
` ,
|  |  double  |  _radius_ = ` 0.01 ` ,
|  |  const std::string & |  _ns_ = ` "Path" `
|  )  |  |

Definition at line [ 1946 ](rviz__visual__tools_8cpp_source.html#l01946) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


* [ arm_navigation_msgs ](/questions/scope:all/sort:activity-desc/tags:arm_navigation_msgs/page:1/)


##  ◆  publishSpheres()  [3/7]


    case LIME_GREEN:
      result.r = 0.6;
      result.g = 1.0;
      result.b = 0.2;
      result.a = alpha_;
      break;
    case CLEAR:
      result.r = 1.0;
      result.g = 1.0;
      result.b = 1.0;
      result.a = 0.0;
      break;
    case PURPLE:
      result.r = 0.597;
      result.g = 0.0;
      result.b = 0.597;
      result.a = alpha_;
      break;
    case CYAN:
      result.r = 0.0;
      result.g = 1.0;
      result.b = 1.0;
      result.a = alpha_;
      break;
    case MAGENTA:
      result.r = 1.0;
      result.g = 0.0;
      result.b = 1.0;
      result.a = alpha_;
      break;
    case RAND:
      result = createRandColor();
      break;
    case DEFAULT:
      ROS_WARN_STREAM_NAMED(LOGNAME, "The 'DEFAULT' color should probably not "
                                     "be used with getColor(). Defaulting to "
                                     "blue.");
    case BLUE:
    default:
      result.r = 0.1;


Overloaded function.


##  ◆  publishSphere()  [11/11]


converted point


##  ◆  setMarkerTopic()


  std_msgs::ColorRGBA this_color = getColor(color);
  line_list_marker_.scale = getScale(XXSMALL);
  line_list_marker_.scale.y = 0;
  line_list_marker_.scale.z = 0;
  line_list_marker_.color = this_color;
  line_list_marker_.points.clear();
  line_list_marker_.colors.clear();


bool rviz_visual_tools::RvizVisualTools::publishWireframeRectangle  |  (  |
const Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  double  |  _height_ ,
|  |  double  |  _width_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Publish outline of a rectangle.


interpolated color


  // Set marker color
  triangle_marker_.color = getColor(color);


|  void rviz_visual_tools::RvizVisualTools::printTranslation  |  (  |  const
Eigen::Vector3d & |  _translation_ |  )  |
---|---|---|---|---|---
static

Display in the console the x,y,z values of a point.


Parameters


` TetraMesh ` _= Type.TetraMesh_ Â¶


converted pose


##  ◆  name_


Returns the center of the geometry coordinates.


Eigen::Isometry3d RvizVisualTools::convertPointToPose(const Eigen::Vector3d& point)
{
  Eigen::Isometry3d shared_pose_eigen;
  shared_pose_eigen = Eigen::Isometry3d::Identity();
  shared_pose_eigen.translation() = point;
  return shared_pose_eigen;
}


void RvizVisualTools::printTransformFull(const Eigen::Isometry3d& transform)
{
  std::cout << "T.xyz = [" << transform.translation().x() << ", " << transform.translation().y() << ", "
            << transform.translation().z() << "], R = \n"
            << transform.rotation() << "\n";
}


bool RvizVisualTools::publishArrow(const geometry_msgs::Point& start, const geometry_msgs::Point& end, colors color,
                                   scales scale, std::size_t id)
{
  // Set the frame ID and timestamp.
  arrow_marker_.header.stamp = ros::Time::now();
  arrow_marker_.header.frame_id = base_frame_;


##  ◆  publishPath()  [4/9]


Class that defines an oriented box that can be computed from 3D geometries.


bool rviz_visual_tools::RvizVisualTools::publishSphere  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  const std_msgs::ColorRGBA & |  _color_ ,
|  |  const geometry_msgs::Vector3  |  _scale_ ,
|  |  const std::string & |  _ns_ = ` "Sphere" ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Definition at line [ 1161 ](rviz__visual__tools_8cpp_source.html#l01161) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool RvizVisualTools::publishAxisLabeled(const Eigen::Isometry3d& pose, const std::string& label, scales scale,
                                         colors color)
{
  return publishAxisLabeled(convertPose(pose), label, scale, color);
}


  geometry_msgs::Point p[4];
  p[0].x = 1.0 * scale;
  p[0].y = 1.0 * scale;
  p[0].z = 0.0;


Definition at line [ 288 ](rviz__visual__tools_8cpp_source.html#l00288) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  publishZArrow()  [2/4]


|  Eigen::Isometry3d rviz_visual_tools::RvizVisualTools::convertPointToPose  |
(  |  const Eigen::Vector3d & |  _point_ |  )  |
---|---|---|---|---|---
static

Definition at line [ 2484 ](rviz__visual__tools_8cpp_source.html#l02484) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


     pose  |  \- the location to publish the marker with respect to the base frame
---|---
length  |  \- geometry of cylinder
radius  |  \- geometry of cylinder
ns  |  \- namespace

Returns


(const [ EigenSTL::vector_Isometry3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#ac192baa0b919d541fcc5e78cfd3e4769)
&path, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ RED
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a269d2451e2a4b2d6744d2d958a8a8467)
, double radius=0.01, const std::string &ns="Path")
bool  |  [ publishPath
](classrviz__visual__tools_1_1RvizVisualTools.html#a81a5aecae815cae70c25e0ea659b066a)
(const [ EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
&path, const std::vector< [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) > & [
colors ](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3)
, double radius=0.01, const std::string &ns="Path")
|  Display a marker of a series of connected colored cylinders.  More...

bool  |  [ publishPath
](classrviz__visual__tools_1_1RvizVisualTools.html#adeb3f11a1082ff929c52fca0e87d1847)
(const [ EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
&path, const std::vector< std_msgs::ColorRGBA > & [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) ,
double radius, const std::string &ns="Path")
bool  |  [ publishPolygon
](classrviz__visual__tools_1_1RvizVisualTools.html#a512dea42b9ba40becce43d568f6430cf)
(const geometry_msgs::Polygon &polygon, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ RED
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a269d2451e2a4b2d6744d2d958a8a8467)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, const std::string &ns="Polygon")
|  Display a marker of a polygon.  More...

bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#a7ad17aebec96d542305616cd1920138e)
(const Eigen::Isometry3d &pose, [ colors


  return publishMarker(triangle_marker_);
}


bool RvizVisualTools::publishLine(const Eigen::Isometry3d& point1, const Eigen::Isometry3d& point2, colors color,
                                  scales scale)
{
  return publishLine(convertPoseToPoint(point1), convertPoseToPoint(point2), color, scale);
}


  * [ open3d.camera ](open3d.camera.html)
  * [ open3d.color_map ](open3d.color_map.html)
  * [ open3d.geometry ](open3d.geometry.html)
    * [ AxisAlignedBoundingBox ](open3d.geometry.AxisAlignedBoundingBox.html)
    * [ FilterScope ](open3d.geometry.FilterScope.html)
    * [ Geometry ](open3d.geometry.Geometry.html)
    * [ Geometry2D ](open3d.geometry.Geometry2D.html)
    * [ Geometry3D ](open3d.geometry.Geometry3D.html)
    * [ HalfEdge ](open3d.geometry.HalfEdge.html)
    * [ HalfEdgeTriangleMesh ](open3d.geometry.HalfEdgeTriangleMesh.html)
    * [ Image ](open3d.geometry.Image.html)
    * [ ImageFilterType ](open3d.geometry.ImageFilterType.html)
    * [ KDTreeFlann ](open3d.geometry.KDTreeFlann.html)
    * [ KDTreeSearchParam ](open3d.geometry.KDTreeSearchParam.html)
    * [ KDTreeSearchParamHybrid ](open3d.geometry.KDTreeSearchParamHybrid.html)
    * [ KDTreeSearchParamKNN ](open3d.geometry.KDTreeSearchParamKNN.html)
    * [ KDTreeSearchParamRadius ](open3d.geometry.KDTreeSearchParamRadius.html)
    * [ LineSet ](open3d.geometry.LineSet.html)
    * [ Octree ](open3d.geometry.Octree.html)
    * [ OctreeColorLeafNode ](open3d.geometry.OctreeColorLeafNode.html)
    * [ OctreeInternalNode ](open3d.geometry.OctreeInternalNode.html)
    * [ OctreeLeafNode ](open3d.geometry.OctreeLeafNode.html)
    * [ OctreeNode ](open3d.geometry.OctreeNode.html)
    * [ OctreeNodeInfo ](open3d.geometry.OctreeNodeInfo.html)
    * OrientedBoundingBox
    * [ PointCloud ](open3d.geometry.PointCloud.html)
    * [ RGBDImage ](open3d.geometry.RGBDImage.html)
    * [ RotationType ](open3d.geometry.RotationType.html)
    * [ SimplificationContraction ](open3d.geometry.SimplificationContraction.html)
    * [ TetraMesh ](open3d.geometry.TetraMesh.html)
    * [ TriangleMesh ](open3d.geometry.TriangleMesh.html)
    * [ Voxel ](open3d.geometry.Voxel.html)
    * [ VoxelGrid ](open3d.geometry.VoxelGrid.html)
  * [ open3d.io ](open3d.io.html)
  * [ open3d.integration ](open3d.integration.html)
  * [ open3d.odometry ](open3d.odometry.html)
  * [ open3d.registration ](open3d.registration.html)
  * [ open3d.utility ](open3d.utility.html)
  * [ open3d.visualization ](open3d.visualization.html)


    * [ Collections ](/collections)
  * [ Pricing ](/pricing)
Search or jump to...
#  Search code, repositories, users, issues, pull requests...
Search
Clear
[ Search syntax tips ](https://docs.github.com/search-github/github-code-
search/understanding-github-code-search-syntax)
#  Provide feedback
We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel  Submit feedback
#  Saved searches
##  Use saved searches to filter your results more quickly
Name
Query
To see all available qualifiers, see our [ documentation
](https://docs.github.com/search-github/github-code-search/understanding-
github-code-search-syntax) .
Cancel  Create saved search
[ Sign in ](/login?return_to=https%3A%2F%2Fgithub.com%2Fros-
planning%2Fmoveit_visual_tools)
[ Sign up
](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-
name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=ros-
planning%2Fmoveit_visual_tools)
You signed in with another tab or window. [ Reload ]() to refresh your
session.  You signed out in another tab or window. [ Reload ]() to refresh
your session.  You switched accounts on another tab or window. [ Reload ]() to
refresh your session.  Dismiss alert
{{ message }}
[ ros-planning ](/ros-planning) /  **[ moveit_visual_tools ](/ros-
planning/moveit_visual_tools) ** Public
  * [ Notifications ](/login?return_to=%2Fros-planning%2Fmoveit_visual_tools)
  * [ Fork  100  ](/login?return_to=%2Fros-planning%2Fmoveit_visual_tools)
  * [ Star  140  ](/login?return_to=%2Fros-planning%2Fmoveit_visual_tools)
  *
Helper functions for displaying and debugging MoveIt! data in Rviz via
published markers
###  License


  // Set marker size
  mesh_marker_.scale.x = scale;
  mesh_marker_.scale.y = scale;
  mesh_marker_.scale.z = scale;


##  ◆  resetMarkerCounts()


    default:
      ROS_ERROR_STREAM("Invalid euler convention entry " << convention);
      break;
  }


bool rviz_visual_tools::RvizVisualTools::publishLine  |  (  |  const
Eigen::Isometry3d & |  _point1_ ,
---|---|---|---
|  |  const Eigen::Isometry3d & |  _point2_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
`
|  )  |  |

Display a marker of line.


](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
)
|  Display a marker of line.  More...

bool  |  [ publishLine
](classrviz__visual__tools_1_1RvizVisualTools.html#a89fe35f17372940c3212ae278a581a80)
(const Eigen::Vector3d &point1, const Eigen::Vector3d &point2, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
)
bool  |  [ publishLine
](classrviz__visual__tools_1_1RvizVisualTools.html#a2c2070bade352e3b8690efd426e285ba)
(const Eigen::Vector3d &point1, const Eigen::Vector3d &point2, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
double radius)
bool  |  [ publishLine
](classrviz__visual__tools_1_1RvizVisualTools.html#aac4be4a3454bb74b655a786c866e5ba4)
(const Eigen::Vector3d &point1, const Eigen::Vector3d &point2, const
std_msgs::ColorRGBA &color, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
)
bool  |  [ publishLine
](classrviz__visual__tools_1_1RvizVisualTools.html#af47f451c240981ba8e2cb5cac674eb6c)
(const Eigen::Vector3d &point1, const Eigen::Vector3d &point2, const
std_msgs::ColorRGBA &color, double radius)
bool  |  [ publishLine
](classrviz__visual__tools_1_1RvizVisualTools.html#a00edf8fe9b0ef147297ea836f72927de)
(const [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
&point1, const [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)


bool RvizVisualTools::publishXZPlane(const Eigen::Isometry3d& pose, colors color, double scale)
{
  return publishXZPlane(convertPose(pose), color, scale);
}


  // Add each point pair to the line message
  line_list_marker_.points.push_back(convertPoint(p1));
  line_list_marker_.points.push_back(convertPoint(p2));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


bool RvizVisualTools::publishCylinder(const Eigen::Isometry3d& pose, colors color, double height, double radius,
                                      const std::string& ns)
{
  return publishCylinder(convertPose(pose), color, height, radius, ns);
}


bool rviz_visual_tools::RvizVisualTools::publishLine  |  (  |  const [
geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
& |  _point1_ ,
---|---|---|---
|  |  const [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
& |  _point2_ ,
|  |  const std_msgs::ColorRGBA & |  _color_ ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
`
|  )  |  |

Definition at line [ 1783 ](rviz__visual__tools_8cpp_source.html#l01783) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool rviz_visual_tools::RvizVisualTools::publishCuboid  |  (  |  const [
geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
& |  _point1_ ,
---|---|---|---
|  |  const [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
& |  _point2_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  const std::string & |  _ns_ = ` "Cuboid" ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Definition at line [ 1645 ](rviz__visual__tools_8cpp_source.html#l01645) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Definition at line [ 1564 ](rviz__visual__tools_8cpp_source.html#l01564) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


[ **asked 2014-06-16 15:13:34 -0500  ** ](/questions/173756/revisions/)


  if (id == 0)
  {
    sphere_marker_.id++;
  }
  else
  {
    sphere_marker_.id = id;
  }


Solved. Added Q_OBJECT and Q_SLOTS arguments. Also added fixed_frame_ argument
to MessageFilter in collision_map_display.cpp. Works fine now.


` TetraMesh ` _= Type.TetraMesh_ Â¶


    p[1].x = scale;
    p[1].y = scale * cos(theta) / angle;
    p[1].z = scale * sin(theta) / angle;


bool RvizVisualTools::publishPath(const std::vector<geometry_msgs::Pose>& path, colors color, scales scale,
                                  const std::string& ns)
{
  std::vector<geometry_msgs::Point> point_path(path.size());
  for (std::size_t i = 0; i < path.size(); ++i)
  {
    point_path[i] = path[i].position;
  }


  return convertFromXYZRPY(transform6[0], transform6[1], transform6[2], transform6[3], transform6[4], transform6[5],
                           convention);
}


bool RvizVisualTools::publishPath(const EigenSTL::vector_Vector3d& path, colors color, double radius,
                                  const std::string& ns)
{
  if (path.size() < 2)
  {
    ROS_WARN_STREAM_NAMED(LOGNAME, "Skipping path because " << path.size() << " points passed in.");
    return false;
  }


##  ◆  publishArrow()  [2/4]


     pose  |  \- the location to publish the sphere with respect to the base frame
---|---
color  |  \- an enum pre-defined name of a color
scale  |  \- an enum pre-defined name of a size
ns  |  \- namespace of marker
id  |  \- unique counter of mesh that allows you to overwrite a previous mesh.
if 0, defaults to incremental counter

Returns


true on success


bool rviz_visual_tools::RvizVisualTools::publishArrow  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  double  |  _length_ = ` 0.0 ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Display an arrow along the x-axis of a pose.


  return publishSpheres(points_msg, color, scale, ns);
}


##  ◆  getBaseFrame()


](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
)
|  Display a marker of lines.  More...

bool  |  [ publishLines
](classrviz__visual__tools_1_1RvizVisualTools.html#a66e65ae4a8d1a13a2d2121d78b667e6f)
(const std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> &aPoints, const std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> &bPoints, const std::vector< std_msgs::ColorRGBA > & [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) , const
geometry_msgs::Vector3 &scale)
bool  |  [ publishLineStrip
](classrviz__visual__tools_1_1RvizVisualTools.html#a11198dcaa9d38beea590ebd62a573bea)
(const std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> &path, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ RED
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a269d2451e2a4b2d6744d2d958a8a8467)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, const std::string &ns="Path")
|  Display a series of connected lines using the LINE_STRIP method -
deprecated because visual bugs.  More...

bool  |  [ publishMarker
](classrviz__visual__tools_1_1RvizVisualTools.html#af4da51b7d1616a1780d9a6519ddb9701)
(visualization_msgs::Marker &marker)
|  Display a visualization_msgs Marker of a custom type. Allows reuse of the
ros publisher.  More...

bool  |  [ publishMarkers
](classrviz__visual__tools_1_1RvizVisualTools.html#a24d37fc8e373f5dd91293ec484f41151)
(visualization_msgs::MarkerArray &markers)
|  Display an array of markers, allows reuse of the ROS publisher.  More...


bool rviz_visual_tools::RvizVisualTools::publishPath  |  (  |  const [
EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
& |  _path_ ,
---|---|---|---
|  |  const std::vector< std_msgs::ColorRGBA > & |  _colors_ ,
|  |  double  |  _radius_ ,
|  |  const std::string & |  _ns_ = ` "Path" `
|  )  |  |

Definition at line [ 2007 ](rviz__visual__tools_8cpp_source.html#l02007) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  // Helper for publishing rviz markers
  return publishMarker(cuboid_marker_);
}


bool RvizVisualTools::publishYArrow(const geometry_msgs::Pose& pose, colors color, scales scale, double length)
{
  Eigen::Isometry3d arrow_pose = convertPose(pose) * Eigen::AngleAxisd(M_PI / 2, Eigen::Vector3d::UnitZ());
  return publishArrow(convertPose(arrow_pose), color, scale, length);
}


` get_max_bound ` (  _self_ )  Â¶


##  ◆  publishAxis()  [3/4]


##  ◆  getGlobalScale()


bool RvizVisualTools::publishZArrow(const geometry_msgs::Pose& pose, colors color, scales scale, double length)
{
  Eigen::Isometry3d arrow_pose = convertPose(pose) * Eigen::AngleAxisd(-M_PI / 2, Eigen::Vector3d::UnitY());
  return publishArrow(convertPose(arrow_pose), color, scale, length);
}


bool RvizVisualTools::publishLines(const std::vector<geometry_msgs::Point>& aPoints,
                                   const std::vector<geometry_msgs::Point>& bPoints,
                                   const std::vector<std_msgs::ColorRGBA>& colors, const geometry_msgs::Vector3& scale)
{
  // Setup marker
  line_list_marker_.header.stamp = ros::Time();
  line_list_marker_.ns = "Line Array";


     pose  |  \- cuboid vertices are transformed according to it
---|---
min_point  |  \- minimum x, y, z coordinates
max_point  |  \- maximum x, y, z coordinates
color  |  \- an enum pre-defined name of a color
ns  |  \- namespace
id  |  \- unique counter that allows you to overwrite a previous marker. if 0,
defaults to incremental counter

Returns


  if (height <= 0)
  {
    cuboid_marker_.scale.z = SMALL_SCALE;
  }
  else
  {
    cuboid_marker_.scale.z = height;
  }


` transform ` (  _self_ , _arg0_ )  Â¶


##  Comments


Definition at line [ 78 ](rviz__visual__tools_8cpp_source.html#l00078) of file
[ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


converted pose


// Conversions
#include <tf2_eigen/tf2_eigen.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2/convert.h>


std_msgs::ColorRGBA RvizVisualTools::createRandColor() const
{
  std_msgs::ColorRGBA result;


  return result;
}


` Image ` _= Type.Image_ Â¶


##  ◆  publishZArrow()  [1/4]


Returns the eight points that define the bounding box.


* [ octomap_server ](/questions/scope:all/sort:activity-desc/tags:octomap_server/page:1/)


|  [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
rviz_visual_tools::RvizVisualTools::convertPoseToPoint  |  (  |  const
Eigen::Isometry3d & |  _pose_ |  )  |
---|---|---|---|---|---
static

Convert an [ Eigen ](../../../api/rviz/html/c++/namespaceEigen.html) pose to a
geometry_msg point Note: Not thread safe but very convenient.


  for (std::size_t i = 0; i < aPoints.size(); ++i)
  {
    // Convert Eigen to ROS Msg
    a_points_msg.push_back(convertPoint(aPoints[i]));
    b_points_msg.push_back(convertPoint(bPoints[i]));
    // Convert color to ROS Msg
    colors_msg.push_back(getColor(colors[i]));
  }
  BOOST_ASSERT_MSG(a_points_msg.size() == b_points_msg.size() && b_points_msg.size() == colors_msg.size(),
                   "Mismatched "
                   "vector sizes");


Built with [ Sphinx ](http://sphinx-doc.org/) using a [ theme
](https://github.com/rtfd/sphinx_rtd_theme) provided by [ Read the Docs
](https://readthedocs.org) .


interpolated value


Definition at line [ 2508 ](rviz__visual__tools_8cpp_source.html#l02508) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  // Orientation
  generateRandomPose(cuboid_pose, pose_bounds);
}


##  ◆  publishMarker()


Apply translation to the geometry coordinates.


bool rviz_visual_tools::RvizVisualTools::publishCuboid  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  double  |  _depth_ ,
|  |  double  |  _width_ ,
|  |  double  |  _height_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
`
|  )  |  |

Definition at line [ 1693 ](rviz__visual__tools_8cpp_source.html#l01693) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


[ Visualizing Octomaps on RVIZ [closed] ](/question/228619/visualizing-
octomaps-on-rviz/)


     pose  |  \- the location to publish the marker with respect to the base frame
---|---
color  |  \- an enum pre-defined name of a color
scale  |  \- an enum pre-defined name of a size
length  |  \- how long the arrow tail should be. if zero, will auto set with
scale
start  |  \- the starting point of the arrow
end  |  \- the ending point of the arrow

Returns


##  Public Member Functions

---
std_msgs::ColorRGBA  |  [ createRandColor
](classrviz__visual__tools_1_1RvizVisualTools.html#a49e96e1e3015ab884f7400cf6867f4f4)
() const
|  Create a random color that is not too light.  More...

bool  |  [ deleteAllMarkers
](classrviz__visual__tools_1_1RvizVisualTools.html#a93e7ee229b27f759bb2efd6e2e4fbffd)
()
|  Tell Rviz to clear all markers on a particular display.  More...

void  |  [ enableBatchPublishing
](classrviz__visual__tools_1_1RvizVisualTools.html#ae5a319d3660b79069958779ac4270045)
(bool enable=true)
|  Enable batch publishing - useful for when many markers need to be published
at once and the ROS topic can get overloaded. This collects all published
markers into array and only publishes them with [ trigger()
](classrviz__visual__tools_1_1RvizVisualTools.html#a4497fb175c96a2538e5b175c05667732
"Trigger the publish function to send out all collected markers. ") is called.
More...

void  |  [ enableFrameLocking
](classrviz__visual__tools_1_1RvizVisualTools.html#aea33a97acd47cea29ed8f69c8b6c9645)
(bool enable=true)
|  Enable frame locking - useful for when the markers is attached to a moving
TF, the marker will be re-transformed into its frame every time-step.  More...

const std::string  |  [ getBaseFrame
](classrviz__visual__tools_1_1RvizVisualTools.html#ac921e36d020e870cda997f4fa1ee213a)
() const
|  Get the base frame.  More...

Eigen::Vector3d  |  [ getCenterPoint
](classrviz__visual__tools_1_1RvizVisualTools.html#aef56f2c93034be016d3d7211cb6aef3f)
(const Eigen::Vector3d & [ a
](../../../api/rosconsole_bridge/html/cleanup_8cpp.html#a0786995eefc76ce4716f6ed5f19c9786)
, const Eigen::Vector3d &b) const
|  Find the center between to points.  More...


Definition at line [ 2771 ](rviz__visual__tools_8cpp_source.html#l02771) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  reset_marker_


` get_geometry_type ` (  _self_ )  Â¶


##  ◆  printTransformFull()


[ ![ gravatar image]() ]() [ ]() (  2024-04-15 17:07:10 -0500  )  edit


  arrow_marker_.points.clear();
  arrow_marker_.points.push_back(start);
  arrow_marker_.points.push_back(end);
  arrow_marker_.color = getColor(color);
  arrow_marker_.scale = getScale(scale);


|  void rviz_visual_tools::RvizVisualTools::initialize  |  (  |  |  )  |
---|---|---|---|---
private

Shared function for initilization by constructors.


Definition at line [ 1740 ](rviz__visual__tools_8cpp_source.html#l01740) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  generateRandomCuboid()


Returns


Parameters


[ Hi there! Please sign in
](/account/signin/?next=/question/173756/collision_map_out-via-
mapping_rviz_plugin-not-displaying-in-octomap_server/) [ help ](/help/ "help")


  // Create the cylinders
  for (std::size_t i = 1; i < path.size(); ++i)
  {
    publishCylinder(path[i - 1], path[i], colors[i], radius, ns);
  }


##  ◆  publishPath()  [5/9]


|  visualization_msgs::MarkerArray
rviz_visual_tools::RvizVisualTools::markers_
---
protected

Definition at line [ 1086 ](rviz__visual__tools_8h_source.html#l01086) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


true on success


void RvizVisualTools::loadMarkerPub(bool wait_for_subscriber, bool latched)
{
  if (pub_rviz_markers_ != nullptr)
  {
    return;
  }


  // Setup marker
  line_list_marker_.header.stamp = ros::Time();
  line_list_marker_.ns = "Wireframe Rectangle";


##  ◆  getColor()


##  ◆  publishCuboid()  [3/4]


  triangle_marker_.color = getColor(color);
  triangle_marker_.pose = pose;


     pose  |  \- the location to publish the marker with respect to the base frame
---|---
color  |  \- an enum pre-defined name of a color
scale  |  \- an enum pre-defined name of a size
length  |  \- the length of the arrow tail, if zero, will auto set with scale

Returns


  line_list_marker_.points.push_back(convertPoint(p3));
  line_list_marker_.points.push_back(convertPoint(p4));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


###
[ resources ](/ros-planning/moveit_visual_tools/tree/ros2/resources
"resources")
|
###
[ resources ](/ros-planning/moveit_visual_tools/tree/ros2/resources
"resources")
|
|

###
[ src ](/ros-planning/moveit_visual_tools/tree/ros2/src "src")
|
###
[ src ](/ros-planning/moveit_visual_tools/tree/ros2/src "src")
|
|

###
[ .clang-format ](/ros-planning/moveit_visual_tools/blob/ros2/.clang-format
".clang-format")
|
###
[ .clang-format ](/ros-planning/moveit_visual_tools/blob/ros2/.clang-format
".clang-format")
|
|

###
[ .clang-tidy ](/ros-planning/moveit_visual_tools/blob/ros2/.clang-tidy
".clang-tidy")
|
###
[ .clang-tidy ](/ros-planning/moveit_visual_tools/blob/ros2/.clang-tidy
".clang-tidy")
|
|

###
[ .pre-commit-config.yaml ](/ros-planning/moveit_visual_tools/blob/ros2/.pre-


bool RvizVisualTools::publishXArrow(const Eigen::Isometry3d& pose, colors color, scales scale, double length)
{
  return publishArrow(convertPose(pose), color, scale, length);
}


      result.g = 0.1;
      result.b = 0.1;
      result.a = 0.1;
      break;
    case TRANSLUCENT:
      result.r = 0.1;
      result.g = 0.1;
      result.b = 0.1;
      result.a = 0.25;
      break;
    case TRANSLUCENT_DARK:
      result.r = 0.1;
      result.g = 0.1;
      result.b = 0.1;
      result.a = 0.5;
      break;
    case BLACK:
      result.r = 0.0;
      result.g = 0.0;
      result.b = 0.0;
      result.a = alpha_;
      break;
    case YELLOW:
      result.r = 1.0;
      result.g = 1.0;
      result.b = 0.0;
      result.a = alpha_;
      break;
    case BROWN:
      result.r = 0.597;
      result.g = 0.296;
      result.b = 0.0;
      result.a = alpha_;
      break;
    case PINK:
      result.r = 1.0;
      result.g = 0.4;
      result.b = 1;
      result.a = alpha_;
      break;


##  ◆  pub_rviz_markers_


|  [ Ask Your Question ](/questions/ask/)
---|---|---|---

0


bool rviz_visual_tools::RvizVisualTools::publishPath  |  (  |  const [
EigenSTL::vector_Isometry3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#ac192baa0b919d541fcc5e78cfd3e4769)
& |  _path_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ RED
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a269d2451e2a4b2d6744d2d958a8a8467)
` ,
|  |  double  |  _radius_ = ` 0.01 ` ,
|  |  const std::string & |  _ns_ = ` "Path" `
|  )  |  |

Definition at line [ 1964 ](rviz__visual__tools_8cpp_source.html#l01964) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  p[1].x = -1.0 * scale;
  p[1].y = 0;
  p[1].z = 1.0 * scale;


  // Update cached markers
  arrow_marker_.lifetime = marker_lifetime_;
  cuboid_marker_.lifetime = marker_lifetime_;
  line_strip_marker_.lifetime = marker_lifetime_;
  sphere_marker_.lifetime = marker_lifetime_;
  block_marker_.lifetime = marker_lifetime_;
  mesh_marker_.lifetime = marker_lifetime_;
  cylinder_marker_.lifetime = marker_lifetime_;
  text_marker_.lifetime = marker_lifetime_;
}


bool RvizVisualTools::publishZArrow(const geometry_msgs::PoseStamped& pose, colors color, scales scale, double length)
{
  Eigen::Isometry3d arrow_pose = convertPose(pose.pose) * Eigen::AngleAxisd(-M_PI / 2, Eigen::Vector3d::UnitY());
  geometry_msgs::PoseStamped new_pose = pose;
  new_pose.pose = convertPose(arrow_pose);
  return publishArrow(new_pose, color, scale, length);
}


cuboid_marker_.pose = pose;


void RvizVisualTools::generateRandomPose(geometry_msgs::Pose& pose, RandomPoseBounds pose_bounds)
{
  Eigen::Isometry3d pose_eigen;
  generateRandomPose(pose_eigen, pose_bounds);
  pose = convertPose(pose_eigen);
}


|  Eigen::Isometry3d rviz_visual_tools::RvizVisualTools::convertFromXYZRPY  |
(  |  const std::vector< double > & |  _transform6_ ,
---|---|---|---
|  |  [ EulerConvention
](namespacerviz__visual__tools.html#a25a0ae702485241183604425b99eb8c6) |
_convention_
|  )  |  |
static

Definition at line [ 2574 ](rviz__visual__tools_8cpp_source.html#l02574) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool  |  [ publishWireframeCuboid
](classrviz__visual__tools_1_1RvizVisualTools.html#a3cc3ed5a9e236d8c88c87438acfca9c8)
(const Eigen::Isometry3d &pose, double depth, double width, double height, [
colors ](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3)
color= [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, const std::string &ns="Wireframe Cuboid", std::size_t id=0)
|  Publish transformed wireframe cuboid. Useful eg to show an oriented
bounding box.  More...

bool  |  [ publishWireframeCuboid
](classrviz__visual__tools_1_1RvizVisualTools.html#a6a408296e7dd2535736e406904337d40)
(const Eigen::Isometry3d &pose, const Eigen::Vector3d &min_point, const
Eigen::Vector3d &max_point, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, const std::string &ns="Wireframe Cuboid", std::size_t id=0)
|  Publish transformed wireframe cuboid. Useful eg to show an oriented
bounding box.  More...

bool  |  [ publishWireframeRectangle
](classrviz__visual__tools_1_1RvizVisualTools.html#aa2aead3e1744985588b81b6337345a6d)
(const Eigen::Isometry3d &pose, double height, double width, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, std::size_t id=0)
|  Publish outline of a rectangle.  More...

bool  |  [ publishWireframeRectangle
](classrviz__visual__tools_1_1RvizVisualTools.html#ae425f367933971bb53c839074cd75777)
(const Eigen::Isometry3d &pose, const Eigen::Vector3d &p1_in, const
Eigen::Vector3d &p2_in, const Eigen::Vector3d &p3_in, const Eigen::Vector3d
&p4_in, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,


  // Helper for publishing rviz markers
  return publishMarker(arrow_marker_);
}


edit


  line_list_marker_.points.push_back(convertPoint(p4));
  line_list_marker_.points.push_back(convertPoint(p8));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


##  ◆  setPsychedelicMode()


Definition at line [ 1494 ](rviz__visual__tools_8cpp_source.html#l01494) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


|  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3)
rviz_visual_tools::RvizVisualTools::getRandColor  |  (  |  |  )  |
---|---|---|---|---
static

Get a random color from the list of hardcoded enum color types.


Parameters


  // Set marker color
  cylinder_marker_.color = color;


  double theta = axis_vector.dot(up_vector);
  double angle_rotation = -1.0 * acos(theta);


Definition at line [ 1401 ](rviz__visual__tools_8cpp_source.html#l01401) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


std_msgs::ColorRGBA  |  [ getColor
](classrviz__visual__tools_1_1RvizVisualTools.html#a9161a302cd99d1087a1e1d28656508ab)
( [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color)
const
|  Get the RGB value of standard colors.  More...

std_msgs::ColorRGBA  |  [ getColorScale
](classrviz__visual__tools_1_1RvizVisualTools.html#ae7fa29758ce0603dbce13fce4b9f776a)
(double value) const
|  Convert a value from [0,1] to a color Green->Red.  More...

double  |  [ getGlobalScale
](classrviz__visual__tools_1_1RvizVisualTools.html#a48db5b207828dd154feab478b7c22fcb)
() const
|  Getter for the global scale used for changing size of all markers.  More...

bool  |  [ getPsychedelicMode
](classrviz__visual__tools_1_1RvizVisualTools.html#a7824794aa1de8065119f1be27bbbc60d)
() const
|  Getter for PsychedelicMode.  More...

[ RemoteControlPtr
](namespacerviz__visual__tools.html#a86b96f423e9a60fd4df818a41e065921) & |  [
getRemoteControl
](classrviz__visual__tools_1_1RvizVisualTools.html#a5dce94b765502284e67942691ecd54fa)
()
|  Ability to load remote control on the fly.  More...

geometry_msgs::Vector3  |  [ getScale
](classrviz__visual__tools_1_1RvizVisualTools.html#aa3a1d3bbb7bb9e8937253a81683d8341)
( [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale,
double marker_scale=1.0) const
|  Get the rviz marker scale of standard sizes.  More...

Eigen::Isometry3d  |  [ getVectorBetweenPoints
](classrviz__visual__tools_1_1RvizVisualTools.html#a14c4952da25772f9a9b42c6653c0f89f)
(const Eigen::Vector3d & [ a


     pose  |  \- cuboid vertices are transformed according to it
---|---
depth  |  \- object depth
width  |  \- object width
height  |  \- object height
color  |  \- an enum pre-defined name of a color
ns  |  \- namespace
id  |  \- unique counter of mesh that allows you to overwrite a previous mesh.
if 0, defaults to incremental counter

Returns


std_msgs::ColorRGBA rviz_visual_tools::RvizVisualTools::getColorScale  |  (  |
double  |  _value_ |  )  |  const
---|---|---|---|---|---

Convert a value from [0,1] to a color Green->Red.


bool rviz_visual_tools::RvizVisualTools::publishCylinder  |  (  |  const
Eigen::Vector3d & |  _point1_ ,
---|---|---|---
|  |  const Eigen::Vector3d & |  _point2_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  const std::string & |  _ns_ = ` "Cylinder" `
|  )  |  |

Display a marker of a cylinder.


Eigen::Isometry3d RvizVisualTools::convertPoint32ToPose(const geometry_msgs::Point32& point)
{
  Eigen::Isometry3d shared_pose_eigen;
  shared_pose_eigen = Eigen::Isometry3d::Identity();
  shared_pose_eigen.translation().x() = point.x;
  shared_pose_eigen.translation().y() = point.y;
  shared_pose_eigen.translation().z() = point.z;
  return shared_pose_eigen;
}


bool rviz_visual_tools::RvizVisualTools::publishCylinder  |  (  |  const
Eigen::Vector3d & |  _point1_ ,
---|---|---|---
|  |  const Eigen::Vector3d & |  _point2_ ,
|  |  const std_msgs::ColorRGBA & |  _color_ ,
|  |  double  |  _radius_ = ` 0.01 ` ,
|  |  const std::string & |  _ns_ = ` "Cylinder" `
|  )  |  |

Definition at line [ 1507 ](rviz__visual__tools_8cpp_source.html#l01507) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  triangle_marker_.points.push_back(p[2]);
  triangle_marker_.points.push_back(p[3]);
  triangle_marker_.points.push_back(p[0]);


bool rviz_visual_tools::RvizVisualTools::publishZArrow  |  (  |  const
geometry_msgs::PoseStamped & |  _pose_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  double  |  _length_ = ` 0.0 `
|  )  |  |

Definition at line [ 1275 ](rviz__visual__tools_8cpp_source.html#l01275) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


|  rviz_visual_tools::RvizVisualTools::~RvizVisualTools  |  (  |  |  )  |
---|---|---|---|---
inline

Deconstructor.


    triangle_marker_.points.push_back(p[0]);
    triangle_marker_.points.push_back(p[1]);
    triangle_marker_.points.push_back(p[2]);


true on success


bool RvizVisualTools::publishSphere(const Eigen::Vector3d& point, colors color, scales scale, const std::string& ns,
                                    std::size_t id)
{
  geometry_msgs::Pose pose_msg;
  tf2::convert(point, pose_msg.position);
  return publishSphere(pose_msg, color, scale, ns, id);
}


geometry_msgs::Point32 RvizVisualTools::convertPoint32(const Eigen::Vector3d& point)
{
  geometry_msgs::Point32 point32_msg;
  point32_msg.x = point[0];
  point32_msg.y = point[1];
  point32_msg.z = point[2];
  return point32_msg;
}


  // Helper for publishing rviz markers
  return publishMarker(line_list_marker_);
}


colors RvizVisualTools::getRandColor()
{
  const int rand_num = iRand(0, ALL_RAND_COLORS.size() - 1);
  return ALL_RAND_COLORS[rand_num];
}


  cuboid_marker_.id++;
  cuboid_marker_.color = getColor(color);


##  ◆  block_marker_


  // Provide a new id every call to this function
  line_list_marker_.id++;


` dimension ` (  _self_ )  Â¶


[ Removing points from collision maps [closed] ](/question/39377/removing-
points-from-collision-maps/)


Returns min bounds for geometry coordinates.


Definition at line [ 925 ](rviz__visual__tools_8cpp_source.html#l00925) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool RvizVisualTools::trigger()
{
  if (!batch_publishing_enabled_)
  {
    ROS_WARN_STREAM_NAMED(LOGNAME, "Batch publishing triggered but it was not enabled (unnecessary function call)");
  }
  if (markers_.markers.empty())
  {
    // ROS_WARN_STREAM_NAMED(LOGNAME, "Batch publishing triggered but queue is empty (unnecessary function call)");
    return false;
  }


Eigen::Isometry3d RvizVisualTools::convertPose(const geometry_msgs::Pose& pose)
{
  Eigen::Isometry3d shared_pose_eigen;
  tf2::convert(pose, shared_pose_eigen);
  return shared_pose_eigen;
}


  if (id == 0)
  {
    arrow_marker_.id++;
  }
  else
  {
    arrow_marker_.id = id;
  }


##  ◆  publishZArrow()  [3/4]


##  ◆  publishYZPlane()  [1/2]


  // Set the marker action.  Options are ADD and DELETE
  mesh_marker_.action = visualization_msgs::Marker::ADD;
  // Set the marker type.
  mesh_marker_.type = visualization_msgs::Marker::MESH_RESOURCE;
  // Lifetime
  mesh_marker_.lifetime = marker_lifetime_;
  // Constants
  mesh_marker_.pose = getIdentityPose();


Definition at line [ 1262 ](rviz__visual__tools_8cpp_source.html#l01262) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


void rviz_visual_tools::RvizVisualTools::enableFrameLocking  |  (  |  bool  |
_enable_ = ` true ` |  )  |
---|---|---|---|---|---

Enable frame locking - useful for when the markers is attached to a moving TF,
the marker will be re-transformed into its frame every time-step.


void RvizVisualTools::waitForMarkerPub(double wait_time)
{
  bool blocking = false;
  waitForSubscriber(pub_rviz_markers_, wait_time, blocking);
}


Definition at line [ 2535 ](rviz__visual__tools_8cpp_source.html#l02535) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


|  [ convertPoseToPoint
](classrviz__visual__tools_1_1RvizVisualTools.html#a3caaa1441173095071fa44e297d53209)
(const Eigen::Isometry3d &pose)
|  Convert an [ Eigen ](../../../api/rviz/html/c++/namespaceEigen.html) pose
to a geometry_msg point Note: Not thread safe but very convenient.  More...

static void  |  [ convertToXYZRPY
](classrviz__visual__tools_1_1RvizVisualTools.html#aed25e33b34b5f47b6e9c6cf0a45d709f)
(const Eigen::Isometry3d &pose, std::vector< double > &xyzrpy)
|  Convert an affine3d to xyz rpy components R-P-Y / X-Y-Z / 0-1-2 Euler Angle
Standard.  More...

static void  |  [ convertToXYZRPY
](classrviz__visual__tools_1_1RvizVisualTools.html#a06a47e77b73dca2782c508f7fb8f7342)
(const Eigen::Isometry3d &pose, double &x, double &y, double &z, double &roll,
double &pitch, double &yaw)
static double  |  [ dRand
](classrviz__visual__tools_1_1RvizVisualTools.html#ab4394a46e718229a3a287ebc2f674d30)
(double [ min
](../../../api/roslz4/html/lz4s_8c.html#abd8bbcfabb3ddef2ccaafb9928a37b95) ,
double [ max
](../../../api/orocos_kdl/html/namespaceKDL.html#adb3f6f67f41bc87f6d98423ac7a5b92f)
)
|  Get random between min and max.  More...

static float  |  [ fRand
](classrviz__visual__tools_1_1RvizVisualTools.html#acd50ba5bd96ef3d2e9dbf33901cf759b)
(float [ min
](../../../api/roslz4/html/lz4s_8c.html#abd8bbcfabb3ddef2ccaafb9928a37b95) ,
float [ max
](../../../api/orocos_kdl/html/namespaceKDL.html#adb3f6f67f41bc87f6d98423ac7a5b92f)
)
static void  |  [ generateEmptyPose
](classrviz__visual__tools_1_1RvizVisualTools.html#a10c09f2fb485ae7341182c4bf2184551)
( [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose)
|  Create a pose of position (0,0,0) and quaternion (0,0,0,1)  More...

static void  |  [ generateRandomCuboid


Definition at line [ 84 ](rviz__visual__tools_8cpp_source.html#l00084) of file
[ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


|  void rviz_visual_tools::RvizVisualTools::generateRandomPose  |  (  |
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  [ RandomPoseBounds ](structrviz__visual__tools_1_1RandomPoseBounds.html)
|  _pose_bounds_ = ` [ RandomPoseBounds
](structrviz__visual__tools_1_1RandomPoseBounds.html) () `
|  )  |  |
static

Definition at line [ 2626 ](rviz__visual__tools_8cpp_source.html#l02626) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  publishCuboid()  [4/4]


  for (std::size_t i = 0; i < NUM_VARS; ++i)
  {
    if (fabs(pose1.data()[i] - pose2.data()[i]) > threshold)
    {
      return false;
    }
  }


bool rviz_visual_tools::RvizVisualTools::deleteAllMarkers  |  (  |  |  )  |
---|---|---|---|---

Tell Rviz to clear all markers on a particular display.


     scale  |  \- an enum pre-defined name of a size
---|---
marker_scale  |  \- amount to scale the scale for accounting for different
types of markers

Returns


##  ◆  nh_


|  visualization_msgs::Marker
rviz_visual_tools::RvizVisualTools::sphere_marker_
---
protected

Definition at line [ 1090 ](rviz__visual__tools_8h_source.html#l01090) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


Definition at line [ 184 ](rviz__visual__tools_8h_source.html#l00184) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


bool rviz_visual_tools::RvizVisualTools::publishLine  |  (  |  const
Eigen::Vector3d & |  _point1_ ,
---|---|---|---
|  |  const Eigen::Vector3d & |  _point2_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ ,
|  |  double  |  _radius_
|  )  |  |

Definition at line [ 1751 ](rviz__visual__tools_8cpp_source.html#l01751) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  // Provide a new id every call to this function
  spheres_marker_.id++;


` TriangleMesh ` _= Type.TriangleMesh_ Â¶


ROS Resources: [ Documentation ](http://wiki.ros.org/) | [ Support
](http://wiki.ros.org/Support) | [ Discussion Forum
](http://discourse.ros.org/) | [ Index ](http://index.ros.org/) | [ Service
Status ](http://status.ros.org/) | [ ros @ Robotics Stack Exchange
](https://robotics.stackexchange.com/questions/tagged/ros)
---

_Attention:_ Answers.ros.org is deprecated as of August the 11th, 2023. Please
visit [ robotics.stackexchange.com ](http://robotics.stackexchange.com) to ask
a new question. This site will remain online in read-only mode during the
transition and into the foreseeable future. Selected questions and answers
have been migrated, and redirects have been put in place to direct users to
the corresponding questions on Robotics Stack Exchange. Additional details are
[ available here ](https://discourse.ros.org/t/ros-and-gazebo-answers-
migration-to-robotics-stack-exchange-process/31494) .


bool RvizVisualTools::publishAxisPath(const EigenSTL::vector_Isometry3d& path, double length, double radius,
                                      const std::string& ns)
{
  // Create the cylinders
  for (const auto& i : path)
  {
    publishAxisInternal(i, length, radius, ns);
  }


The methods are from the source code, collision_map_display.cpp and `
collision_map_display.h ` (here for completeness' sake):


|  Display in the console a transform in roll pitch yaw.  More...

static void  |  [ printTranslation
](classrviz__visual__tools_1_1RvizVisualTools.html#afdd8fc121f5b39f164244790435a1148)
(const Eigen::Vector3d &translation)
|  Display in the console the x,y,z values of a point.  More...

static std::string  |  [ scaleToString
](classrviz__visual__tools_1_1RvizVisualTools.html#ad09aac022deff42758cac54615a33244)
( [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale)
|  Convert an enum to its string name equivalent.  More...

static double  |  [ slerp
](classrviz__visual__tools_1_1RvizVisualTools.html#a53803110a69dc9bea447d865c9406877)
(double [ start
](../../../api/roscpp/html/namespaceros.html#add7faea1768dbd48d3fe2970204c3422)
, double end, double range, double value)
|  Interpolate from [start, end] with value of size steps with current value
count.  More...

##  Protected Attributes

---
double  |  [ alpha_
](classrviz__visual__tools_1_1RvizVisualTools.html#aa7b330c57939674b668b883df86a41eb)
= 1.0
visualization_msgs::Marker  |  [ arrow_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#af6870d947abb7f298235adbd53818bec)
std::string  |  [ base_frame_
](classrviz__visual__tools_1_1RvizVisualTools.html#ae2fc9ebf8aab4acbcbf0b7ec32a0f158)
bool  |  [ batch_publishing_enabled_
](classrviz__visual__tools_1_1RvizVisualTools.html#a69bce638f2ad66162542b13b382a136d)
= true
visualization_msgs::Marker  |  [ block_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#a838521e9c52788c84ab5a1510f55f2b9)
visualization_msgs::Marker  |  [ cuboid_marker_
](classrviz__visual__tools_1_1RvizVisualTools.html#ac406c454658c9d5ee5edfedbd688aa04)
visualization_msgs::Marker  |  [ cylinder_marker_


  // Set the namespace and id for this marker.  This serves to create a unique
  // ID
  mesh_marker_.ns = ns;


  line_list_marker_.points.push_back(convertPoint(p3));
  line_list_marker_.points.push_back(convertPoint(p4));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


bool rviz_visual_tools::RvizVisualTools::publishXArrow  |  (  |  const
geometry_msgs::PoseStamped & |  _pose_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ RED
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a269d2451e2a4b2d6744d2d958a8a8467)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  double  |  _length_ = ` 0.0 `
|  )  |  |

Definition at line [ 1237 ](rviz__visual__tools_8cpp_source.html#l01237) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  initialize()


     marker  |  \- a pre-made marker ready to be published
---|---

Returns