90 if (connection_header)
92 ros::M_string::const_iterator it = connection_header->find(
"latching");
93 if((it != connection_header->end()) && (it->second ==
"1"))
95 ROS_DEBUG(
"input topic is latched; latching output topic to match");
122 ROS_ERROR(
"Failed to communicate with rosmaster");
126 int subscriber_num = 0;
128 for (
int i = 0; i < sub_info.
size(); ++i)
130 string topic_name = sub_info[i][0];
133 for (
int j = 0; j < subscribers.
size(); ++j)
143 else if (!g_sub && subscriber_num > 0)
subscribe();
146 int main(
int argc,
char **argv)
150 printf(
"\nusage: relay IN_TOPIC [OUT_TOPIC]\n\n");
153 std::string topic_name;
156 ros::init(argc, argv, topic_name +
string(
"_relay"),
167 bool unreliable =
false;
168 pnh.
getParam(
"unreliable", unreliable);
179 pnh.
param<
double>(
"monitor_rate", monitor_rate, 1.0);
const boost::shared_ptr< ConstMessage > & getConstMessage() const
void in_cb(const ros::MessageEvent< ShapeShifter > &msg_event)
TransportHints & reliable()
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL const std::string & getName()
void timer_cb(const ros::TimerEvent &)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
void publish(const boost::shared_ptr< M > &message) const
TransportHints & unreliable()
bool getParam(const std::string &key, std::string &s) const
ROSCPP_DECL bool execute(const std::string &method, const XmlRpc::XmlRpcValue &request, XmlRpc::XmlRpcValue &response, XmlRpc::XmlRpcValue &payload, bool wait_for_master)
int main(int argc, char **argv)
void conn_cb(const ros::SingleSubscriberPublisher &)
const boost::shared_ptr< M_string > & getConnectionHeaderPtr() const
uint32_t getNumSubscribers() const