|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam< Message > &defaultDiagParams, const ::std::string &diagNamespace, ::ros::AdvertiseOptions &options) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam< Message > &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, size_t queueSize, bool latch=false) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, ::ros::NodeHandle diagNh, const ::std::string &diagNamespace, ::ros::AdvertiseOptions &options) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, ::ros::NodeHandle diagNh, const ::std::string &diagNamespace, const ::std::string &topic, size_t queueSize, bool latch=false) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, ::ros::NodeHandle diagNh, const ::std::string &topic, size_t queueSize, bool latch=false) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, ::ros::NodeHandle diagNh, ros::AdvertiseOptions &options) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, const ::cras::SimpleTopicStatusParam< Message > &defaultDiagParams, const ::std::string &diagNamespace, ::ros::AdvertiseOptions &options) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, const ::cras::SimpleTopicStatusParam< Message > &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, size_t queueSize, bool latch=false) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, const ::std::string &diagNamespace, ::ros::AdvertiseOptions &options) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, const ::std::string &diagNamespace, const ::std::string &topic, size_t queueSize, bool latch=false) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, const ::std::string &topic, size_t queueSize, bool latch=false) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (::ros::NodeHandle publisherNh, ros::AdvertiseOptions &options) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (const ::cras::SimpleTopicStatusParam< Message > &defaultDiagParams, const ::std::string &diagNamespace, ::ros::AdvertiseOptions &options) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (const ::cras::SimpleTopicStatusParam< Message > &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, size_t queueSize, bool latch=false) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (const ::std::string &diagNamespace, ::ros::AdvertiseOptions &options) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (const ::std::string &diagNamespace, const ::std::string &topic, size_t queueSize, bool latch=false) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (const ::std::string &topic, size_t queueSize, bool latch=false) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedPublisher< Message > > | advertiseDiagnosed (ros::AdvertiseOptions &options) |
| Advertise a topic and setup up an automatic topic diagnostic task for it. More...
|
|
| CRAS_NODELET_DIAG_GENERATE_OVERLOADS (CRAS_SINGLE_ARG(), CRAS_SINGLE_ARG(this->getNodeHandle(),), CRAS_SINGLE_ARG(), CRAS_SINGLE_ARG("",)) |
|
| CRAS_NODELET_DIAG_GENERATE_OVERLOADS (CRAS_SINGLE_ARG(), CRAS_SINGLE_ARG(this->getNodeHandle(),), CRAS_SINGLE_ARG(const ::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >> &defaultDiagParams, const ::std::string &diagNamespace,), CRAS_SINGLE_ARG(defaultDiagParams, diagNamespace,)) |
|
| CRAS_NODELET_DIAG_GENERATE_OVERLOADS (CRAS_SINGLE_ARG(), CRAS_SINGLE_ARG(this->getNodeHandle(),), CRAS_SINGLE_ARG(const ::std::string &diagNamespace,), CRAS_SINGLE_ARG(::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >>(), diagNamespace,)) |
|
| CRAS_NODELET_DIAG_GENERATE_OVERLOADS (CRAS_SINGLE_ARG(::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh,), CRAS_SINGLE_ARG(subscriberNh, diagNh,), CRAS_SINGLE_ARG(), CRAS_SINGLE_ARG("",)) |
|
| CRAS_NODELET_DIAG_GENERATE_OVERLOADS (CRAS_SINGLE_ARG(::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh,), CRAS_SINGLE_ARG(subscriberNh, diagNh,), CRAS_SINGLE_ARG(const ::std::string &diagNamespace,), CRAS_SINGLE_ARG(::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >>(), diagNamespace,)) |
|
| CRAS_NODELET_DIAG_GENERATE_OVERLOADS (CRAS_SINGLE_ARG(::ros::NodeHandle subscriberNh,), CRAS_SINGLE_ARG(subscriberNh, this->getDefaultDiagNh(subscriberNh, ""),), CRAS_SINGLE_ARG(), CRAS_SINGLE_ARG("",)) |
|
| CRAS_NODELET_DIAG_GENERATE_OVERLOADS (CRAS_SINGLE_ARG(::ros::NodeHandle subscriberNh,), CRAS_SINGLE_ARG(subscriberNh, this->getDefaultDiagNh(subscriberNh, diagNamespace),), CRAS_SINGLE_ARG(const ::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >> &defaultDiagParams, const ::std::string &diagNamespace,), CRAS_SINGLE_ARG(defaultDiagParams, diagNamespace,)) |
|
| CRAS_NODELET_DIAG_GENERATE_OVERLOADS (CRAS_SINGLE_ARG(::ros::NodeHandle subscriberNh,), CRAS_SINGLE_ARG(subscriberNh, this->getDefaultDiagNh(subscriberNh, diagNamespace),), CRAS_SINGLE_ARG(const ::std::string &diagNamespace,), CRAS_SINGLE_ARG(::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >>(), diagNamespace,)) |
|
template<typename T > |
::std::unique_ptr<::cras::DiagnosedPublisher< T > > | createDiagnosedPublisher (::ros::NodeHandle nh, const ::std::string &topic, size_t queueSize, const ::std::string ¶mNamespace) |
| Create a diagnosed publisher for a message type with header. More...
|
|
template<typename T > |
::std::unique_ptr<::cras::DiagnosedPublisher< T > > | createDiagnosedPublisher (::ros::NodeHandle nh, const ::std::string &topic, size_t queueSize, const ::std::string ¶mNamespace, const ::ros::Rate &defaultRate) |
| Create a diagnosed publisher for a message type with header. More...
|
|
template<typename T > |
::std::unique_ptr<::cras::DiagnosedPublisher< T > > | createDiagnosedPublisher (::ros::NodeHandle nh, const ::std::string &topic, size_t queueSize, const ::std::string ¶mNamespace, const ::ros::Rate &defaultRate, const ::ros::Rate &defaultMinRate, const ::ros::Rate &defaultMaxRate) |
| Create a diagnosed publisher for a message type without header. More...
|
|
::ros::NodeHandle | getDefaultDiagNh (const ::ros::NodeHandle &pubSubNh, const ::std::string &diagNamespace) |
| Get the default node handle for reading diagnostic task configuration. More...
|
|
::cras::BoundParamHelperPtr | getDiagParams (const ::ros::NodeHandle &nh, const ::std::string &diagNamespace, const ::std::string &topic) |
| Get the parameters configuring a diagnosed publisher or subscriber. More...
|
|
::cras::DiagnosticUpdater & | getDiagUpdater (bool forceNew=false) const |
| Get a diagnostic updater to be used with this nodelet. More...
|
|
void | startDiagTimer () const |
| Start periodic updates of the diagnostics updater. More...
|
|
void | startDiagTimer (const ::ros::NodeHandle &nh) const |
| Start periodic updates of the diagnostics updater. More...
|
|
void | stopDiagTimer () const |
| Stop the automatic updates of the diagnostic updater. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedSubscriber< Message > > | subscribeDiagnosed (::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam< Message > &defaultDiagParams, const ::std::string &diagNamespace, ::ros::SubscribeOptions &options) |
| Subscribe to the given topic, automatically updating the diagnostic task every time a message is received. More...
|
|
template<typename Message , typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>> |
::std::unique_ptr<::cras::DiagnosedSubscriber< Message > > | subscribeDiagnosed (::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam< Message > &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, uint32_t queue_size, const ::boost::function< void(const ::boost::shared_ptr< Message > &)> &cb, ::ros::TransportHints hints={}) |
| Subscribe to the given topic, automatically updating the diagnostic task every time a message is received. More...
|
|
template<typename C , typename Enable = ::std::enable_if_t<::cras::IsMessageParam<C>::value>> |
::std::unique_ptr<::cras::DiagnosedSubscriber<::cras::BaseMessage< C > > > | subscribeDiagnosed (::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam<::cras::BaseMessage< C >> &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, uint32_t queue_size, const ::boost::function< void(C)> &cb, ::ros::VoidConstPtr obj={}, ::ros::TransportHints hints={}) |
| Subscribe to the given topic, automatically updating the diagnostic task every time a message is received. More...
|
|
template<typename M , typename Enable = ::std::enable_if_t<::cras::IsMessageParam<M>::value>> |
::std::unique_ptr<::cras::DiagnosedSubscriber<::cras::BaseMessage< M > > > | subscribeDiagnosed (::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >> &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, uint32_t queue_size, void(*cb)(M), ::ros::TransportHints hints={}) |
| Subscribe to the given topic, automatically updating the diagnostic task every time a message is received. More...
|
|
template<typename M , class T , typename Enable = ::std::enable_if_t<::cras::IsMessageParam<M>::value>> |
::std::unique_ptr<::cras::DiagnosedSubscriber<::cras::BaseMessage< M > > > | subscribeDiagnosed (::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >> &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, uint32_t queue_size, void(T::*cb)(M) const, const ::boost::shared_ptr< T > &obj, ::ros::TransportHints hints={}) |
| Subscribe to the given topic, automatically updating the diagnostic task every time a message is received. More...
|
|
template<typename M , class T , typename Enable = ::std::enable_if_t<::cras::IsMessageParam<M>::value>> |
::std::unique_ptr<::cras::DiagnosedSubscriber<::cras::BaseMessage< M > > > | subscribeDiagnosed (::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >> &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, uint32_t queue_size, void(T::*cb)(M) const, T *obj, ::ros::TransportHints hints={}) |
| Subscribe to the given topic, automatically updating the diagnostic task every time a message is received. More...
|
|
template<typename M , class T , typename Enable = ::std::enable_if_t<::cras::IsMessageParam<M>::value>> |
::std::unique_ptr<::cras::DiagnosedSubscriber<::cras::BaseMessage< M > > > | subscribeDiagnosed (::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >> &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, uint32_t queue_size, void(T::*cb)(M), const ::boost::shared_ptr< T > &obj, ::ros::TransportHints hints={}) |
| Subscribe to the given topic, automatically updating the diagnostic task every time a message is received. More...
|
|
template<typename M , class T , typename Enable = ::std::enable_if_t<::cras::IsMessageParam<M>::value>> |
::std::unique_ptr<::cras::DiagnosedSubscriber<::cras::BaseMessage< M > > > | subscribeDiagnosed (::ros::NodeHandle subscriberNh, ::ros::NodeHandle diagNh, const ::cras::SimpleTopicStatusParam<::cras::BaseMessage< M >> &defaultDiagParams, const ::std::string &diagNamespace, const ::std::string &topic, uint32_t queue_size, void(T::*cb)(M), T *obj, ::ros::TransportHints hints={}) |
| Subscribe to the given topic, automatically updating the diagnostic task every time a message is received. More...
|
|
template<typename NodeletType>
struct cras::NodeletWithDiagnostics< NodeletType >
Nodelet mixin that provides helper functions for running a diagnostics updater.
- Template Parameters
-
NodeletType | Type of the base nodelet. |
Methods advertiseDiagnosed()
and subscribeDiagnosed()
offer a versatile API based on the API of NodeHandle. Additional required arguments like node handles or diagnostic task configuration are prepended to the list of usual arguments of advertise()
/subscribe()
. All of these additional arguments are optional (which is achieved by providing a lot of overrides of the functions).
This class offers an option to configure the diagnostic task from a set of ROS parameters. The following parameters are read:
rate/desired
(double, Hz, no default): If set, this value will be used as the default of min/max rates.
rate/min
(double, Hz, default 0.0 or desired): Minimum acceptable rate.
rate/max
(double, Hz, default +inf or desired): Maximum acceptable rate.
rate/tolerance
(double, default 0.1): Tolerance of the min/max rate (0.0 means that the min/max rate limits are strict).
rate/window_size
(uint, default 5): Over how many diagnostics updates should the rate be computed.
delay/min
(double, s, default -1.0): Minimum acceptable delay (only computed for messages with a header).
delay/max
(double, s, default 5.0): Maximum acceptable delay (only computed for messages with a header).
The parameter namespace from which the parameters are read is determined as follows:
- If
diagNh
is missing and diagNamespace
is empty or missing, the namespace is ~topic
.
- If
diagNh
is missing and diagNamespace
is nonempty and starts with ~, the namespace is ~diagNamespace
.
- If
diagNh
is missing and diagNamespace
is nonempty and does not start with ~, the namespace is pubNh/diagNamespace
.
- If
diagNh
is specified and diagNamespace
is empty or missing, the namespace is diagNh/topic
.
- If
diagNh
is specified and diagNamespace
nonempty, the namespace is diagNh/diagNamespace
.
Whenever the topic name is used in the topic diagnostic configuration namespace, the name of the topic is not affected by topic remappings passed to the nodelet (but its parent namespaces are affected).
Here are a few examples:
// nodelet name is "nodelet"
ros::NodeHandle nh = this->getNodeHandle();
ros::NodeHandle pnh = this->getPrivateNodeHandle();
ros::NodeHandle tnh(nh, "test");
ros::NodeHandle rnh(nh, "", {{"/topic", "/topic2"}}); // remap /topic->/topic2
this->advertiseDiagnosed(nh, "topic", 10); // param namespace is /nodelet/topic
this->advertiseDiagnosed(nh, "/topic", 10); // param namespace is /topic
this->advertiseDiagnosed(nh, "test", "topic", 10); // param namespace is /test
this->advertiseDiagnosed(nh, "~test", "topic", 10); // param namespace is /nodelet/test
this->advertiseDiagnosed(nh, pnh, "topic", 10); // param namespace is /nodelet/topic
this->advertiseDiagnosed(nh, pnh, "test", "topic", 10); // param namespace is /nodelet/test
this->advertiseDiagnosed(nh, pnh, "~test", "topic", 10); // param namespace is /nodelet/test
this->advertiseDiagnosed(pnh, "topic", 10); // param namespace is /nodelet/topic
this->advertiseDiagnosed(pnh, "/topic", 10); // param namespace is /topic
this->advertiseDiagnosed(pnh, "test", "topic", 10); // param namespace is /nodelet/test
this->advertiseDiagnosed(pnh, "~test", "topic", 10); // param namespace is /nodelet/test
this->advertiseDiagnosed(pnh, tnh, "topic", 10); // param namespace is /test/topic
this->advertiseDiagnosed(pnh, tnh, "test", "topic", 10); // param namespace is /test/test
this->advertiseDiagnosed(pnh, tnh, "~test", "topic", 10); // param namespace is /test/test
this->advertiseDiagnosed(tnh, "topic", 10); // param namespace is /test/topic
this->advertiseDiagnosed(tnh, "/topic", 10); // param namespace is /topic
this->advertiseDiagnosed(tnh, "test", "topic", 10); // param namespace is /test/test
this->advertiseDiagnosed(tnh, "~test", "topic", 10); // param namespace is /test/test
this->advertiseDiagnosed(rnh, "topic", 10); // subscribes /topic2, param namespace is /nodelet/topic
this->advertiseDiagnosed(rnh, "/topic", 10); // subscribes /topic2, param namespace is /topic
Definition at line 104 of file nodelet_with_diagnostics.hpp.