32 #ifndef INTERACTIVE_MARKER_SERVER 33 #define INTERACTIVE_MARKER_SERVER 35 #include <visualization_msgs/InteractiveMarkerUpdate.h> 36 #include <visualization_msgs/InteractiveMarkerFeedback.h> 39 #include <boost/scoped_ptr.hpp> 40 #include <boost/thread/thread.hpp> 41 #include <boost/thread/recursive_mutex.hpp> 47 #include <boost/function.hpp> 48 #include <boost/unordered_map.hpp> 74 InteractiveMarkerServer(
const std::string &topic_ns,
const std::string &server_id=
"",
bool spin_thread =
false );
85 void insert(
const visualization_msgs::InteractiveMarker &int_marker );
94 void insert(
const visualization_msgs::InteractiveMarker &int_marker,
95 FeedbackCallback feedback_cb,
96 uint8_t feedback_type=DEFAULT_FEEDBACK_CB );
105 bool setPose(
const std::string &name,
106 const geometry_msgs::Pose &pose,
107 const std_msgs::Header &header=std_msgs::Header() );
114 bool erase(
const std::string &name );
131 std::size_t
size()
const;
144 bool setCallback(
const std::string &name, FeedbackCallback feedback_cb,
145 uint8_t feedback_type=DEFAULT_FEEDBACK_CB );
157 bool get( std::string name, visualization_msgs::InteractiveMarker &int_marker )
const;
199 void publish( visualization_msgs::InteractiveMarkerUpdate &update );
205 void doSetPose( M_UpdateContext::iterator update_it,
206 const std::string &name,
207 const geometry_msgs::Pose &pose,
208 const std_msgs::Header &header );
visualization_msgs::InteractiveMarkerFeedbackConstPtr FeedbackConstPtr
boost::unordered_map< uint8_t, FeedbackCallback > feedback_cbs
ros::Subscriber feedback_sub_
void processFeedback(const FeedbackConstPtr &feedback)
boost::unordered_map< std::string, MarkerContext > M_MarkerContext
INTERACTIVE_MARKERS_PUBLIC std::size_t size() const
visualization_msgs::InteractiveMarker int_marker
#define INTERACTIVE_MARKERS_PUBLIC
boost::function< void(const FeedbackConstPtr &) > FeedbackCallback
M_MarkerContext marker_contexts_
static const uint8_t DEFAULT_FEEDBACK_CB
FeedbackCallback default_feedback_cb
INTERACTIVE_MARKERS_PUBLIC ~InteractiveMarkerServer()
Destruction of the interface will lead to all managed markers being cleared.
boost::unordered_map< std::string, UpdateContext > M_UpdateContext
ros::Timer keep_alive_timer_
boost::unordered_map< uint8_t, FeedbackCallback > feedback_cbs
INTERACTIVE_MARKERS_PUBLIC bool empty() const
ros::NodeHandle node_handle_
INTERACTIVE_MARKERS_PUBLIC InteractiveMarkerServer(const std::string &topic_ns, const std::string &server_id="", bool spin_thread=false)
visualization_msgs::InteractiveMarker int_marker
volatile bool need_to_terminate_
ros::CallbackQueue callback_queue_
FeedbackCallback default_feedback_cb
void doSetPose(M_UpdateContext::iterator update_it, const std::string &name, const geometry_msgs::Pose &pose, const std_msgs::Header &header)
boost::recursive_mutex mutex_
M_UpdateContext pending_updates_
INTERACTIVE_MARKERS_PUBLIC void insert(const visualization_msgs::InteractiveMarker &int_marker)
void publish(visualization_msgs::InteractiveMarkerUpdate &update)
INTERACTIVE_MARKERS_PUBLIC void applyChanges()
INTERACTIVE_MARKERS_PUBLIC bool setCallback(const std::string &name, FeedbackCallback feedback_cb, uint8_t feedback_type=DEFAULT_FEEDBACK_CB)
INTERACTIVE_MARKERS_PUBLIC void clear()
INTERACTIVE_MARKERS_PUBLIC bool setPose(const std::string &name, const geometry_msgs::Pose &pose, const std_msgs::Header &header=std_msgs::Header())
boost::scoped_ptr< boost::thread > spin_thread_
std::string last_client_id
ros::Publisher update_pub_
INTERACTIVE_MARKERS_PUBLIC bool erase(const std::string &name)