](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale,
const std::string &ns="Path")
bool  |  [ publishPath
](classrviz__visual__tools_1_1RvizVisualTools.html#a0063c38d62f1fd94462ae8d6a3a32f4b)
(const [ EigenSTL::vector_Isometry3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#ac192baa0b919d541fcc5e78cfd3e4769)
&path, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
[ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale,
const std::string &ns="Path")
bool  |  [ publishPath
](classrviz__visual__tools_1_1RvizVisualTools.html#a2c6b12ef7c1b7a51ba6e86c89918f24e)
(const [ EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
&path, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
[ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale,
const std::string &ns="Path")
bool  |  [ publishPath
](classrviz__visual__tools_1_1RvizVisualTools.html#aaab1d01da4d8775ea052d20866c1fd3b)
(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)
, double radius=0.01, const std::string &ns="Path")
bool  |  [ publishPath
](classrviz__visual__tools_1_1RvizVisualTools.html#af24230f9c5f580b6212ef1c6bd698675)
(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")
bool  |  [ publishPath
](classrviz__visual__tools_1_1RvizVisualTools.html#af5766b6b43ca5dc02d8785a423736228)


](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)
|  Display a marker of a sphere.  More...

bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#adb3c6de729fa0921ed36c7d9520c8222)
(const Eigen::Vector3d &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)
bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#a9bc5d011551aa3ac6d01723a1e557cae)
(const Eigen::Vector3d &point, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
double scale, const std::string &ns="Sphere", std::size_t id=0)
bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#a82cca0fb80c757f9727bed9a3f0f2096)
(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)
bool  |  [ publishSphere


     pose  |  \- the location to publish the marker with respect to the base frame
---|---
label  |  \- name of axis/coordinate frame
scale  |  \- size of axis
color  |  \- an enum pre-defined name of a color

Returns


Parameters


##  ◆  loadRemoteControl()


void rviz_visual_tools::RvizVisualTools::setLifetime  |  (  |  double  |
_lifetime_ |  )  |
---|---|---|---|---|---

Set the lifetime of markers published to rviz.


  // Load Mesh ----------------------------------------------------
  mesh_marker_.header.frame_id = base_frame_;


[ BSD-3-Clause license ](/ros-planning/moveit_visual_tools/blob/ros2/LICENSE)
[ 140  stars ](/ros-planning/moveit_visual_tools/stargazers) [ 100  forks
](/ros-planning/moveit_visual_tools/forks) [ Branches  ](/ros-
planning/moveit_visual_tools/branches) [ Tags  ](/ros-
planning/moveit_visual_tools/tags) [ Activity  ](/ros-
planning/moveit_visual_tools/activity)
[ Star  ](/login?return_to=%2Fros-planning%2Fmoveit_visual_tools)
[ Notifications ](/login?return_to=%2Fros-planning%2Fmoveit_visual_tools)
  * [ Code  ](/ros-planning/moveit_visual_tools)
  * [ Issues  8  ](/ros-planning/moveit_visual_tools/issues)
  * [ Pull requests  5  ](/ros-planning/moveit_visual_tools/pulls)
  * [ Actions  ](/ros-planning/moveit_visual_tools/actions)
  * [ Projects  0  ](/ros-planning/moveit_visual_tools/projects)
  * [ Wiki  ](/ros-planning/moveit_visual_tools/wiki)
  * [ Security  ](/ros-planning/moveit_visual_tools/security)
  * [ Insights  ](/ros-planning/moveit_visual_tools/pulse)
Additional navigation options
  * [ Code  ](/ros-planning/moveit_visual_tools)
  * [ Issues  ](/ros-planning/moveit_visual_tools/issues)
  * [ Pull requests  ](/ros-planning/moveit_visual_tools/pulls)
  * [ Actions  ](/ros-planning/moveit_visual_tools/actions)
  * [ Projects  ](/ros-planning/moveit_visual_tools/projects)
  * [ Wiki  ](/ros-planning/moveit_visual_tools/wiki)
  * [ Security  ](/ros-planning/moveit_visual_tools/security)
  * [ Insights  ](/ros-planning/moveit_visual_tools/pulse)
#  ros-planning/moveit_visual_tools
This commit does not belong to any branch on this repository, and may belong
to a fork outside of the repository.
ros2
[ Branches  ](/ros-planning/moveit_visual_tools/branches) [ Tags  ](/ros-
planning/moveit_visual_tools/tags)
[ ](/ros-planning/moveit_visual_tools/branches) [ ](/ros-
planning/moveit_visual_tools/tags)
Go to file
Code
##  Folders and files
Name  |  Name  |
Last commit message
|
Last commit date


  if (width <= 0)
  {
    cuboid_marker_.scale.y = SMALL_SCALE;
  }
  else
  {
    cuboid_marker_.scale.y = width;
  }


##  ◆  generateRandomPose()  [2/2]


  if (id == 0)
  {  // Provide a new id every call to this function
    line_list_marker_.id++;
  }
  else
  {  // allow marker to be overwritten
    line_list_marker_.id = id;
  }


bool RvizVisualTools::publishSphere(const geometry_msgs::Pose& pose, colors color, scales scale, const std::string& ns,
                                    std::size_t id)
{
  return publishSphere(pose, color, getScale(scale), ns, id);
}


bool RvizVisualTools::publishSphere(const geometry_msgs::Pose& pose, colors color, const geometry_msgs::Vector3 scale,
                                    const std::string& ns, std::size_t id)
{
  return publishSphere(pose, getColor(color), scale, ns, id);
}


bool RvizVisualTools::publishAxis(const geometry_msgs::Pose& pose, double length, double radius, const std::string& ns)
{
  return publishAxis(convertPose(pose), length, radius, ns);
}


` Unspecified ` _= Type.Unspecified_ Â¶


Definition at line [ 862 ](rviz__visual__tools_8cpp_source.html#l00862) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  enableFrameLocking()


##  ◆  publishText()  [1/4]


##  ◆  publishAxisLabeled()  [2/2]


Returns


     point  |  a - x,y,z in space of a point
---|---
point  |  b - x,y,z in space of a point

Returns


Definition at line [ 579 ](rviz__visual__tools_8cpp_source.html#l00579) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


// line_list_marker_.color = getColor(BLUE); // This var is not used


  return publishSpheres(points_msg, colors_msg, getScale(scale), ns);
}


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


bool rviz_visual_tools::RvizVisualTools::publishAxisPath  |  (  |  const [
EigenSTL::vector_Isometry3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#ac192baa0b919d541fcc5e78cfd3e4769)
& |  _path_ ,
---|---|---|---
|  |  double  |  _length_ = ` 0.1 ` ,
|  |  double  |  _radius_ = ` 0.01 ` ,
|  |  const std::string & |  _ns_ = ` "Axis Path" `
|  )  |  |

Definition at line [ 1482 ](rviz__visual__tools_8cpp_source.html#l01482) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


1 follower


](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) , const
geometry_msgs::Vector3 &scale, const std::string &ns="Spheres")
bool  |  [ publishText
](classrviz__visual__tools_1_1RvizVisualTools.html#a91534b02947a5996591bc150412a05a8)
(const Eigen::Isometry3d &pose, const std::string &text, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ WHITE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a23885a26fe14a38b7ec48819c423fd9a)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, bool static_id=true)
|  Display a marker of a text.  More...

bool  |  [ publishText
](classrviz__visual__tools_1_1RvizVisualTools.html#a14dd5b9cebdae749856046c90e45633c)
(const Eigen::Isometry3d &pose, const std::string &text, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
const geometry_msgs::Vector3 scale, bool static_id=true)
bool  |  [ publishText
](classrviz__visual__tools_1_1RvizVisualTools.html#accc29264d3a42468eaa2f1aab0a11701)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, const std::string &text, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ WHITE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a23885a26fe14a38b7ec48819c423fd9a)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, bool static_id=true)
bool  |  [ publishText
](classrviz__visual__tools_1_1RvizVisualTools.html#aedd0bdfe10c4f20fe8b52a30f235e98c)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, const std::string &text, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
const geometry_msgs::Vector3 scale, bool static_id=true)


##  ◆  cylinder_marker_


numpy.ndarray[float64[3, 1]]


The documentation for this class was generated from the following files:


###  License
BSD-3-Clause license
[ Activity  ](/ros-planning/moveit_visual_tools/activity)
[ Custom properties  ](/ros-planning/moveit_visual_tools/custom-properties)
###  Stars
[ **140** stars ](/ros-planning/moveit_visual_tools/stargazers)
###  Watchers
[ **23** watching ](/ros-planning/moveit_visual_tools/watchers)
###  Forks
[ **100** forks ](/ros-planning/moveit_visual_tools/forks)
[ Report repository ](/contact/report-
content?content_url=https%3A%2F%2Fgithub.com%2Fros-
planning%2Fmoveit_visual_tools&report=ros-planning+%28user%29)
##  [ Releases ](/ros-planning/moveit_visual_tools/releases)
[ 31  tags  ](/ros-planning/moveit_visual_tools/tags)
##  [ Packages  0  ](/orgs/ros-
planning/packages?repo_name=moveit_visual_tools)
No packages published
##  [ Contributors  22  ](/ros-
planning/moveit_visual_tools/graphs/contributors)
  *   *   *   *   *   *   *   *   *   *   *   *   *   *
[ \+ 8 contributors ](/ros-planning/moveit_visual_tools/graphs/contributors)
##  Languages
  * [ C++  96.3%  ](/ros-planning/moveit_visual_tools/search?l=c%2B%2B)
  * [ Python  2.2%  ](/ros-planning/moveit_visual_tools/search?l=python)
  * [ CMake  1.5%  ](/ros-planning/moveit_visual_tools/search?l=cmake)
##  Footer
[ ](https://github.com "GitHub") © 2024 GitHub, Inc.
###  Footer navigation
  * [ Terms ](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
  * [ Privacy ](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
  * [ Security ](/security)
  * [ Status ](https://www.githubstatus.com/)
  * [ Docs ](https://docs.github.com/)
  * [ Contact ](https://support.github.com?tags=dotcom-footer)
  * Manage cookies
  * Do not share my personal information
You can’t perform that action at this time.


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

###
[ package.xml ](/ros-planning/moveit_visual_tools/blob/ros2/package.xml
"package.xml")
|
###
[ package.xml ](/ros-planning/moveit_visual_tools/blob/ros2/package.xml
"package.xml")
|
|

View all files

##  Repository files navigation
  * README
  * BSD-3-Clause license
#  MoveIt Visual Tools
Helper functions for displaying and debugging MoveIt data in Rviz via
published markers, trajectories, and MoveIt collision objects. It is sometimes
hard to understand everything that is going on internally with MoveIt, but
using these quick convenience functions allows one to easily visualize their
code. This package is built in top of [ rviz_visual_tools
](https://github.com/PickNikRobotics/rviz_visual_tools) and all those features
are included via class inheritance.
This package helps you visualize:
  * Basic Rviz geometric shapes
  * MoveIt collision objects
  * MoveIt and ROS trajectories
  * Robot states
  * End effectors
  * Interactive markers to move robot arms using IK from remote applications
[
![](https://camo.githubusercontent.com/62176a685c40980602f2dfd8f0156f913b525c3564d8e11ef415621eadd9e8d4/68747470733a2f2f7069636b6e696b2e61692f6173736574732f696d616765732f6c6f676f2e6a7067)


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


  // Find center point
  Eigen::Vector3d pt_center = getCenterPoint(point1, point2);


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


` VoxelGrid ` _= Type.VoxelGrid_ Â¶


  // Publish y axis
  Eigen::Isometry3d y_pose =
      Eigen::Translation3d(0, length / 2.0, 0) * Eigen::AngleAxisd(M_PI / 2.0, Eigen::Vector3d::UnitX());
  y_pose = pose * y_pose;
  publishCylinder(y_pose, GREEN, length, radius, ns);


|  [ ros::Duration ](../../../api/rostime/html/classros_1_1Duration.html)
rviz_visual_tools::RvizVisualTools::marker_lifetime_
---
protected

Definition at line [ 1077 ](rviz__visual__tools_8h_source.html#l01077) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


##  ◆  publishAxis()  [1/4]


  std_msgs::ColorRGBA this_color = getColor(color);
  line_list_marker_.scale = getScale(scale, 0.25);
  line_list_marker_.scale.y = 0;
  line_list_marker_.scale.z = 0;


     point  |
---|---

Returns


Definition at line [ 1864 ](rviz__visual__tools_8cpp_source.html#l01864) 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
---|---
color  |  \- an enum pre-defined name of a color
height  |  \- geometry of cylinder
radius  |  \- geometry of cylinder

Returns


     pose  |
---|---

Returns


bool rviz_visual_tools::RvizVisualTools::publishText  |  (  |  const [
geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _pose_ ,
---|---|---|---
|  |  const std::string & |  _text_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ ,
|  |  const geometry_msgs::Vector3  |  _scale_ ,
|  |  bool  |  _static_id_ = ` true `
|  )  |  |

Definition at line [ 2406 ](rviz__visual__tools_8cpp_source.html#l02406) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Definition at line [ 2499 ](rviz__visual__tools_8cpp_source.html#l02499) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Returns


_property_ ` y_axis ` Â¶


|  std::string rviz_visual_tools::RvizVisualTools::base_frame_
---
protected

Definition at line [ 1074 ](rviz__visual__tools_8h_source.html#l01074) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


spheres_marker_.points = points;  // straight copy


##  ◆  fRand()


      ROS_ERROR_STREAM_NAMED(LOGNAME, "Not implemented yet");
      break;
  }


     aPoints  |  \- x,y,z of start of line, as a vector
---|---
bPoints  |  \- x,y,z of end of line, as a vector
colors  |  \- an enum pre-defined name of a color
scale  |  \- an enum pre-defined name of a size

Returns


  Eigen::Vector3d up_vector(0.0, 0.0, 1.0);
  Eigen::Vector3d right_axis_vector = axis_vector.cross(up_vector);


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


bool rviz_visual_tools::RvizVisualTools::publishSphere  |  (  |  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)
` ,
|  |  const std::string & |  _ns_ = ` "Sphere" ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Display a marker of a sphere.


true on success


Definition at line [ 359 ](rviz__visual__tools_8h_source.html#l00359) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


  // Make sure color is not *too* dark
  do
  {
    result.r = fRand(0.0, 1.0);
    result.g = fRand(0.0, 1.0);
    result.b = fRand(0.0, 1.0);
    // ROS_DEBUG_STREAM_NAMED(LOGNAME, "Looking for random color that is not too light, current value is "
    //<< (result.r + result.g + result.b) << " attempt #" << attempts);
    attempts++;
    if (attempts > max_attempts)
    {
      ROS_WARN_STREAM_NAMED(LOGNAME, "Unable to find appropriate random color after " << max_attempts << " attempts");
      break;
    }
  } while (result.r + result.g + result.b < 1.5);  // 3 would be white


bool RvizVisualTools::publishCuboid(const Eigen::Isometry3d& pose, const Eigen::Vector3d& size, colors color)
{
  return publishCuboid(pose, size.x(), size.y(), size.z(), color);
}


void RvizVisualTools::printTransform(const Eigen::Isometry3d& transform)
{
  Eigen::Quaterniond q(transform.rotation());
  std::cout << "T.xyz = [" << transform.translation().x() << ", " << transform.translation().y() << ", "
            << transform.translation().z() << "], Q.xyzw = [" << q.x() << ", " << q.y() << ", " << q.z() << ", "
            << q.w() << "]" << std::endl;
}


  return true;
}


##  ◆  publishLine()  [5/8]


     Pose  |  to fill in options bounds on the pose to generate
---|---

Definition at line [ 2606 ](rviz__visual__tools_8cpp_source.html#l02606) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  p1 = pose * p1;
  p2 = pose * p2;
  p3 = pose * p3;
  p4 = pose * p4;


Parameters


##  ◆  publishSpheres()  [4/7]


|  void rviz_visual_tools::RvizVisualTools::printTransformFull  |  (  |  const
Eigen::Isometry3d & |  _transform_ |  )  |
---|---|---|---|---|---
static

Display in the console a transform with full 3x3 rotation matrix.


##  ◆  publishWireframeRectangle()  [2/2]


|  [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
rviz_visual_tools::RvizVisualTools::convertPointToPose  |  (  |  const [
geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
& |  _point_ |  )  |
---|---|---|---|---|---
static

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


](classrviz__visual__tools_1_1RvizVisualTools.html#acdffb7ed8e0923337a7feb2da404d50a)
(const Eigen::Isometry3d &pose, double [ angle
](../../../api/tf2/html/namespacetf2.html#a43c178b5fba1b9c8b2a276884b392fb4) ,
[ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ TRANSLUCENT
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3ada8357de2c7d31bdc0a27e7814e0ac85)
, double scale=1.0)
|  Display a cone of a given angle along the x-axis.  More...

bool  |  [ publishCone
](classrviz__visual__tools_1_1RvizVisualTools.html#a63586e66a5c0f34b999337931f6e2c35)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, double [ angle
](../../../api/tf2/html/namespacetf2.html#a43c178b5fba1b9c8b2a276884b392fb4) ,
[ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ TRANSLUCENT
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3ada8357de2c7d31bdc0a27e7814e0ac85)
, double scale=1.0)
bool  |  [ publishCuboid
](classrviz__visual__tools_1_1RvizVisualTools.html#a35e8a8e39e63e25d57ab79a8ea17c02a)
(const Eigen::Vector3d &point1, const Eigen::Vector3d &point2, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
)
|  Display a rectangular cuboid.  More...

bool  |  [ publishCuboid
](classrviz__visual__tools_1_1RvizVisualTools.html#a2512a2f30aa16adb1ca1acda5a8b91b2)
(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)


  line_list_marker_.points.push_back(convertPoint(p7));
  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::publishSphere  |  (  |  const [
geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _pose_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ ,
|  |  const geometry_msgs::Vector3  |  _scale_ ,
|  |  const std::string & |  _ns_ = ` "Sphere" ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Definition at line [ 1155 ](rviz__visual__tools_8cpp_source.html#l01155) 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
---|---
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


Definition at line [ 535 ](rviz__visual__tools_8cpp_source.html#l00535) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Definition at line [ 1529 ](rviz__visual__tools_8cpp_source.html#l01529) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool rviz_visual_tools::RvizVisualTools::publishZArrow  |  (  |  const [
geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _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 [ 1269 ](rviz__visual__tools_8cpp_source.html#l01269) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool rviz_visual_tools::RvizVisualTools::publishSpheres  |  (  |  const [
EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
& |  _points_ ,
---|---|---|---
|  |  [ 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_ = ` "Spheres" `
|  )  |  |

Display a marker of a series of spheres.


  if (verbose)
  {
    std::cout << "right_axis_vector normalized " << std::endl;
    printTranslation(right_axis_vector);
  }


##  ◆  trigger()


bool RvizVisualTools::publishPath(const EigenSTL::vector_Isometry3d& path, colors color, scales scale,
                                  const std::string& ns)
{
  return publishPath(path, color, getScale(scale).x, ns);
}


  // override previous x scale specified
  if (length == 0)
  {  // auto set the scale
    arrow_marker_.scale.x *= 10.0;
  }
  else
  {
    arrow_marker_.scale.x = length;
  }


bool rviz_visual_tools::RvizVisualTools::publishAxis  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  const std::string & |  _ns_ = ` "Axis" `
|  )  |  |

Definition at line [ 1427 ](rviz__visual__tools_8cpp_source.html#l01427) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


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


](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, const std::string &ns="Spheres")
bool  |  [ publishSpheres
](classrviz__visual__tools_1_1RvizVisualTools.html#ad11399413e0eb64a4678c4d8486e1ef1)
(const std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> &points, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, double scale=0.1, const std::string &ns="Spheres")
bool  |  [ publishSpheres
](classrviz__visual__tools_1_1RvizVisualTools.html#af1298f7c55f323e3f48b96c3a47fc07c)
(const std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> &points, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
const geometry_msgs::Vector3 &scale, const std::string &ns="Spheres")
bool  |  [ publishSpheres
](classrviz__visual__tools_1_1RvizVisualTools.html#a3a75f09c9def6d90a1154c47c1ddef6e)
(const [ EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
&points, const std::vector< [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) > & [
colors ](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, const std::string &ns="Spheres")
|  Display a marker of a series of spheres, with the possibility of different
colors.  More...

bool  |  [ publishSpheres
](classrviz__visual__tools_1_1RvizVisualTools.html#aa1dadfd9e4940458fb5813916690922e)
(const std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> &points, const std::vector< std_msgs::ColorRGBA > & [ colors


     spheres  |  \- where to publish them
---|---
color  |  \- an enum pre-defined name of a color
scale  |  \- an enum pre-defined name of a size
ns  |  \- namespace of marker

Returns


##  ◆  getVectorBetweenPoints()


Parameters


##  ◆  publishSpheres()  [5/7]


Tutorial


##  ◆  loadRvizMarkers()


  triangle_marker_.scale.x = 1.0;
  triangle_marker_.scale.y = 1.0;
  triangle_marker_.scale.z = 1.0;


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


true on success


  Eigen::Vector3d axis;
  axis[0] = sin(elevation) * cos(azimuth);
  axis[1] = sin(elevation) * sin(azimuth);
  axis[2] = cos(elevation);


     ROS  |  msg pose
---|---

Returns


  // Prevent scale from being zero
  if (depth <= 0)
  {
    cuboid_marker_.scale.x = SMALL_SCALE;
  }
  else
  {
    cuboid_marker_.scale.x = depth;
  }


##  ◆  publishAxisPath()  [2/2]


|  bool rviz_visual_tools::RvizVisualTools::publishAxisInternal  |  (  |
const Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  double  |  _length_ = ` 0.1 ` ,
|  |  double  |  _radius_ = ` 0.01 ` ,
|  |  const std::string & |  _ns_ = ` "Axis" `
|  )  |  |
private

Display a red/green/blue coordinate axis - the 'internal' version does not do
a batch publish.


1. __init__(self: open3d.geometry.OrientedBoundingBox) -> None


q.normalize();


bool rviz_visual_tools::RvizVisualTools::publishSphere  |  (  |  const
Eigen::Vector3d & |  _point_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ ,
|  |  double  |  _scale_ ,
|  |  const std::string & |  _ns_ = ` "Sphere" ` ,
|  |  std::size_t  |  _id_ = ` 0 `
|  )  |  |

Definition at line [ 1123 ](rviz__visual__tools_8cpp_source.html#l01123) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


const std::array<colors, 14> RvizVisualTools::ALL_RAND_COLORS = { RED,        GREEN,  BLUE,   GREY,   DARK_GREY,
                                                                  WHITE,      ORANGE, YELLOW, BROWN,  PINK,
                                                                  LIME_GREEN, PURPLE, CYAN,   MAGENTA };


  p[3].x = 1.0 * scale;
  p[3].y = -1.0 * scale;
  p[3].z = 0.0;


Parameters


Docs version  0.8.0


     ROS  |  msg pose - input
---|---
[ Eigen ](../../../api/rviz/html/c++/namespaceEigen.html) |  pose - output

Definition at line [ 2458 ](rviz__visual__tools_8cpp_source.html#l02458) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  return publishPath(points, color, scale, ns);
}


  return publishLines(a_points_msg, b_points_msg, colors_msg, getScale(scale));
}


© Copyright 2018 - 2019, www.open3d.org


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


  // Goal pose:
  Eigen::Quaterniond q;
  Eigen::Vector3d axis_vector = b - a;


  // For avoiding overriden Axis and Text
  geometry_msgs::Pose pose_shifted = pose;
  pose_shifted.position.x -= 0.05;
  pose_shifted.position.y -= 0.05;
  pose_shifted.position.z -= 0.05;
  publishText(pose_shifted, label, color, static_cast<scales>(static_cast<int>(scale) + 1), false);
  return true;
}


bool rviz_visual_tools::RvizVisualTools::publishYZPlane  |  (  |  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.


  // Testing
  BOOST_ASSERT_MSG(line_list_marker_.colors.size() == line_list_marker_.points.size(), "Arrays mismatch in size");
  BOOST_ASSERT_MSG(line_list_marker_.colors.size() == aPoints.size() * 2, "Colors arrays mismatch in size");


bool RvizVisualTools::publishMesh(const Eigen::Isometry3d& pose, const std::string& file_name, colors color,
                                  double scale, const std::string& ns, std::size_t id)
{
  return publishMesh(convertPose(pose), file_name, color, scale, ns, id);
}


Definition at line [ 1037 ](rviz__visual__tools_8h_source.html#l01037) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


##  ◆  scaleToString()


Definition at line [ 1292 ](rviz__visual__tools_8cpp_source.html#l01292) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ WHITE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a23885a26fe14a38b7ec48819c423fd9a)
)
|  Display a marker of a coordinate frame axis with a text label describing
it.  More...

bool  |  [ publishAxisLabeled
](classrviz__visual__tools_1_1RvizVisualTools.html#a3bfdbbf81b5070d0ca0c52389774f6c3)
(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)
)
bool  |  [ publishAxisPath
](classrviz__visual__tools_1_1RvizVisualTools.html#ad03be4168dc1f37662639b362012f9d8)
(const [ EigenSTL::vector_Isometry3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#ac192baa0b919d541fcc5e78cfd3e4769)
&path, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, const std::string &ns="Axis Path")
|  Display a series of red/green/blue coordinate axis along a path.  More...

bool  |  [ publishAxisPath
](classrviz__visual__tools_1_1RvizVisualTools.html#abfcedac7834eb9baf91364e568f771f2)
(const [ EigenSTL::vector_Isometry3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#ac192baa0b919d541fcc5e78cfd3e4769)
&path, double [ length
](../../../api/tf2/html/namespacetf2.html#ab20034dc53b40043a702876ff38c78a1)
=0.1, double radius=0.01, const std::string &ns="Axis Path")
bool  |  [ publishCone


  triangle_marker_.scale.x = 1.0;
  triangle_marker_.scale.y = 1.0;
  triangle_marker_.scale.z = 1.0;


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


std_msgs::ColorRGBA RvizVisualTools::getColorScale(double value) const
{
  // User warning
  if (value < 0)
  {
    ROS_WARN_STREAM_NAMED(LOGNAME, "Intensity value for color scale is below range [0,1], value: " << value);
    value = 0;
  }
  else if (value > 1)
  {
    ROS_WARN_STREAM_NAMED(LOGNAME, "Intensity value for color scale is above range [0,1], value: " << value);
    value = 1;
  }


numpy.ndarray[float64[3, 1]]


     converted pose *
     true on sucess


Parameters


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_ ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ ,
|  |  const std::string & |  _ns_ = ` "Path" `
|  )  |  |

Definition at line [ 1916 ](rviz__visual__tools_8cpp_source.html#l01916) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  convertPose()  [2/2]


bool rviz_visual_tools::RvizVisualTools::publishMarker  |  (  |
visualization_msgs::Marker & |  _marker_ |  )  |
---|---|---|---|---|---

Display a visualization_msgs Marker of a custom type. Allows reuse of the ros
publisher.


(const Eigen::Vector3d &point, const std_msgs::ColorRGBA &color, const
geometry_msgs::Vector3 scale, const std::string &ns="Sphere", std::size_t
id=0)
bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#a2ed8978442850f9d847fcced8e4231c7)
(const geometry_msgs::PoseStamped &pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
const geometry_msgs::Vector3 scale, const std::string &ns="Sphere",
std::size_t id=0)
bool  |  [ publishSpheres
](classrviz__visual__tools_1_1RvizVisualTools.html#ac0df33947c60e15fd37eefd5a6b2818e)
(const [ EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
&points, [ 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="Spheres")
|  Display a marker of a series of spheres.  More...

bool  |  [ publishSpheres
](classrviz__visual__tools_1_1RvizVisualTools.html#a5b55c3937ff6ed93d3855d99d77650f9)
(const [ EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
&points, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
double scale=0.1, const std::string &ns="Spheres")
bool  |  [ publishSpheres
](classrviz__visual__tools_1_1RvizVisualTools.html#a0ba797af15b9e60cd4950b896a5c9e41)
(const std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> &points, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, [ scales


std_msgs::ColorRGBA &color, double radius=0.01, const std::string
&ns="Cylinder")
bool  |  [ publishCylinder
](classrviz__visual__tools_1_1RvizVisualTools.html#add44247cfa5cae661e3286c5e91c111a)
(const Eigen::Isometry3d &pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, double height=0.1, double radius=0.01, const std::string &ns="Cylinder")
|  Display a marker of a cylinder.  More...

bool  |  [ publishCylinder
](classrviz__visual__tools_1_1RvizVisualTools.html#a0f484f22da5e0c36c764000bd3fb70ef)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, double height=0.1, double radius=0.01, const std::string &ns="Cylinder")
bool  |  [ publishCylinder
](classrviz__visual__tools_1_1RvizVisualTools.html#a83d12757ef9bba768d264857cfc70326)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, const std_msgs::ColorRGBA &color, double height=0.1, double
radius=0.01, const std::string &ns="Cylinder")
bool  |  [ publishGraph
](classrviz__visual__tools_1_1RvizVisualTools.html#af190d12dd814a60ecfd6bf1ec0a43ac8)
(const graph_msgs::GeometryGraph &graph, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
double radius)
|  Display a graph.  More...

bool  |  [ publishLine
](classrviz__visual__tools_1_1RvizVisualTools.html#a32592bb6edc1fda6d93d9b53c02f43a3)
(const Eigen::Isometry3d &point1, const Eigen::Isometry3d &point2, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, [ scales


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


bool RvizVisualTools::publishSpheres(const EigenSTL::vector_Vector3d& points, const std::vector<colors>& colors,
                                     scales scale, const std::string& ns)
{
  BOOST_ASSERT_MSG(points.size() == colors.size(), "Mismatching vector sizes: points and colors");


  // Determine if we should publish now
  if (!batch_publishing_enabled_)
  {
    return trigger();
  }


bool RvizVisualTools::publishCuboid(const geometry_msgs::Pose& pose, const geometry_msgs::Vector3& size, colors color)
{
  return publishCuboid(pose, size.x, size.y, size.z, color);
}


##  ◆  publishCylinder()  [2/6]


     point1  |  \- x,y,z top corner location of box
---|---
point2  |  \- x,y,z bottom opposite corner location of box
color  |  \- an enum pre-defined name of a color

Returns


|  void rviz_visual_tools::RvizVisualTools::printTransformRPY  |  (  |  const
Eigen::Isometry3d & |  _transform_ |  )  |
---|---|---|---|---|---
static

Display in the console a transform in roll pitch yaw.


  // Calculate the rotation matrix from the original normal z_0 = (0,0,1) to new normal n = (A,B,C)
  Eigen::Vector3d z_0 = Eigen::Vector3d::UnitZ();
  Eigen::Quaterniond q = Eigen::Quaterniond::FromTwoVectors(z_0, n);
  pose.linear() = q.toRotationMatrix();


bool RvizVisualTools::publishPath(const std::vector<geometry_msgs::Point>& path, colors color, scales scale,
                                  const std::string& ns)
{
  return publishPath(path, color, getScale(scale).x, ns);
}


vector from a to b


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


##  ◆  publishAxisPath()  [1/2]


[ __ ](/questions/) |


/*********************************************************************
 * Software License Agreement (BSD License)
 *
 *  Copyright (c) 2017, PickNik Consulting
 *  All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above
 *     copyright notice, this list of conditions and the following
 *     disclaimer in the documentation and/or other materials provided
 *     with the distribution.
 *   * Neither the name of the Univ of CO, Boulder nor the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 *  POSSIBILITY OF SUCH DAMAGE.
 *********************************************************************/


void RvizVisualTools::convertPoseSafe(const Eigen::Isometry3d& pose, geometry_msgs::Pose& pose_msg)
{
  tf2::convert(pose, pose_msg);
}


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


bool RvizVisualTools::triggerEvery(std::size_t queueSize)
{
  if (markers_.markers.size() >= queueSize || queueSize == 0)
  {
    return trigger();
  }
  return false;
}


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


     point  |
---|---

Returns


##  ◆  publishSpheres()  [1/7]


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


numpy.ndarray[float64[3, 1]]


bool RvizVisualTools::publishLine(const geometry_msgs::Point& point1, const geometry_msgs::Point& point2, colors color,
                                  scales scale)
{
  return publishLine(point1, point2, getColor(color), scale);
}


Eigen::Vector3d RvizVisualTools::getCenterPoint(const Eigen::Vector3d& a, const Eigen::Vector3d& b) const
{
  Eigen::Vector3d center;
  center[0] = (a[0] + b[0]) / 2.0;
  center[1] = (a[1] + b[1]) / 2.0;
  center[2] = (a[2] + b[2]) / 2.0;
  return center;
}


  std::vector<geometry_msgs::Point> a_points_msg;
  std::vector<geometry_msgs::Point> b_points_msg;
  std::vector<std_msgs::ColorRGBA> colors_msg;


##  ◆  publishCylinder()  [6/6]


##  ◆  publishSphere()  [6/11]


##  Member Data Documentation


bool rviz_visual_tools::RvizVisualTools::publishCuboid  |  (  |  const [
geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _pose_ ,
---|---|---|---
|  |  double  |  _depth_ ,
|  |  double  |  _width_ ,
|  |  double  |  _height_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
`
|  )  |  |

Display a rectangular cuboid.


---|---|---|---

##  Latest commit
##  History
[ 381 Commits  ](/ros-planning/moveit_visual_tools/commits/ros2/)
[ ](/ros-planning/moveit_visual_tools/commits/ros2/)

###
[ .github/  workflows  ](/ros-
planning/moveit_visual_tools/tree/ros2/.github/workflows "This path skips
through empty directories")
|
###
[ .github/  workflows  ](/ros-
planning/moveit_visual_tools/tree/ros2/.github/workflows "This path skips
through empty directories")
|
|

###
[ include/  moveit_visual_tools  ](/ros-
planning/moveit_visual_tools/tree/ros2/include/moveit_visual_tools "This path
skips through empty directories")
|
###
[ include/  moveit_visual_tools  ](/ros-
planning/moveit_visual_tools/tree/ros2/include/moveit_visual_tools "This path
skips through empty directories")
|
|

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


     polygon  |  \- 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 RvizVisualTools::publishText(const Eigen::Isometry3d& pose, const std::string& text, colors color,
                                  const geometry_msgs::Vector3 scale, bool static_id)
{
  return publishText(convertPose(pose), text, color, scale, static_id);
}


Definition at line [ 1242 ](rviz__visual__tools_8cpp_source.html#l01242) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


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


bool RvizVisualTools::publishCylinder(const Eigen::Vector3d& point1, const Eigen::Vector3d& point2,
                                      const std_msgs::ColorRGBA& color, double radius, const std::string& ns)
{
  // Distance between two points
  double height = (point1 - point2).lpNorm<2>();


void RvizVisualTools::generateRandomPose(Eigen::Isometry3d& pose, RandomPoseBounds pose_bounds)
{
  // Error check elevation & azimuth angles
  // 0 <= elevation <= pi
  // 0 <= azimuth   <= 2 * pi
  if (pose_bounds.elevation_min_ < 0)
  {
    ROS_WARN_STREAM_NAMED(LOGNAME, "min elevation bound < 0, setting equal to 0");
    pose_bounds.elevation_min_ = 0;
  }


the RGB message equivalent


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


void RvizVisualTools::convertPoseSafe(const geometry_msgs::Pose& pose_msg, Eigen::Isometry3d& pose)
{
  tf2::convert(pose_msg, pose);
}


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


  std::vector<geometry_msgs::Point> points_msg;
  std::vector<std_msgs::ColorRGBA> colors_msg;


bool rviz_visual_tools::RvizVisualTools::publishSpheres  |  (  |  const
std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> & |  _points_ ,
---|---|---|---
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ ,
|  |  const geometry_msgs::Vector3 & |  _scale_ ,
|  |  const std::string & |  _ns_ = ` "Spheres" `
|  )  |  |

Definition at line [ 2325 ](rviz__visual__tools_8cpp_source.html#l02325) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  // Calculate center pose
  geometry_msgs::Pose pose = getIdentityPose();
  pose.position.x = (point1.x - point2.x) / 2.0 + point2.x;
  pose.position.y = (point1.y - point2.y) / 2.0 + point2.y;
  pose.position.z = (point1.z - point2.z) / 2.0 + point2.z;
  cuboid_marker_.pose = pose;


void RvizVisualTools::enableBatchPublishing(bool enable)
{
  batch_publishing_enabled_ = enable;
}


  return result_pose;
}


bool rviz_visual_tools::RvizVisualTools::triggerEvery  |  (  |  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.


##  Member Function Documentation


true on success


void RvizVisualTools::enableFrameLocking(bool enable)
{
  frame_locking_enabled_ = enable;
}


Parameters


##  ◆  waitForSubscriber()


  // Extract 8 cuboid vertices
  Eigen::Vector3d p1(-width / 2.0, -height / 2.0, 0.0);
  Eigen::Vector3d p2(-width / 2.0, height / 2.0, 0.0);
  Eigen::Vector3d p3(width / 2.0, height / 2.0, 0.0);
  Eigen::Vector3d p4(width / 2.0, -height / 2.0, 0.0);


void rviz_visual_tools::RvizVisualTools::enableBatchPublishing  |  (  |  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.


     wait_for_subscriber  |  \- whether a sleep for loop should be used to check for connectivity to an external node before proceeding
---|---

Definition at line [ 271 ](rviz__visual__tools_8cpp_source.html#l00271) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  return publishMarker(cuboid_marker_);
}


](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
, double [ length
](../../../api/tf2/html/namespacetf2.html#ab20034dc53b40043a702876ff38c78a1)
=0.0)
bool  |  [ publishYZPlane
](classrviz__visual__tools_1_1RvizVisualTools.html#a74e2315fd6ce19c316e75b94441034a3)
(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  |  [ publishYZPlane
](classrviz__visual__tools_1_1RvizVisualTools.html#af64bc63e6ba0bbe719fe999517000306)
(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  |  [ publishZArrow
](classrviz__visual__tools_1_1RvizVisualTools.html#a78724c2a301e45d0fbb5c4b54b203f7d)
(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
](../../../api/tf2/html/namespacetf2.html#ab20034dc53b40043a702876ff38c78a1)
=0.0, std::size_t id=0)
|  Display an arrow along the z-axis of a pose.  More...

bool  |  [ publishZArrow
](classrviz__visual__tools_1_1RvizVisualTools.html#a739825c41246c808b091d2a49563dd98)
(const [ geometry_msgs::Pose


bool RvizVisualTools::publishCylinder(const geometry_msgs::Pose& pose, colors color, double height, double radius,
                                      const std::string& ns)
{
  return publishCylinder(pose, getColor(color), height, radius, ns);
}


##  ◆  printTransformRPY()


bool RvizVisualTools::publishSphere(const Eigen::Isometry3d& pose, colors color, scales scale, const std::string& ns,
                                    std::size_t id)
{
  return publishSphere(convertPose(pose), color, scale, ns, id);
}


bool RvizVisualTools::publishWireframeCuboid(const Eigen::Isometry3d& pose, const Eigen::Vector3d& min_point,
                                             const Eigen::Vector3d& max_point, colors color, const std::string& ns,
                                             std::size_t id)
{
  // Extract 8 cuboid vertices
  Eigen::Vector3d p1(min_point[0], min_point[1], min_point[2]);
  Eigen::Vector3d p2(min_point[0], min_point[1], max_point[2]);
  Eigen::Vector3d p3(max_point[0], min_point[1], max_point[2]);
  Eigen::Vector3d p4(max_point[0], min_point[1], min_point[2]);
  Eigen::Vector3d p5(min_point[0], max_point[1], min_point[2]);
  Eigen::Vector3d p6(min_point[0], max_point[1], max_point[2]);
  Eigen::Vector3d p7(max_point[0], max_point[1], max_point[2]);
  Eigen::Vector3d p8(max_point[0], max_point[1], min_point[2]);


      // overrides from Display
      virtual void onEnable();
      virtual void onDisable();
      virtual void fixedFrameChanged();

      std::string topic_;
      rviz::Color color_;
      int render_operation_;
      bool override_color_;
      float point_size_;
      float alpha_;

      Ogre::SceneNode* scene_node_;
      rviz::PointCloud* cloud_;

      arm_navigation_msgs::CollisionMap::ConstPtr current_message_;
      message_filters::Subscriber<arm_navigation_msgs::CollisionMap> sub_;
      tf::MessageFilter<arm_navigation_msgs::CollisionMap>* tf_filter_;

      rviz::ColorProperty* color_property_;
      rviz::RosTopicProperty* topic_property_;
      rviz::BoolProperty* override_color_property_;
      rviz::EnumProperty* render_operation_property_;
      rviz::FloatProperty* point_size_property_;
      rviz::FloatProperty* alpha_property_;
    };

    } // namespace mapping_rviz_plugin

    /* RVIZ_COLLISION_MAP_DISPLAY_H_ */
    #endif


    Object::connect: No such slot rviz::Display::changedOverrideColor()
    Object::connect:  (sender name:   'Override Color')
    Object::connect: No such slot rviz::Display::changedColor()
    Object::connect:  (sender name:   'Color')
    Object::connect: No such slot rviz::Display::changedRenderOperation()
    Object::connect:  (sender name:   'Render Operation')
    Object::connect: No such slot rviz::Display::changedAlpha()
    Object::connect:  (sender name:   'Alpha')
    Object::connect: No such slot rviz::Display::changedPointSize()
    Object::connect:  (sender name:   'Point Size')
    Object::connect: No such slot rviz::Display::changedTopic()
    Object::connect:  (sender name:   'Topic')


[ Problem building octomap_mapping [closed] ](/question/215757/problem-
building-octomap_mapping/)


bool RvizVisualTools::publishAxis(const geometry_msgs::Pose& pose, scales scale, const std::string& ns)
{
  double radius = getScale(scale).x;
  return publishAxis(pose, radius * 10.0, radius, ns);
}


  if (right_axis_vector[0] == 0.0 && right_axis_vector[1] == 0.0 && right_axis_vector[2] == 0.0)
  {
    if (verbose)
    {
      std::cout << "right axis vector is zero " << std::endl;
    }
    result_pose = Eigen::AngleAxisd(-0.5 * M_PI, Eigen::Vector3d::UnitY());
    result_pose.translation() = a;
    return result_pose;
  }


bool RvizVisualTools::publishWireframeRectangle(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 color, scales scale)
{
  Eigen::Vector3d p1;
  Eigen::Vector3d p2;
  Eigen::Vector3d p3;
  Eigen::Vector3d p4;


##  ◆  convertFromXYZRPY()  [1/2]


##  ◆  psychedelic_mode_


converted pose


  // Create vector
  Eigen::Isometry3d pose;
  pose = getVectorBetweenPoints(pt_center, point2);


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


|  double rviz_visual_tools::RvizVisualTools::global_scale_ = 1.0
---
protected

Definition at line [ 1083 ](rviz__visual__tools_8h_source.html#l01083) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


void RvizVisualTools::convertToXYZRPY(const Eigen::Isometry3d& pose, double& x, double& y, double& z, double& roll,
                                      double& pitch, double& yaw)
{
  x = pose(0, 3);
  y = pose(1, 3);
  z = pose(2, 3);


  // from
  // http://answers.ros.org/question/31006/how-can-a-vector3-axis-be-used-to-produce-a-quaternion/


  line_list_marker_.color = this_color;
  line_list_marker_.points.clear();
  line_list_marker_.colors.clear();


2. __init__(self: open3d.geometry.OrientedBoundingBox, arg0: open3d.geometry.OrientedBoundingBox) -> None


[ Open3D ](../index.html)


bool rviz_visual_tools::RvizVisualTools::publishSpheres  |  (  |  const
std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> & |  _points_ ,
---|---|---|---
|  |  const std::vector< std_msgs::ColorRGBA > & |  _colors_ ,
|  |  const geometry_msgs::Vector3 & |  _scale_ ,
|  |  const std::string & |  _ns_ = ` "Spheres" `
|  )  |  |

Definition at line [ 2370 ](rviz__visual__tools_8cpp_source.html#l02370) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  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);


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


bool RvizVisualTools::publishText(const geometry_msgs::Pose& pose, const std::string& text, colors color,
                                  const geometry_msgs::Vector3 scale, bool static_id)
{
  // Save the ID if this is a static ID or keep incrementing ID if not static
  double temp_id = text_marker_.id;
  if (static_id)
  {
    text_marker_.id = 0;
  }
  else
  {
    text_marker_.id++;
  }


Returns


##  ◆  RvizVisualTools()


Parameters


##  ◆  publishMarkers()


  std_msgs::ColorRGBA this_color = getColor(color);
  line_list_marker_.scale = getScale(scale, 0.25);
  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 RvizVisualTools::publishAxisPath(const EigenSTL::vector_Isometry3d& path, scales scale, const std::string& ns)
{
  // Create the cylinders
  for (const auto& i : path)
  {
    double radius = getScale(scale).x;
    publishAxisInternal(i, radius * 10.0, radius, ns);
  }


bool rviz_visual_tools::RvizVisualTools::publishLine  |  (  |  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)
`
|  )  |  |

Definition at line [ 1761 ](rviz__visual__tools_8cpp_source.html#l01761) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


    theta += DELTA_THETA;
  }


Definition at line [ 2283 ](rviz__visual__tools_8cpp_source.html#l02283) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  line_list_marker_.points.push_back(convertPoint(p2));
  line_list_marker_.points.push_back(convertPoint(p6));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


bool RvizVisualTools::publishMesh(const geometry_msgs::Pose& pose, const std::string& file_name, colors color,
                                  double scale, const std::string& ns, std::size_t id)
{
  // Set the timestamp
  mesh_marker_.header.stamp = ros::Time::now();


##  ◆  publishLines()  [1/2]


bool RvizVisualTools::publishLine(const geometry_msgs::Point& point1, const geometry_msgs::Point& point2,
                                  const std_msgs::ColorRGBA& color, const geometry_msgs::Vector3& scale)
{
  // Set the timestamp
  line_strip_marker_.header.stamp = ros::Time::now();


[ rviz_visual_tools ](http://wiki.ros.org/rviz_visual_tools)
Author(s): Dave Coleman  autogenerated on Mon Feb 28 2022 23:43:06


Copy constructor


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


* **translation** ( _numpy.ndarray_ _[_ _float64_ _[_ _3_ _,_ _1_ _]_ _]_ ) â A 3D vector to transform the geometry


  sphere_marker_.header.frame_id = base_frame_;  // restore default frame
  return true;
}


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


bool RvizVisualTools::publishSpheres(const std::vector<geometry_msgs::Point>& points, colors color, scales scale,
                                     const std::string& ns)
{
  return publishSpheres(points, color, getScale(scale), ns);
}


|  float rviz_visual_tools::RvizVisualTools::fRand  |  (  |  float  |  _min_ ,
---|---|---|---
|  |  float  |  _max_
|  )  |  |
static

Definition at line [ 2725 ](rviz__visual__tools_8cpp_source.html#l02725) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Definition at line [ 371 ](rviz__visual__tools_8cpp_source.html#l00371) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Parameters


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

Trigger the publish function to send out all collected markers.


##  ◆  publishPath()  [8/9]


  return result;
}


  return true;
}


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


Definition at line [ 1043 ](rviz__visual__tools_8h_source.html#l01043) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


Returns


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


|  void rviz_visual_tools::RvizVisualTools::convertToXYZRPY  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  std::vector< double > & |  _xyzrpy_
|  )  |  |
static

Convert an affine3d to xyz rpy components R-P-Y / X-Y-Z / 0-1-2 Euler Angle
Standard.


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


|  void rviz_visual_tools::RvizVisualTools::generateEmptyPose  |  (  |  [
geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _pose_ |  )  |
---|---|---|---|---|---
static

Create a pose of position (0,0,0) and quaternion (0,0,0,1)


bool rviz_visual_tools::RvizVisualTools::publishSpheres  |  (  |  const [
EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
& |  _points_ ,
---|---|---|---
|  |  const std::vector< [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) > & |
_colors_ ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  const std::string & |  _ns_ = ` "Spheres" `
|  )  |  |

Display a marker of a series of spheres, with the possibility of different
colors.


##  ◆  publishXYPlane()  [1/2]


##  ◆  alpha_


|  [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
rviz_visual_tools::RvizVisualTools::convertPoint  |  (  |  const
geometry_msgs::Vector3 & |  _point_ |  )  |
---|---|---|---|---|---
static

Convert a [ Vector3 ](../../../api/tf/html/c++/classVector3.html) to a
geometry_msg Point Note: Not thread safe but very convenient.


bool RvizVisualTools::publishABCDPlane(const double A, const double B, const double C, const double D, colors color,
                                       double x_width, double y_width)
{
  // The coefficients A,B,C give the normal to the plane.
  Eigen::Vector3d n(A, B, C);


Enum class for Geometry types.


, const std::string &ns="Cuboid", std::size_t id=0)
bool  |  [ publishCuboid
](classrviz__visual__tools_1_1RvizVisualTools.html#a6d99cc8cae4a2836a90421db8d2682fd)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, double depth, double width, double height, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color=
[ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
)
|  Display a rectangular cuboid.  More...

bool  |  [ publishCuboid
](classrviz__visual__tools_1_1RvizVisualTools.html#a87ca003d2f4e450ee2523175fbee8794)
(const Eigen::Isometry3d &pose, double depth, double width, double height, [
colors ](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3)
color= [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
)
bool  |  [ publishCylinder
](classrviz__visual__tools_1_1RvizVisualTools.html#ac68e6a50b016c4c3c7b3c1b3d33c2627)
(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.  More...

bool  |  [ publishCylinder
](classrviz__visual__tools_1_1RvizVisualTools.html#aead12df5c19c02e527e039983ad23c2c)
(const Eigen::Vector3d &point1, const Eigen::Vector3d &point2, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
double radius=0.01, const std::string &ns="Cylinder")
bool  |  [ publishCylinder
](classrviz__visual__tools_1_1RvizVisualTools.html#a33a1222a43282b95415cc9ca5ec9c3d2)
(const Eigen::Vector3d &point1, const Eigen::Vector3d &point2, const


  arrow_marker_.header.frame_id = base_frame_;  // restore default frame
  return true;
}


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


|  void rviz_visual_tools::RvizVisualTools::convertToXYZRPY  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  double & |  _x_ ,
|  |  double & |  _y_ ,
|  |  double & |  _z_ ,
|  |  double & |  _roll_ ,
|  |  double & |  _pitch_ ,
|  |  double & |  _yaw_
|  )  |  |
static

Definition at line [ 2592 ](rviz__visual__tools_8cpp_source.html#l02592) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


bool RvizVisualTools::publishGraph(const graph_msgs::GeometryGraph& graph, colors color, double radius)
{
  // Track which pairs of nodes we've already connected since graph is
  // bi-directional
  typedef std::pair<std::size_t, std::size_t> node_ids;
  std::set<node_ids> added_edges;
  std::pair<std::set<node_ids>::iterator, bool> return_value;
  Eigen::Vector3d a, b;
  for (std::size_t i = 0; i < graph.nodes.size(); ++i)
  {
    for (std::size_t j = 0; j < graph.edges[i].node_ids.size(); ++j)
    {
      // Check if we've already added this pair of nodes (edge)
      return_value = added_edges.insert(node_ids(i, j));
      if (!return_value.second)
      {
        // Element already existed in set, so don't add a new collision object
      }
      else
      {
        // Create a cylinder from two points
        a = convertPoint(graph.nodes[i]);
        b = convertPoint(graph.nodes[graph.edges[i].node_ids[j]]);


Public Member Functions  |  Static Public Member Functions  |  Protected
Attributes  |  Static Protected Attributes  |  Private Member Functions  | [
List of all members ](classrviz__visual__tools_1_1RvizVisualTools-
members.html)


|  void rviz_visual_tools::RvizVisualTools::setBaseFrame  |  (  |  const
std::string & |  _base_frame_ |  )  |
---|---|---|---|---|---
inline

Change the global base frame Note: this might reset all your current markers.


bool rviz_visual_tools::RvizVisualTools::publishSpheres  |  (  |  const
std::vector< [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
> & |  _points_ ,
---|---|---|---
|  |  [ 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_ = ` "Spheres" `
|  )  |  |

Definition at line [ 2319 ](rviz__visual__tools_8cpp_source.html#l02319) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


  // 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);


()
|  Deconstructor.  More...

##  Static Public Member Functions

---
static Eigen::Isometry3d  |  [ convertFromXYZRPY
](classrviz__visual__tools_1_1RvizVisualTools.html#a942e62d26caacb3f097aa4ef5113551a)
(double tx, double ty, double tz, double rx, double ry, double rz, [
EulerConvention
](namespacerviz__visual__tools.html#a25a0ae702485241183604425b99eb8c6)
convention)
|  Converts scalar translations and rotations to an [ Eigen
](../../../api/rviz/html/c++/namespaceEigen.html) Frame. This is achieved by
chaining a translation with individual euler rotations in ZYX order (this is
equivalent to fixed rotatins XYZ) [
http://en.wikipedia.org/wiki/Euler_angles#Conversion_between_intrinsic_and_extrinsic_rotations
](http://en.wikipedia.org/wiki/Euler_angles#Conversion_between_intrinsic_and_extrinsic_rotations)
Euler conversion code sourced from Descartes, Copyright (c) 2014, Southwest
Research Institute.  More...

static Eigen::Isometry3d  |  [ convertFromXYZRPY
](classrviz__visual__tools_1_1RvizVisualTools.html#aa6dbf5cc05a50c8fd956871f5cb4848f)
(const std::vector< double > &transform6, [ EulerConvention
](namespacerviz__visual__tools.html#a25a0ae702485241183604425b99eb8c6)
convention)
static Eigen::Vector3d  |  [ convertPoint
](classrviz__visual__tools_1_1RvizVisualTools.html#a3e8aa7efcac2e7e302b62977b711759f)
(const [ geometry_msgs::Point
](../../../api/tf/html/c++/namespacetf.html#a55ddfd1e43e4fc81a11d51e0e75e9e2c)
&point)
|  Convert a geometry_msg point to an [ Eigen
](../../../api/rviz/html/c++/namespaceEigen.html) point Note: Not thread safe
but very convenient.  More...

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


  if (verbose)
  {
    std::cout << std::endl;
    std::cout << "axis_vector after normalize " << std::endl;
    printTranslation(axis_vector);
  }


name of base frame


Returns


  if (id == 0)
  {  // Provide a new id every call to this function
    cuboid_marker_.id++;
  }
  else
  {  // allow marker to be overwritten
    cuboid_marker_.id = id;
  }


|  double rviz_visual_tools::RvizVisualTools::alpha_ = 1.0
---
protected

Definition at line [ 1082 ](rviz__visual__tools_8h_source.html#l01082) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


[ ![ROS Answers logo](/m/ros/media/images/logoros.png?v=28) ](/questions/)


` Image ` _= Type.Image_ Â¶


**The plugin cannot display the topic if the above methods are not working.
How do I fix this?**


  geometry_msgs::Point p[3];
  static const double DELTA_THETA = M_PI / 16.0;
  double theta = 0;


Eigen::Isometry3d rviz_visual_tools::RvizVisualTools::getVectorBetweenPoints
|  (  |  const Eigen::Vector3d & |  _a_ ,
---|---|---|---
|  |  const Eigen::Vector3d & |  _b_
|  )  |  |  const

Create a vector that points from point a to point b.


bool rviz_visual_tools::RvizVisualTools::publishMesh  |  (  |  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 `
|  )  |  |

Definition at line [ 1570 ](rviz__visual__tools_8cpp_source.html#l01570) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Definition at line [ 853 ](rviz__visual__tools_8cpp_source.html#l00853) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


Parameters


bool RvizVisualTools::waitForSubscriber(const ros::Publisher& pub, double wait_time, bool blocking)
{
  // Will wait at most this amount of time
  ros::Time max_time(ros::Time::now() + ros::Duration(wait_time));


##  ◆  line_strip_marker_


     color  |  \- an enum pre-defined name of a color
---|---

Returns


##  ◆  printTranslation()


  line_list_marker_.points.push_back(convertPoint(p6));
  line_list_marker_.points.push_back(convertPoint(p7));
  line_list_marker_.colors.push_back(this_color);
  line_list_marker_.colors.push_back(this_color);


bool RvizVisualTools::publishText(const geometry_msgs::Pose& pose, const std::string& text, colors color, scales scale,
                                  bool static_id)
{
  return publishText(pose, text, color, getScale(scale), static_id);
}


     pub  |  \- the publisher to check for subscribers
---|---
wait_time  |  \- time to wait for subscriber to be available before throwing
warning
blocking  |  \- if true, the function loop until a subscriber is gotten

Returns


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


q = Eigen::AngleAxis<double>(angle_rotation, right_axis_vector);


bool rviz_visual_tools::RvizVisualTools::publishAxis  |  (  |  const [
geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _pose_ ,
---|---|---|---
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  const std::string & |  _ns_ = ` "Axis" `
|  )  |  |

Display a red/green/blue coordinate frame axis.


     graph  |  of nodes and edges
---|---
color  |  \- an enum pre-defined name of a color
radius  |  \- width of cylinders

Returns


Definition at line [ 203 ](rviz__visual__tools_8h_source.html#l00203) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


true on success


##  ◆  publishLine()  [8/8]


##  ◆  publishText()  [2/4]


  // Publish z axis
  Eigen::Isometry3d z_pose = Eigen::Translation3d(0, 0, length / 2.0) * Eigen::AngleAxisd(0, Eigen::Vector3d::UnitZ());
  z_pose = pose * z_pose;
  publishCylinder(z_pose, BLUE, length, radius, ns);


__ [ Open3D ](../index.html)


/collision_map_out (via mapping_rviz_plugin) not displaying in octomap_server


  return true;
}


##  ◆  publishSphere()  [2/11]


  // Set the pose
  triangle_marker_.pose = pose;


##  ◆  publishPolygon()


Definition at line [ 1807 ](rviz__visual__tools_8cpp_source.html#l01807) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


[ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale)
bool  |  [ publishXArrow
](classrviz__visual__tools_1_1RvizVisualTools.html#a6a7cc9fbcaf8371c0739468e618437d6)
(const Eigen::Isometry3d &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
](../../../api/tf2/html/namespacetf2.html#ab20034dc53b40043a702876ff38c78a1)
=0.0)
|  Display an arrow along the x-axis of a pose.  More...

bool  |  [ publishXArrow
](classrviz__visual__tools_1_1RvizVisualTools.html#ac7aba9c7752f420ab3706e7bced56a01)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&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
](../../../api/tf2/html/namespacetf2.html#ab20034dc53b40043a702876ff38c78a1)
=0.0)
bool  |  [ publishXArrow
](classrviz__visual__tools_1_1RvizVisualTools.html#a5fb5f40eaba4fd52f525d4f327288822)
(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=


Eigen::Isometry3d RvizVisualTools::getVectorBetweenPoints(const Eigen::Vector3d& a, const Eigen::Vector3d& b) const
{
  bool verbose = false;


##  ◆  publishSphere()  [7/11]


` get_axis_aligned_bounding_box ` (  _self_ )  Â¶


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


##  Constructor & Destructor Documentation


  return result;
}


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

Definition at line [ 1099 ](rviz__visual__tools_8h_source.html#l01099) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


##  ◆  publishLine()  [4/8]


  if (path.size() != colors.size())
  {
    ROS_ERROR_STREAM_NAMED(LOGNAME,
                           "Skipping path because " << path.size() << " different from " << colors.size() << ".");
    return false;
  }


  // Graphic is centered at this point
  double distance = D / n.norm();
  Eigen::Vector3d center = -distance * n.normalized();


[ Powered by Askbot version 0.10.2 ](http://askbot.com)


` HalfEdgeTriangleMesh ` _= Type.HalfEdgeTriangleMesh_ Â¶


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

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


##  ◆  base_frame_


##  Code API
See [ VisualTools Class Reference
](http://docs.ros.org/kinetic/api/moveit_visual_tools/html/classmoveit__visual__tools_1_1MoveItVisualTools.html)
##  Usage
We'll assume you will be using these helper functions within a class.
###  Initialize
Add to your includes:

    #include <moveit_visual_tools/moveit_visual_tools.h>

Add to your class's member variables:

    // For visualizing things in rviz
    moveit_visual_tools::MoveItVisualToolsPtr visual_tools_;

In your class' constructor add:

    visual_tools_ = std::make_shared<moveit_visual_tools::MoveItVisualTools>(node_, "world", "/moveit_visual_tools");

###  Collision Object Functions
Helpers for adding and removing objects from the MoveIt planning scene. CO
stands for Collision Object and ACO stands for Active Collision Object.
  * cleanupCO
  * cleanupACO
  * attachCO
  * publishCollisionBlock
  * publishCollisionCylinder
  * publishCollisionTree
  * publishCollisionTable
  * publishCollisionWall
And more...
###  Animate Trajectories
Higher level robot and trajectory functions
  * publishTrajectoryPath
  * publishTrajectoryPoint
  * publishRobotState


Apply transformation (4x4 matrix) to the geometry coordinates.


bool RvizVisualTools::publishLine(const Eigen::Vector3d& point1, const Eigen::Vector3d& point2,
                                  const std_msgs::ColorRGBA& color, scales scale)
{
  return publishLine(convertPoint(point1), convertPoint(point2), color, scale);
}


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


bool rviz_visual_tools::RvizVisualTools::publishYArrow  |  (  |  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
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  double  |  _length_ = ` 0.0 `
|  )  |  |

Definition at line [ 1254 ](rviz__visual__tools_8cpp_source.html#l01254) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  publishPath()  [6/9]


|  void rviz_visual_tools::RvizVisualTools::printTransform  |  (  |  const
Eigen::Isometry3d & |  _transform_ |  )  |
---|---|---|---|---|---
static

Display in the console a transform in quaternions.


##  ◆  frame_locking_enabled_


  // Prevent scale from being zero
  if (cuboid_marker_.scale.x == 0.0)
  {
    cuboid_marker_.scale.x = SMALL_SCALE;
  }
  if (cuboid_marker_.scale.y == 0.0)
  {
    cuboid_marker_.scale.y = SMALL_SCALE;
  }
  if (cuboid_marker_.scale.z == 0.0)
  {
    cuboid_marker_.scale.z = SMALL_SCALE;
  }


&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#aa4a9812597c3b5810004267a890d0a5b)
(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)
)
bool  |  [ publishLine
](classrviz__visual__tools_1_1RvizVisualTools.html#a21c6dd4cf12ff416daa84af92bf3ef8a)
(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, const geometry_msgs::Vector3
&scale)
bool  |  [ publishLines
](classrviz__visual__tools_1_1RvizVisualTools.html#adc26c6a39c80b60cb37f9de213952947)
(const [ EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
&aPoints, const [ EigenSTL::vector_Vector3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a79212253ac3459b428e7d37d1601a7d2)
&bPoints, const std::vector< [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) > & [
colors ](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3)
, [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) scale=
[ MEDIUM


bool RvizVisualTools::publishCuboid(const Eigen::Vector3d& point1, const Eigen::Vector3d& point2, colors color)
{
  return publishCuboid(convertPoint(point1), convertPoint(point2), color);
}


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

Definition at line [ 1069 ](rviz__visual__tools_8h_source.html#l01069) of file
[ rviz_visual_tools.h ](rviz__visual__tools_8h_source.html) .


     pose  |
---|---

Returns


bool rviz_visual_tools::RvizVisualTools::publishText  |  (  |  const
Eigen::Isometry3d & |  _pose_ ,
---|---|---|---
|  |  const std::string & |  _text_ ,
|  |  [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) |
_color_ = ` [ WHITE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a23885a26fe14a38b7ec48819c423fd9a)
` ,
|  |  [ scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |
_scale_ = ` [ MEDIUM
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835a322895c45564210483089d04f6a07473)
` ,
|  |  bool  |  _static_id_ = ` true `
|  )  |  |

Display a marker of a text.


Definition at line [ 300 ](rviz__visual__tools_8cpp_source.html#l00300) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


##  ◆  intToRvizScale()


  // Load Cylinder ----------------------------------------------------
  cylinder_marker_.header.frame_id = base_frame_;
  // Set the marker action.  Options are ADD and DELETE
  cylinder_marker_.action = visualization_msgs::Marker::ADD;
  // Set the marker type.
  cylinder_marker_.type = visualization_msgs::Marker::CYLINDER;
  // Lifetime
  cylinder_marker_.lifetime = marker_lifetime_;
  // Constants
  cylinder_marker_.pose = getIdentityPose();


double RvizVisualTools::dRand(double min, double max)
{
  return std::uniform_real_distribution<double>(min, max)(mt_random_engine_);
}


      result.g = 0.1;
      result.b = 0.8;
      result.a = alpha_;
      break;
  }


##  ◆  publishWireframeCuboid()  [2/2]


##  ◆  publishArrow()  [1/4]


Returns


* **center** ( _bool_ _,_ _optional_ _,_ _default=True_ ) â If true, then the scale is applied to the centered geometry


void rviz_visual_tools::RvizVisualTools::loadRemoteControl  |  (  |  |  )  |
---|---|---|---|---

Pre-load remote control.


void rviz_visual_tools::RvizVisualTools::resetMarkerCounts  |  (  |  |  )  |
---|---|---|---|---

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. ")


= { [ RED
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a269d2451e2a4b2d6744d2d958a8a8467)
, [ GREEN
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a54300acbac130f358566327dd13a1fd2)
, [ BLUE
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a6cd27d693df45662c3ecebdc4dc8b671)
, [ GREY
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a845b6ccd8f535f790a19d30dd488e59f)
, [ DARK_GREY
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3a089b5d160a343e711659d528c26f1c35)
,


  // Orientation on place
  pose.orientation.x = 0;
  pose.orientation.y = 0;
  pose.orientation.z = 0;
  pose.orientation.w = 1;
  return pose;
}


Definition at line [ 2776 ](rviz__visual__tools_8cpp_source.html#l02776) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


The site is read-only. Please transition to use Robotics Stack Exchange


  if (verbose)
  {
    std::cout << std::endl;
    std::cout << "axis_vector " << std::endl;
    printTranslation(axis_vector);
  }


std_msgs::ColorRGBA RvizVisualTools::getColor(colors color) const
{
  std_msgs::ColorRGBA result;


[ ![cc-by-sa](/m/default/media/images/cc-by-sa.png?v=28)
](http://creativecommons.org/licenses/by-sa/3.0/legalcode) ROS Answers is
licensed under Creative Commons Attribution 3.0 Content on this site is
licensed under a [ Creative Commons Attribution Share Alike 3.0
](http://creativecommons.org/licenses/by-sa/3.0/legalcode) license.


  // Allows an individual marker size factor and a size factor for all markers
  result.x = val * marker_scale * global_scale_;
  result.y = val * marker_scale * global_scale_;
  result.z = val * marker_scale * global_scale_;


Parameters


     pose  |
---|---

Returns


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

Display a marker of a series of connected colored cylinders.


}  // namespace rviz_visual_tools


converted pose


float


](classrviz__visual__tools_1_1RvizVisualTools.html#a1b186ccc3de021d51572b40b017f90a0)
(std::size_t color)
|  Used by interfaces that do not directly depend on Rviz Visual Tools, such
as OMPL.  More...

static [ rviz_visual_tools::scales
](namespacerviz__visual__tools.html#a5b544decae321663ea907bb26338d835) |  [
intToRvizScale
](classrviz__visual__tools_1_1RvizVisualTools.html#a3b9857ab1cbba6a3191e64e07440f573)
(std::size_t scale)
|  Used by interfaces that do not directly depend on Rviz Visual Tools, such
as OMPL.  More...

static int  |  [ iRand
](classrviz__visual__tools_1_1RvizVisualTools.html#aea89707a5df1b40528db118f7c4e5c1d)
(int [ min
](../../../api/roslz4/html/lz4s_8c.html#abd8bbcfabb3ddef2ccaafb9928a37b95) ,
int [ max
](../../../api/orocos_kdl/html/namespaceKDL.html#adb3f6f67f41bc87f6d98423ac7a5b92f)
)
static bool  |  [ posesEqual
](classrviz__visual__tools_1_1RvizVisualTools.html#a69cb2d383e918ef055442de418a7c6c8)
(const Eigen::Isometry3d &pose1, const Eigen::Isometry3d &pose2, double
threshold=0.000001)
|  Test if two [ Eigen ](../../../api/rviz/html/c++/namespaceEigen.html) poses
are close enough.  More...

static void  |  [ printTransform
](classrviz__visual__tools_1_1RvizVisualTools.html#acf96c5e3ea905c7df56c346e3ef6c3b4)
(const Eigen::Isometry3d &transform)
|  Display in the console a transform in quaternions.  More...

static void  |  [ printTransformFull
](classrviz__visual__tools_1_1RvizVisualTools.html#affd4230ab254d77068469d4334812db4)
(const Eigen::Isometry3d &transform)
|  Display in the console a transform with full 3x3 rotation matrix.  More...

static void  |  [ printTransformRPY
](classrviz__visual__tools_1_1RvizVisualTools.html#a007004e463cae8723fd1f3b762a6f941)
(const Eigen::Isometry3d &transform)


##  ◆  publishXArrow()  [1/3]


  // override previous x scale specified
  if (length == 0)
  {  // auto set the scale
    arrow_marker_.scale.x *= 10.0;
  }
  else
  {
    arrow_marker_.scale.x = length;
  }


  // Check if any actual markers exist to publish
  if (markers.markers.empty())
  {
    return false;
  }


  markers_.markers.clear();  // remove all cached markers
  return result;
}


Returns


RvizVisualTools::RvizVisualTools(std::string base_frame, std::string marker_topic, ros::NodeHandle nh)
  : nh_(nh), marker_topic_(std::move(marker_topic)), base_frame_(std::move(base_frame))
{
  initialize();
}


geometry_msgs::Pose RvizVisualTools::getIdentityPose()
{
  geometry_msgs::Pose pose;
  // Position
  pose.position.x = 0;
  pose.position.y = 0;
  pose.position.z = 0;


Definition at line [ 2756 ](rviz__visual__tools_8cpp_source.html#l02756) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .


](classrviz__visual__tools_1_1RvizVisualTools.html#a068ef4337820ca3cff6b9e820915c7da)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&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)
, const std::string &ns="Sphere", std::size_t id=0)
bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#a6557e6d80e7d59571db56c9b4250c62b)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
double scale, const std::string &ns="Sphere", std::size_t id=0)
bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#a62623757e3d93a3482aae974797b6edd)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, [ colors
](namespacerviz__visual__tools.html#abd3566ac96adb96a35044b029930e6e3) color,
const geometry_msgs::Vector3 scale, const std::string &ns="Sphere",
std::size_t id=0)
bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#ad1ea4a207703a13bb6da4258d50a3d2e)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&pose, const std_msgs::ColorRGBA &color, const geometry_msgs::Vector3 scale,
const std::string &ns="Sphere", std::size_t id=0)
bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#a604347b620db320012287334d77bae67)
(const Eigen::Isometry3d &pose, const std_msgs::ColorRGBA &color, const
geometry_msgs::Vector3 scale, const std::string &ns="Sphere", std::size_t
id=0)
bool  |  [ publishSphere
](classrviz__visual__tools_1_1RvizVisualTools.html#ab75c0b9648b526283bbe6b8d3352daff)


int RvizVisualTools::iRand(int min, int max)
{
  return std::uniform_int_distribution<int>(min, max)(mt_random_engine_);
}


|  void rviz_visual_tools::RvizVisualTools::convertPoseSafe  |  (  |  const [
geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _pose_msg_ ,
---|---|---|---
|  |  Eigen::Isometry3d & |  _pose_
|  )  |  |
static

Convert a geometry_msg pose to an [ Eigen
](../../../api/rviz/html/c++/namespaceEigen.html) pose - thread safe.


##  ◆  all_rand_colors_


void RvizVisualTools::convertToXYZRPY(const Eigen::Isometry3d& pose, std::vector<double>& xyzrpy)
{
  xyzrpy.resize(6);
  convertToXYZRPY(pose, xyzrpy[0], xyzrpy[1], xyzrpy[2], xyzrpy[3], xyzrpy[4], xyzrpy[5]);
}


##  ◆  setLifetime()


bool RvizVisualTools::publishCuboid(const geometry_msgs::Pose& pose, double depth, double width, double height,
                                    colors color)
{
  cuboid_marker_.header.stamp = ros::Time::now();


true on success


Definition at line [ 1063 ](rviz__visual__tools_8cpp_source.html#l01063) of
file [ rviz_visual_tools.cpp ](rviz__visual__tools_8cpp_source.html) .