Skip to content

Commit 60e2b19

Browse files
committed
Fix deprecation issues, rename func publishMarkersWithoutTrigger()
- Switch to C++14 deprecation approach
1 parent 3ea03e7 commit 60e2b19

File tree

3 files changed

+16
-64
lines changed

3 files changed

+16
-64
lines changed

include/rviz_visual_tools/deprecation.h

Lines changed: 0 additions & 51 deletions
This file was deleted.

include/rviz_visual_tools/rviz_visual_tools.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
#include <trajectory_msgs/JointTrajectory.h>
6767

6868
// rviz_visual_tools
69-
#include <rviz_visual_tools/deprecation.h>
7069
#include <rviz_visual_tools/remote_control.h>
7170

7271
// Import/export for windows dll's and visibility for gcc shared libraries.
@@ -398,10 +397,16 @@ class RvizVisualTools
398397

399398
/**
400399
* \brief Display an array of markers, allows reuse of the ROS publisher
401-
* \param markers
400+
* This will automatically call publish(), skipping the need for trigger()
401+
* \param markers: array of visualizations to display in Rviz
402402
* \return true on success
403403
*/
404-
bool publishMarkers(visualization_msgs::MarkerArray& markers);
404+
bool publishMarkersWithoutTrigger(visualization_msgs::MarkerArray& markers);
405+
// TODO(davetcoleman): Deprecated August 2019, remove in 1 year
406+
[[deprecated]] bool publishMarkers(visualization_msgs::MarkerArray& markers)
407+
{
408+
publishMarkersWithoutTrigger(markers);
409+
}
405410

406411
/**
407412
* \brief Display a cone of a given angle along the x-axis
@@ -646,14 +651,15 @@ class RvizVisualTools
646651
const std::vector<std_msgs::ColorRGBA>& colors, const geometry_msgs::Vector3& scale);
647652

648653
/**
649-
* \brief Display a series of connected lines using the LINE_STRIP method - deprecated because visual bugs
654+
* \brief Display a series of connected lines using the LINE_STRIP method
650655
* \param path - a series of points to connect with lines
651656
* \param color - an enum pre-defined name of a color
652657
* \param scale - an enum pre-defined name of a size
653658
* \param ns - namespace of marker
654659
* \return true on success
655660
*/
656-
bool publishLineStrip(const std::vector<geometry_msgs::Point>& path, colors color = RED, scales scale = MEDIUM,
661+
// TODO(davetcoleman): deprecated August 2019 because visual bugs
662+
[[deprecated]] bool publishLineStrip(const std::vector<geometry_msgs::Point>& path, colors color = RED, scales scale = MEDIUM,
657663
const std::string& ns = "Path");
658664

659665
/**

src/rviz_visual_tools.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ namespace rviz_visual_tools
5454

5555
const std::string LOGNAME = "visual_tools";
5656

57-
// DEPRECATED, remove in Melodic after Dec 2018 release or so
58-
const std::string RvizVisualTools::name_ = "visual_tools";
59-
6057
const std::array<colors, 14> RvizVisualTools::all_rand_colors_ = { RED, GREEN, BLUE, GREY, DARK_GREY,
6158
WHITE, ORANGE, YELLOW, BROWN, PINK,
6259
LIME_GREEN, PURPLE, CYAN, MAGENTA };
@@ -102,7 +99,7 @@ bool RvizVisualTools::loadRvizMarkers()
10299
reset_marker_.header.frame_id = base_frame_;
103100
reset_marker_.header.stamp = ros::Time();
104101
reset_marker_.ns = "deleteAllMarkers"; // helps during debugging
105-
reset_marker_.action = 3; // TODO(davetcoleman): In ROS-J set to visualization_msgs::Marker::DELETEALL;
102+
reset_marker_.action = visualization_msgs::Marker::DELETEALL;
106103
reset_marker_.pose.orientation.w = 1;
107104

108105
// Load arrow ----------------------------------------------------
@@ -871,13 +868,13 @@ bool RvizVisualTools::trigger()
871868
return false;
872869
}
873870

874-
bool result = publishMarkers(markers_);
871+
bool result = publishMarkersWithoutTrigger(markers_);
875872

876873
markers_.markers.clear(); // remove all cached markers
877874
return result;
878875
}
879876

880-
bool RvizVisualTools::publishMarkers(visualization_msgs::MarkerArray& markers)
877+
bool RvizVisualTools::publishMarkersWithoutTrigger(visualization_msgs::MarkerArray& markers)
881878
{
882879
if (pub_rviz_markers_ == nullptr)
883880
{ // always check this before publishing
@@ -1629,13 +1626,13 @@ bool RvizVisualTools::publishMesh(const geometry_msgs::Pose& pose, const std::st
16291626
return publishMarker(mesh_marker_);
16301627
}
16311628

1632-
bool RvizVisualTools::publishMesh(const Eigen::Isometry3d& pose, const shape_msgs::Mesh& mesh, colors color,
1629+
bool RvizVisualTools::publishMesh(const Eigen::Isometry3d& pose, const shape_msgs::Mesh& mesh, colors color,
16331630
double scale, const std::string& ns, std::size_t id)
16341631
{
16351632
return publishMesh(convertPose(pose), mesh, color, scale, ns, id);
16361633
}
16371634

1638-
bool RvizVisualTools::publishMesh(const geometry_msgs::Pose& pose, const shape_msgs::Mesh& mesh, colors color,
1635+
bool RvizVisualTools::publishMesh(const geometry_msgs::Pose& pose, const shape_msgs::Mesh& mesh, colors color,
16391636
double scale, const std::string& ns, std::size_t id)
16401637
{
16411638
triangle_marker_.header.stamp = ros::Time::now();

0 commit comments

Comments
 (0)