Skip to content

Commit

Permalink
Fix deprecation issues, rename func publishMarkersWithoutTrigger()
Browse files Browse the repository at this point in the history
- Switch to C++14 deprecation approach
  • Loading branch information
davetcoleman committed Aug 21, 2019
1 parent b454935 commit 926dc21
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 62 deletions.
51 changes: 0 additions & 51 deletions include/rviz_visual_tools/deprecation.h

This file was deleted.

16 changes: 11 additions & 5 deletions include/rviz_visual_tools/rviz_visual_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
#include <trajectory_msgs/JointTrajectory.h>

// rviz_visual_tools
#include <rviz_visual_tools/deprecation.h>
#include <rviz_visual_tools/remote_control.h>

// Import/export for windows dll's and visibility for gcc shared libraries.
Expand Down Expand Up @@ -399,10 +398,16 @@ class RvizVisualTools

/**
* \brief Display an array of markers, allows reuse of the ROS publisher
* \param markers
* This will automatically call publish(), skipping the need for trigger()
* \param markers: array of visualizations to display in Rviz
* \return true on success
*/
bool publishMarkers(visualization_msgs::MarkerArray& markers);
bool publishMarkersWithoutTrigger(visualization_msgs::MarkerArray& markers);
// TODO(davetcoleman): Deprecated August 2019, remove in 1 year
[[deprecated]] bool publishMarkers(visualization_msgs::MarkerArray& markers)
{
publishMarkersWithoutTrigger(markers);
}

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

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

/**
Expand Down
9 changes: 3 additions & 6 deletions src/rviz_visual_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ namespace rviz_visual_tools
{
const std::string LOGNAME = "visual_tools";

// DEPRECATED, remove in Melodic after Dec 2018 release or so
const std::string RvizVisualTools::name_ = "visual_tools";

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 };
Expand Down Expand Up @@ -101,7 +98,7 @@ bool RvizVisualTools::loadRvizMarkers()
reset_marker_.header.frame_id = base_frame_;
reset_marker_.header.stamp = ros::Time();
reset_marker_.ns = "deleteAllMarkers"; // helps during debugging
reset_marker_.action = 3; // TODO(davetcoleman): In ROS-J set to visualization_msgs::Marker::DELETEALL;
reset_marker_.action = visualization_msgs::Marker::DELETEALL;
reset_marker_.pose.orientation.w = 1;

// Load arrow ----------------------------------------------------
Expand Down Expand Up @@ -871,13 +868,13 @@ bool RvizVisualTools::trigger()
return false;
}

bool result = publishMarkers(markers_);
bool result = publishMarkersWithoutTrigger(markers_);

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

bool RvizVisualTools::publishMarkers(visualization_msgs::MarkerArray& markers)
bool RvizVisualTools::publishMarkersWithoutTrigger(visualization_msgs::MarkerArray& markers)
{
if (pub_rviz_markers_ == nullptr)
{ // always check this before publishing
Expand Down

0 comments on commit 926dc21

Please sign in to comment.