nodelet_with_shared_tf_buffer.hpp
Go to the documentation of this file.
1 #pragma once
2 
11 #include <memory>
12 #include <string>
13 
14 #include <nodelet/nodelet.h>
16 #include <tf2_ros/buffer.h>
18 
20 
21 namespace cras
22 {
23 
24 namespace impl
25 {
26 // forward declaration
27 struct NodeletWithSharedTfBufferPrivate;
28 }
29 
35 {
36 public:
41  virtual void setBuffer(const ::std::shared_ptr<::tf2_ros::Buffer>& buffer) = 0;
42 
51  virtual ::cras::NodeletAwareTFBuffer& getBuffer() const = 0;
52 
57  virtual bool usesSharedBuffer() const = 0;
58 };
59 
68 template <typename NodeletType = ::nodelet::Nodelet>
69 struct NodeletWithSharedTfBuffer : public virtual NodeletType, public ::cras::NodeletWithSharedTfBufferInterface
70 {
71 public:
73  virtual ~NodeletWithSharedTfBuffer();
74 
75  void setBuffer(const ::std::shared_ptr<::tf2_ros::Buffer>& buffer) override;
76  ::cras::NodeletAwareTFBuffer& getBuffer() const override;
77  bool usesSharedBuffer() const override;
78 
79 protected:
80  using NodeletType::getName;
81 
82 private:
84  ::std::unique_ptr<::cras::impl::NodeletWithSharedTfBufferPrivate> data;
85 };
86 
87 }
88 
89 #include "impl/nodelet_with_shared_tf_buffer.hpp"
TF buffer that can be correctly interrupted by nodelet unload.
::std::unique_ptr<::cras::impl::NodeletWithSharedTfBufferPrivate > data
PIMPL.
A nodelet mixin that allows to use a tf2_ros::Buffer provided by the nodelet manager (which should sa...
Definition: any.hpp:15
Public non-template API of NodeletWithSharedTfBuffer. Dynamic_cast a nodelet to this type if you need...


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