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> 78 typedef visualization_msgs::InteractiveMarkerInitConstPtr
InitConstPtr;
81 typedef boost::function< void ( const InitConstPtr& ) >
InitCallback;
83 typedef boost::function< void ( StatusT, const std::string&, const std::string& ) >
StatusCallback;
90 const std::string &topic_ns =
"" );
108 void setInitCb(
const InitCallback& cb );
124 template<
class MsgConstPtrT>
125 void process(
const MsgConstPtrT& msg );
149 void statusCb(
StatusT status,
const std::string& server_id,
const std::string& msg );
163 void initCb(
const InitConstPtr& i )
const {
void resetCb(const std::string &s) const
visualization_msgs::InteractiveMarkerInitConstPtr InitConstPtr
void setResetCb(ResetCallback reset_cb)
void processInit(const InitConstPtr &msg)
void shutdown()
Unsubscribe, clear queues & call reset callbacks.
std::string target_frame_
StatusCallback status_cb_
StatusCallback status_cb_
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
void updateCb(const UpdateConstPtr &u) const
boost::unordered_map< std::string, SingleClientPtr > M_SingleClient
void setResetCb(const ResetCallback &cb)
Set callback for resetting one server connection.
void subscribe(std::string topic_ns)
Subscribe to the topics topic_ns/update and topic_ns/init.
void setUpdateCb(const UpdateCallback &cb)
Set callback for update messages.
void setStatusCb(const StatusCallback &cb)
Set callback for status updates.
InteractiveMarkerClient(tf::Transformer &tf, const std::string &target_frame="", const std::string &topic_ns="")
StateMachine< StateT > state_
boost::mutex publisher_contexts_mutex_
~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_
void setEnableAutocompleteTransparency(bool enable)
ros::Subscriber init_sub_
ros::Subscriber update_sub_
boost::function< void(const std::string &) > ResetCallback
void initCb(const InitConstPtr &i) const
visualization_msgs::InteractiveMarkerUpdateConstPtr UpdateConstPtr
void statusCb(StatusT status, const std::string &server_id, const std::string &msg)
boost::shared_ptr< SingleClient > SingleClientPtr
void process(const MsgConstPtrT &msg)
void update()
Update tf info, call callbacks.
M_SingleClient publisher_contexts_
void setUpdateCb(UpdateCallback update_cb)
boost::function< void(const UpdateConstPtr &) > UpdateCallback
void setStatusCb(StatusCallback status_cb)
void statusCb(StatusT s, const std::string &id, const std::string &m) const
void setTargetFrame(std::string target_frame)
Change the target frame and reset the connection.