Go to the documentation of this file.
29 #ifndef SWRI_ROSCPP_SUBSCRIBER_H_
30 #define SWRI_ROSCPP_SUBSCRIBER_H_
75 template<
class M ,
class T >
77 const std::string &topic,
86 const std::string &topic,
98 const std::string &topic,
156 const std::string ¶meter_name,
157 const double default_value);
204 const std::string &
name,
213 impl_ = boost::make_shared<SubscriberImpl>();
216 template<
class M ,
class T >
219 const std::string &topic,
227 nh, topic, queue_size, fp, obj, transport_hints));
233 const std::string &topic,
240 nh, topic, queue_size, callback, transport_hints));
246 const std::string &topic,
252 nh, topic, dest, transport_hints));
271 if (
impl_->timeoutEnabled() && !other.
impl_->timeoutEnabled()) {
272 new_timeout =
impl_->timeout();
276 impl_->setTimeout(new_timeout);
284 return impl_->unmappedTopic();
290 return impl_->mappedTopic();
296 return impl_->numPublishers();
302 impl_->resetStatistics();
308 return impl_->messageCount();
317 return impl_->age(now);
336 return impl_->meanLatency();
342 return impl_->minLatency();
348 return impl_->maxLatency();
372 return impl_->meanPeriod();
378 return impl_->meanFrequencyHz();
384 return impl_->minPeriod();
390 return impl_->maxPeriod();
414 impl_->setTimeout(time_out);
426 const std::string ¶meter_name,
427 const double default_value)
437 return impl_->blockTimeouts(block);
443 return impl_->timeoutsBlocked();
449 return impl_->timeout();
455 return impl_->timeoutEnabled();
461 return impl_->timeout().toNSec() / 1.0e6;
467 return impl_->inTimeout();
473 return impl_->timeoutCount();
478 const std::string &
name,
482 typedef diagnostic_msgs::DiagnosticStatus
DS;
505 status.
addf(
name +
"topic name",
"%s -> %s",
517 status.
addf(
name +
" timeouts count",
526 "min: N/A us, mean: N/A us, max: N/A us");
529 "min: %.2f us, mean: %.2f us, max: %.2f us",
540 "min period: N/A ms, mean frequency: N/A hz, max period: N/A ms");
544 "min period: %.2f ms, mean frequency: %.2f hz, max period: %.2f ms",
552 #endif // SWRI_ROSCPP_SUBSCRIBER_H_
double maxPeriodMilliseconds() const
double meanPeriodMilliseconds() const
Subscriber & operator=(const Subscriber &other)
void add(const std::string &key, const bool &b)
double meanFrequencyHz() const
ros::Duration minPeriod() const
ros::Duration age(const ros::Time &now=ros::TIME_MIN) const
const std::string & mappedTopic() const
void mergeSummaryf(unsigned char lvl, const char *format,...)
ros::Duration maxPeriod() const
ros::Duration maxLatency() const
ros::Duration meanLatency() const
diagnostic_msgs::DiagnosticStatus DS
void appendDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &status, const std::string &name, const int flags)
double timeoutMilliseconds() const
const std::string & unmappedTopic() const
double maxLatencyMicroseconds() const
const Time TIME_MIN(0, 1)
double ageSeconds(const ros::Time &now=ros::TIME_MIN) const
ros::Duration timeout() const
void timeoutParam(const ros::NodeHandle &nh, const std::string ¶meter_name, const double default_value)
int numPublishers() const
bool timeoutsBlocked() const
ros::Duration meanPeriod() const
void param(swri::NodeHandle &nh, const std::string name, std::string &value, const std::string def, const std::string description)
double meanLatencyMicroseconds() const
void setTimeout(const ros::Duration &time_out)
void addf(const std::string &key, const char *format,...)
ros::Duration minLatency() const
boost::shared_ptr< SubscriberImpl > impl_
double minPeriodMilliseconds() const
double ageMilliseconds(const ros::Time &now=ros::TIME_MIN) const
bool timeoutEnabled() const
double minLatencyMicroseconds() const
bool blockTimeouts(bool block)
swri_roscpp
Author(s): P. J. Reed
autogenerated on Fri Aug 2 2024 08:39:15