32 #ifndef INTERACTIVE_MARKER_CLIENT 33 #define INTERACTIVE_MARKER_CLIENT 35 #include <boost/shared_ptr.hpp> 36 #include <boost/thread/mutex.hpp> 37 #include <boost/function.hpp> 38 #include <boost/unordered_map.hpp> 47 #include <visualization_msgs/InteractiveMarkerInit.h> 48 #include <visualization_msgs/InteractiveMarkerUpdate.h> 79 typedef visualization_msgs::InteractiveMarkerInitConstPtr
InitConstPtr;
82 typedef boost::function< void ( const InitConstPtr& ) >
InitCallback;
84 typedef boost::function< void ( StatusT, const std::string&, const std::string& ) >
StatusCallback;
92 const std::string &topic_ns =
"" );
116 void setInitCb(
const InitCallback& cb );
136 template<
class MsgConstPtrT>
137 void process(
const MsgConstPtrT& msg );
161 void statusCb(
StatusT status,
const std::string& server_id,
const std::string& msg );
175 void initCb(
const InitConstPtr& i )
const {
visualization_msgs::InteractiveMarkerInitConstPtr InitConstPtr
void setResetCb(ResetCallback reset_cb)
void updateCb(const UpdateConstPtr &u) const
void processInit(const InitConstPtr &msg)
INTERACTIVE_MARKERS_PUBLIC void shutdown()
Unsubscribe, clear queues & call reset callbacks.
std::string target_frame_
StatusCallback status_cb_
StatusCallback status_cb_
#define INTERACTIVE_MARKERS_PUBLIC
INTERACTIVE_MARKERS_PUBLIC void setInitCb(const InitCallback &cb)
Set callback for init messages.
boost::function< void(StatusT, const std::string &, const std::string &) > StatusCallback
boost::function< void(const InitConstPtr &) > InitCallback
boost::unordered_map< std::string, SingleClientPtr > M_SingleClient
void initCb(const InitConstPtr &i) const
INTERACTIVE_MARKERS_PUBLIC void setResetCb(const ResetCallback &cb)
Set callback for resetting one server connection.
INTERACTIVE_MARKERS_PUBLIC void subscribe(std::string topic_ns)
Subscribe to the topics topic_ns/update and topic_ns/init.
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.
INTERACTIVE_MARKERS_PUBLIC InteractiveMarkerClient(tf::Transformer &tf, const std::string &target_frame="", const std::string &topic_ns="")
StateMachine< StateT > state_
boost::mutex publisher_contexts_mutex_
INTERACTIVE_MARKERS_PUBLIC ~InteractiveMarkerClient()
Will cause a 'reset' call for all server ids.
void setInitCb(InitCallback init_cb)
void processUpdate(const UpdateConstPtr &msg)
bool enable_autocomplete_transparency_
UpdateCallback update_cb_
ros::Subscriber init_sub_
ros::Subscriber update_sub_
boost::function< void(const std::string &) > ResetCallback
visualization_msgs::InteractiveMarkerUpdateConstPtr UpdateConstPtr
void statusCb(StatusT status, const std::string &server_id, const std::string &msg)
INTERACTIVE_MARKERS_PUBLIC void setEnableAutocompleteTransparency(bool enable)
boost::shared_ptr< SingleClient > SingleClientPtr
void process(const MsgConstPtrT &msg)
INTERACTIVE_MARKERS_PUBLIC void update()
Update tf info, call callbacks.
void resetCb(const std::string &s) const
M_SingleClient publisher_contexts_
void setUpdateCb(UpdateCallback update_cb)
boost::function< void(const UpdateConstPtr &) > UpdateCallback
void setStatusCb(StatusCallback status_cb)
INTERACTIVE_MARKERS_PUBLIC void setTargetFrame(std::string target_frame)
Change the target frame and reset the connection.
void statusCb(StatusT s, const std::string &id, const std::string &m) const