Skip to content

Commit

Permalink
replace topic_ns with namespace and pass the parameter to the node_ha…
Browse files Browse the repository at this point in the history
…ndle constructor
  • Loading branch information
LeroyR committed Feb 17, 2022
1 parent 051af05 commit b36c8ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions include/interactive_markers/interactive_marker_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ class InteractiveMarkerServer : boost::noncopyable

static const uint8_t DEFAULT_FEEDBACK_CB = 255;

/// @param topic_ns The interface will use the topics topic_ns/update and
/// topic_ns/feedback for communication.
/// @param node_ns Namespace of the server node. The interface will use the topics update and
/// feedback for communication.
/// @param server_id If you run multiple servers on the same topic from
/// within the same node, you will need to assign different names to them.
/// Otherwise, leave this empty.
/// @param spin_thread If set to true, will spin up a thread for message handling.
/// All callbacks will be called from that thread.
INTERACTIVE_MARKERS_PUBLIC
InteractiveMarkerServer( const std::string &topic_ns, const std::string &server_id="", bool spin_thread = false );
InteractiveMarkerServer( const std::string &node_ns, const std::string &server_id="", bool spin_thread = false );

/// Destruction of the interface will lead to all managed markers being cleared.
INTERACTIVE_MARKERS_PUBLIC
Expand Down
8 changes: 4 additions & 4 deletions src/interactive_marker_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
namespace interactive_markers
{

InteractiveMarkerServer::InteractiveMarkerServer( const std::string &topic_ns, const std::string &server_id, bool spin_thread ) :
topic_ns_(topic_ns),
InteractiveMarkerServer::InteractiveMarkerServer( const std::string &node_ns, const std::string &server_id, bool spin_thread ) :
node_handle_(node_ns),
seq_num_(0)
{
if ( spin_thread )
Expand All @@ -58,9 +58,9 @@ InteractiveMarkerServer::InteractiveMarkerServer( const std::string &topic_ns, c
server_id_ = ros::this_node::getName();
}

std::string update_topic = topic_ns + "/update";
std::string update_topic = "update";
std::string init_topic = update_topic + "_full";
std::string feedback_topic = topic_ns + "/feedback";
std::string feedback_topic = "feedback";

init_pub_ = node_handle_.advertise<visualization_msgs::InteractiveMarkerInit>( init_topic, 100, true );
update_pub_ = node_handle_.advertise<visualization_msgs::InteractiveMarkerUpdate>( update_topic, 100 );
Expand Down

0 comments on commit b36c8ed

Please sign in to comment.