Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation issues, rename func publishMarkersWithoutTrigger() #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions include/rviz_visual_tools/deprecation.h

This file was deleted.

18 changes: 12 additions & 6 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,15 +652,16 @@ 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,
const std::string& ns = "Path");
// 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");

/**
* \brief Display a marker of a series of connected cylinders
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