Go to the documentation of this file.
35 #include <boost/bind.hpp>
36 #include <boost/make_shared.hpp>
39 #define DBG_MSG( ... ) ROS_DEBUG( __VA_ARGS__ );
48 const std::string &topic_ns )
49 : state_(
"InteractiveMarkerClient",IDLE)
51 , last_num_publishers_(0)
52 , enable_autocomplete_transparency_(true)
55 if ( !topic_ns.empty() )
158 DBG_MSG(
"Subscribed to init topic: %s", (
topic_ns_+
"/update_full").c_str() );
168 template<
class MsgConstPtrT>
174 if ( msg->server_id.empty() )
191 DBG_MSG(
"New publisher detected: %s", msg->server_id.c_str() );
201 client = context_it->second;
210 process<InitConstPtr>(msg);
215 process<UpdateConstPtr>(msg);
240 bool initialized =
true;
242 M_SingleClient::iterator it;
250 single_client->update();
251 if ( !single_client->isInitialized() )
278 DBG_MSG(
"%s: %s (Status: OK)", server_id.c_str(), msg.c_str() );
281 DBG_MSG(
"%s: %s (Status: WARNING)", server_id.c_str(), msg.c_str() );
284 DBG_MSG(
"%s: %s (Status: ERROR)", server_id.c_str(), msg.c_str() );
INTERACTIVE_MARKERS_PUBLIC void setResetCb(const ResetCallback &cb)
Set callback for resetting one server connection.
boost::function< void(StatusT, const std::string &, const std::string &) > StatusCallback
StatusCallback status_cb_
void statusCb(StatusT s, const std::string &id, const std::string &m) const
visualization_msgs::InteractiveMarkerInitConstPtr InitConstPtr
bool enable_autocomplete_transparency_
INTERACTIVE_MARKERS_PUBLIC void setInitCb(const InitCallback &cb)
Set callback for init messages.
void processInit(const InitConstPtr &msg)
boost::function< void(const UpdateConstPtr &) > UpdateCallback
void setInitCb(InitCallback init_cb)
INTERACTIVE_MARKERS_PUBLIC ~InteractiveMarkerClient()
Will cause a 'reset' call for all server ids.
INTERACTIVE_MARKERS_PUBLIC void setTargetFrame(std::string target_frame)
Change the target frame and reset the connection.
void setStatusCb(StatusCallback status_cb)
uint32_t getNumPublishers() const
INTERACTIVE_MARKERS_PUBLIC void subscribe(std::string topic_ns)
Subscribe to the topics topic_ns/update and topic_ns/init.
INTERACTIVE_MARKERS_PUBLIC void update()
Update tf info, call callbacks.
boost::recursive_mutex publisher_contexts_mutex_
boost::function< void(const std::string &) > ResetCallback
void setResetCb(ResetCallback reset_cb)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
INTERACTIVE_MARKERS_PUBLIC void setUpdateCb(const UpdateCallback &cb)
Set callback for update messages.
INTERACTIVE_MARKERS_PUBLIC void setStatusCb(const StatusCallback &cb)
Set callback for status updates.
void statusCb(StatusT status, const std::string &server_id, const std::string &msg)
INTERACTIVE_MARKERS_PUBLIC void shutdown()
Unsubscribe, clear queues & call reset callbacks.
void setUpdateCb(UpdateCallback update_cb)
void process(const MsgConstPtrT &msg)
boost::function< void(const InitConstPtr &) > InitCallback
INTERACTIVE_MARKERS_PUBLIC InteractiveMarkerClient(tf2_ros::Buffer &tf, const std::string &target_frame="", const std::string &topic_ns="")
visualization_msgs::InteractiveMarkerUpdateConstPtr UpdateConstPtr
ros::Subscriber init_sub_
ros::Subscriber update_sub_
uint32_t last_num_publishers_
M_SingleClient publisher_contexts_
std::string target_frame_
StateMachine< StateT > state_
void processUpdate(const UpdateConstPtr &msg)
interactive_markers
Author(s): David Gossow, William Woodall
autogenerated on Fri Oct 27 2023 02:31:54