GAMS  1.4.0
RosBridge.h
Go to the documentation of this file.
1 
2 #ifndef _TRANSPORT_ROSBRIDGE_H_
3 #define _TRANSPORT_ROSBRIDGE_H_
4 
5 #include "madara/transport/Transport.h"
6 #include "madara/threads/Threader.h"
7 #include "RosBridgeReadThread.h"
9 
10 namespace gams
11 {
12  namespace transports
13  {
18  {
19  public:
29  RosBridge(const std::string & id,
30  madara::transport::TransportSettings & new_settings,
31  madara::knowledge::KnowledgeBase & context,
32  std::vector<std::string> topics,
33  std::map<std::string, std::string> topic_map,
34  std::map<std::string, std::string> pub_topic_types);
35 
39  virtual ~RosBridge();
40 
48  long send_data(const madara::knowledge::KnowledgeMap & modifieds);
49 
50  unsigned int in_message_count();
51  unsigned int out_message_count();
52 
53  protected:
55  madara::threads::Threader read_threads_;
57 
58  // Enabled topics
59  std::vector<std::string> topics_;
60  // Topic map
61  std::map<std::string, std::string> topic_map_;
62 
63  std::map<std::string, std::string> pub_topic_types_;
65 
66  std::pair<std::string, std::string> get_update_container_pair_(
67  const char * container_name);
68 
69  unsigned int message_count_;
70  };
71  }
72 }
73 
74 #endif // _TRANSPORT_ROSBRIDGE_H_
A custom read thread generated by gpc.pl.
Custom network transport generated by gpc.pl.
Definition: RosBridge.h:18
gams::utility::ros::GamsParser * parser_
Definition: RosBridge.h:64
virtual ~RosBridge()
Destructor.
madara::threads::Threader read_threads_
threads for monitoring knowledge updates
Definition: RosBridge.h:55
RosBridge(const std::string &id, madara::transport::TransportSettings &new_settings, madara::knowledge::KnowledgeBase &context, std::vector< std::string > topics, std::map< std::string, std::string > topic_map, std::map< std::string, std::string > pub_topic_types)
Constructor.
std::pair< std::string, std::string > get_update_container_pair_(const char *container_name)
long send_data(const madara::knowledge::KnowledgeMap &modifieds)
Sends a list of updates to the domain.
RosBridgeReadThread * read_thread_
Definition: RosBridge.h:56
unsigned int in_message_count()
unsigned int message_count_
Definition: RosBridge.h:69
std::vector< std::string > topics_
Definition: RosBridge.h:59
unsigned int out_message_count()
std::map< std::string, std::string > topic_map_
Definition: RosBridge.h:61
std::map< std::string, std::string > pub_topic_types_
Definition: RosBridge.h:63
BaseAlgorithm Base
Contains all GAMS-related tools, classes and code.