Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
interactive_markers::InteractiveMarkerClient Class Reference

#include <interactive_marker_client.h>

Inheritance diagram for interactive_markers::InteractiveMarkerClient:
Inheritance graph
[legend]

List of all members.

Classes

struct  CbCollection

Public Types

typedef boost::function< void(const
InitConstPtr &) > 
InitCallback
typedef
visualization_msgs::InteractiveMarkerInitConstPtr 
InitConstPtr
typedef boost::function< void(const
std::string &) > 
ResetCallback
typedef boost::function< void(StatusT,
const std::string &, const
std::string &) > 
StatusCallback
enum  StatusT { OK = 0, WARN = 1, ERROR = 2 }
typedef boost::function< void(const
UpdateConstPtr &) > 
UpdateCallback
typedef
visualization_msgs::InteractiveMarkerUpdateConstPtr 
UpdateConstPtr

Public Member Functions

 InteractiveMarkerClient (tf::Transformer &tf, const std::string &target_frame="", const std::string &topic_ns="")
void processInit (const InitConstPtr &msg)
void processUpdate (const UpdateConstPtr &msg)
void setEnableAutocompleteTransparency (bool enable)
void setInitCb (const InitCallback &cb)
 Set callback for init messages.
void setResetCb (const ResetCallback &cb)
 Set callback for resetting one server connection.
void setStatusCb (const StatusCallback &cb)
 Set callback for status updates.
void setTargetFrame (std::string target_frame)
 Change the target frame and reset the connection.
void setUpdateCb (const UpdateCallback &cb)
 Set callback for update messages.
void shutdown ()
 Unsubscribe, clear queues & call reset callbacks.
void subscribe (std::string topic_ns)
 Subscribe to the topics topic_ns/update and topic_ns/init.
void update ()
 Update tf info, call callbacks.
 ~InteractiveMarkerClient ()
 Will cause a 'reset' call for all server ids.

Private Types

typedef boost::unordered_map
< std::string, SingleClientPtr
M_SingleClient
typedef boost::shared_ptr
< SingleClient
SingleClientPtr
enum  StateT { IDLE, INIT, RUNNING }

Private Member Functions

template<class MsgConstPtrT >
void process (const MsgConstPtrT &msg)
void statusCb (StatusT status, const std::string &server_id, const std::string &msg)
void subscribeInit ()
void subscribeUpdate ()

Private Attributes

CbCollection callbacks_
bool enable_autocomplete_transparency_
ros::Subscriber init_sub_
int last_num_publishers_
ros::NodeHandle nh_
M_SingleClient publisher_contexts_
StateMachine< StateTstate_
StatusCallback status_cb_
std::string target_frame_
tf::Transformertf_
std::string topic_ns_
ros::Subscriber update_sub_

Detailed Description

Acts as a client to one or multiple Interactive Marker servers. Handles topic subscription, error detection and tf transformations.

The output is an init message followed by a stream of updates for each server. In case of an error (e.g. message loss, tf failure), the connection to the sending server is reset.

All timestamped messages are being transformed into the target frame, while for non-timestamped messages it is ensured that the necessary tf transformation will be available.

Definition at line 66 of file interactive_marker_client.h.


Member Typedef Documentation

Definition at line 80 of file interactive_marker_client.h.

typedef visualization_msgs::InteractiveMarkerInitConstPtr interactive_markers::InteractiveMarkerClient::InitConstPtr

Definition at line 77 of file interactive_marker_client.h.

typedef boost::unordered_map<std::string, SingleClientPtr> interactive_markers::InteractiveMarkerClient::M_SingleClient [private]

Definition at line 151 of file interactive_marker_client.h.

typedef boost::function< void ( const std::string& ) > interactive_markers::InteractiveMarkerClient::ResetCallback

Definition at line 81 of file interactive_marker_client.h.

Definition at line 150 of file interactive_marker_client.h.

typedef boost::function< void ( StatusT, const std::string&, const std::string& ) > interactive_markers::InteractiveMarkerClient::StatusCallback

Definition at line 82 of file interactive_marker_client.h.

Definition at line 79 of file interactive_marker_client.h.

typedef visualization_msgs::InteractiveMarkerUpdateConstPtr interactive_markers::InteractiveMarkerClient::UpdateConstPtr

Definition at line 76 of file interactive_marker_client.h.


Member Enumeration Documentation

Enumerator:
IDLE 
INIT 
RUNNING 

Definition at line 128 of file interactive_marker_client.h.

Enumerator:
OK 
WARN 
ERROR 

Definition at line 70 of file interactive_marker_client.h.


Constructor & Destructor Documentation

interactive_markers::InteractiveMarkerClient::InteractiveMarkerClient ( tf::Transformer tf,
const std::string &  target_frame = "",
const std::string &  topic_ns = "" 
)
Parameters:
tfThe tf transformer to use.
target_frametf frame to transform timestamped messages into.
topic_nsThe topic namespace (will subscribe to topic_ns/update, topic_ns/init)

Definition at line 45 of file interactive_marker_client.cpp.

Will cause a 'reset' call for all server ids.

Definition at line 62 of file interactive_marker_client.cpp.


Member Function Documentation

template<class MsgConstPtrT >
void interactive_markers::InteractiveMarkerClient::process ( const MsgConstPtrT &  msg) [private]

Definition at line 168 of file interactive_marker_client.cpp.

Definition at line 199 of file interactive_marker_client.cpp.

Definition at line 204 of file interactive_marker_client.cpp.

Definition at line 118 of file interactive_marker_client.h.

Set callback for init messages.

Definition at line 75 of file interactive_marker_client.cpp.

Set callback for resetting one server connection.

Definition at line 85 of file interactive_marker_client.cpp.

Set callback for status updates.

Definition at line 90 of file interactive_marker_client.cpp.

Change the target frame and reset the connection.

Definition at line 95 of file interactive_marker_client.cpp.

Set callback for update messages.

Definition at line 80 of file interactive_marker_client.cpp.

Unsubscribe, clear queues & call reset callbacks.

Definition at line 114 of file interactive_marker_client.cpp.

void interactive_markers::InteractiveMarkerClient::statusCb ( StatusT  status,
const std::string &  server_id,
const std::string &  msg 
) [private]

Definition at line 255 of file interactive_marker_client.cpp.

Subscribe to the topics topic_ns/update and topic_ns/init.

Subscribe to given topic.

Definition at line 68 of file interactive_marker_client.cpp.

Definition at line 150 of file interactive_marker_client.cpp.

Definition at line 132 of file interactive_marker_client.cpp.

Update tf info, call callbacks.

Definition at line 209 of file interactive_marker_client.cpp.


Member Data Documentation

Definition at line 197 of file interactive_marker_client.h.

Definition at line 206 of file interactive_marker_client.h.

Definition at line 140 of file interactive_marker_client.h.

Definition at line 203 of file interactive_marker_client.h.

Definition at line 126 of file interactive_marker_client.h.

Definition at line 152 of file interactive_marker_client.h.

Definition at line 135 of file interactive_marker_client.h.

Definition at line 200 of file interactive_marker_client.h.

Definition at line 155 of file interactive_marker_client.h.

Definition at line 154 of file interactive_marker_client.h.

Definition at line 137 of file interactive_marker_client.h.

Definition at line 139 of file interactive_marker_client.h.


The documentation for this class was generated from the following files:


interactive_markers
Author(s): David Gossow
autogenerated on Fri Aug 28 2015 11:11:26