Skip to content

Commit 926dc21

Browse files
committed
Fix deprecation issues, rename func publishMarkersWithoutTrigger()
- Switch to C++14 deprecation approach
1 parent b454935 commit 926dc21

File tree

3 files changed

+14
-62
lines changed

3 files changed

+14
-62
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.
@@ -399,10 +398,16 @@ class RvizVisualTools
399398

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

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

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

660666
/**

src/rviz_visual_tools.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ namespace rviz_visual_tools
5353
{
5454
const std::string LOGNAME = "visual_tools";
5555

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

107104
// 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

0 commit comments

Comments
 (0)