Classes | Namespaces | Macros
nodelet_with_diagnostics.hpp File Reference

Helpers for setting up diagnostics for nodelets. More...

#include <memory>
#include <string>
#include <type_traits>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <diagnostic_updater/diagnostic_updater.h>
#include <ros/advertise_options.h>
#include <ros/message_traits.h>
#include <ros/node_handle.h>
#include <ros/rate.h>
#include <ros/subscribe_options.h>
#include <ros/transport_hints.h>
#include <cras_cpp_common/diag_utils.hpp>
#include <cras_cpp_common/diag_utils/diagnosed_pub_sub.hpp>
#include <cras_cpp_common/diag_utils/topic_status_param.hpp>
#include <cras_cpp_common/diag_utils/updater.h>
#include <cras_cpp_common/message_utils.hpp>
#include "impl/nodelet_with_diagnostics.hpp"
Include dependency graph for nodelet_with_diagnostics.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cras::NodeletWithDiagnostics< NodeletType >
 Nodelet mixin that provides helper functions for running a diagnostics updater. More...
 

Namespaces

 cras
 
 cras::impl
 

Macros

#define CRAS_NODELET_DIAG_GENERATE_OVERLOAD_M(NH, NH2, PARAM, PARAM2, CB, CB2)
 
#define CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MESSAGE(NH, NH2, PARAM, PARAM2, CB)
 
#define CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MT(NH, NH2, PARAM, PARAM2, CB)
 
#define CRAS_NODELET_DIAG_GENERATE_OVERLOAD_OPTIONS(NH, NH2, PARAM, PARAM2)
 
#define CRAS_NODELET_DIAG_GENERATE_OVERLOADS(NH, NH2, PARAM, PARAM2)
 
#define CRAS_SINGLE_ARG(...)   __VA_ARGS__
 

Detailed Description

Helpers for setting up diagnostics for nodelets.

Author
Martin Pecka SPDX-License-Identifier: BSD-3-Clause SPDX-FileCopyrightText: Czech Technical University in Prague

Definition in file nodelet_with_diagnostics.hpp.

Macro Definition Documentation

◆ CRAS_NODELET_DIAG_GENERATE_OVERLOAD_M

#define CRAS_NODELET_DIAG_GENERATE_OVERLOAD_M (   NH,
  NH2,
  PARAM,
  PARAM2,
  CB,
  CB2 
)
Value:
template <typename M, typename = ::std::enable_if_t<::cras::IsMessageParam<M>::value>> \
::std::unique_ptr<::cras::DiagnosedSubscriber<::cras::BaseMessage<M>>> \
subscribeDiagnosed(NH PARAM const ::std::string& topic, uint32_t queue_size, CB, ::ros::TransportHints hints = {}) \
{ \
return ::std::move(this->template subscribeDiagnosed<M>(NH2 PARAM2 topic, queue_size, CB2, hints));\
}

Definition at line 643 of file nodelet_with_diagnostics.hpp.

◆ CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MESSAGE

#define CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MESSAGE (   NH,
  NH2,
  PARAM,
  PARAM2,
  CB 
)
Value:
template <typename M, typename = ::std::enable_if_t<::ros::message_traits::IsMessage<M>::value>> \
::std::unique_ptr<::cras::DiagnosedSubscriber<M>> \
subscribeDiagnosed(NH PARAM const ::std::string& topic, uint32_t queue_size, CB, ::ros::TransportHints hints = {}) \
{ \
return ::std::move(this->template subscribeDiagnosed<M>(NH2 PARAM2 topic, queue_size, cb, hints));\
}

Definition at line 651 of file nodelet_with_diagnostics.hpp.

◆ CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MT

#define CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MT (   NH,
  NH2,
  PARAM,
  PARAM2,
  CB 
)
Value:
template <typename M, class T, typename = ::std::enable_if_t<::cras::IsMessageParam<M>::value>> \
::std::unique_ptr<::cras::DiagnosedSubscriber<::cras::BaseMessage<M>>> \
subscribeDiagnosed(NH PARAM const ::std::string& topic, uint32_t queue_size, CB, ::ros::TransportHints hints = {}) \
{ \
return ::std::move(this->template subscribeDiagnosed<M, T>(NH2 PARAM2 topic, queue_size, cb, obj, hints)); \
}

Definition at line 659 of file nodelet_with_diagnostics.hpp.

◆ CRAS_NODELET_DIAG_GENERATE_OVERLOAD_OPTIONS

#define CRAS_NODELET_DIAG_GENERATE_OVERLOAD_OPTIONS (   NH,
  NH2,
  PARAM,
  PARAM2 
)
Value:
template<typename M, typename = ::std::enable_if_t<::ros::message_traits::IsMessage<M>::value>> \
::std::unique_ptr<::cras::DiagnosedSubscriber<M>> \
subscribeDiagnosed(NH PARAM ::ros::SubscribeOptions& options) \
{ \
const auto topic = options.topic; \
return ::std::move(this->template subscribeDiagnosed<M>(NH2 PARAM2 options));\
}
options

Definition at line 667 of file nodelet_with_diagnostics.hpp.

◆ CRAS_NODELET_DIAG_GENERATE_OVERLOADS

#define CRAS_NODELET_DIAG_GENERATE_OVERLOADS (   NH,
  NH2,
  PARAM,
  PARAM2 
)
Value:
CRAS_SINGLE_ARG(PARAM), CRAS_SINGLE_ARG(PARAM2), CRAS_SINGLE_ARG(void(*cb)(M)), CRAS_SINGLE_ARG(cb)) \
CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MESSAGE(CRAS_SINGLE_ARG(NH), CRAS_SINGLE_ARG(NH2), \
CRAS_SINGLE_ARG(PARAM), CRAS_SINGLE_ARG(PARAM2), \
CRAS_SINGLE_ARG(const ::boost::function<void(const ::boost::shared_ptr<M>&)>& cb)) \
CRAS_NODELET_DIAG_GENERATE_OVERLOAD_M(CRAS_SINGLE_ARG(NH), CRAS_SINGLE_ARG(NH2), \
CRAS_SINGLE_ARG(PARAM), CRAS_SINGLE_ARG(PARAM2), \
CRAS_SINGLE_ARG(const ::boost::function<void(M)>& cb, ::ros::VoidConstPtr obj = {}), \
CRAS_SINGLE_ARG(cb, obj)) \
CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MT(CRAS_SINGLE_ARG(NH), CRAS_SINGLE_ARG(NH2), \
CRAS_SINGLE_ARG(PARAM), CRAS_SINGLE_ARG(PARAM2), CRAS_SINGLE_ARG(void(T::*cb)(M), T* obj)) \
CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MT(CRAS_SINGLE_ARG(NH), CRAS_SINGLE_ARG(NH2), \
CRAS_SINGLE_ARG(PARAM), CRAS_SINGLE_ARG(PARAM2), CRAS_SINGLE_ARG(void(T::*cb)(M) const, T* obj)) \
CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MT(CRAS_SINGLE_ARG(NH), CRAS_SINGLE_ARG(NH2), \
CRAS_SINGLE_ARG(PARAM), CRAS_SINGLE_ARG(PARAM2), \
CRAS_SINGLE_ARG(void(T::*cb)(M), const ::boost::shared_ptr<T>& obj)) \
CRAS_NODELET_DIAG_GENERATE_OVERLOAD_MT(CRAS_SINGLE_ARG(NH), CRAS_SINGLE_ARG(NH2), \
CRAS_SINGLE_ARG(PARAM), CRAS_SINGLE_ARG(PARAM2), \
CRAS_SINGLE_ARG(void(T::*cb)(M) const, const ::boost::shared_ptr<T>& obj)) \
CRAS_NODELET_DIAG_GENERATE_OVERLOAD_OPTIONS(CRAS_SINGLE_ARG(NH), CRAS_SINGLE_ARG(NH2), \
#define CRAS_NODELET_DIAG_GENERATE_OVERLOAD_M(NH, NH2, PARAM, PARAM2, CB, CB2)
#define CRAS_SINGLE_ARG(...)

Definition at line 678 of file nodelet_with_diagnostics.hpp.

◆ CRAS_SINGLE_ARG

#define CRAS_SINGLE_ARG (   ...)    __VA_ARGS__

Definition at line 676 of file nodelet_with_diagnostics.hpp.



cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Jun 17 2023 02:32:53