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 
21 
22 namespace cras
23 {
24 
25 namespace impl
26 {
27 // forward declaration
28 struct NodeletWithSharedTfBufferPrivate;
29 }
30 
36 {
37 public:
42  virtual void setBuffer(const ::std::shared_ptr<::tf2_ros::Buffer>& buffer) = 0;
43 
52  virtual ::cras::NodeletAwareTFBuffer& getBuffer() const = 0;
53 
58  virtual bool usesSharedBuffer() const = 0;
59 
63  virtual void reset() = 0;
64 };
65 
74 template <typename NodeletType = ::nodelet::Nodelet>
75 struct NodeletWithSharedTfBuffer : public virtual NodeletType, public ::cras::NodeletWithSharedTfBufferInterface,
77 {
78 public:
81 
82  void setBuffer(const ::std::shared_ptr<::tf2_ros::Buffer>& buffer) override;
83  ::cras::NodeletAwareTFBuffer& getBuffer() const override;
84  bool usesSharedBuffer() const override;
85 
86  virtual void onInit();
87 
88  void reset() override;
89 
90 protected:
91  using NodeletType::getName;
92 
93 private:
95  ::std::unique_ptr<::cras::impl::NodeletWithSharedTfBufferPrivate> data;
96 };
97 
98 }
99 
100 #include "impl/nodelet_with_shared_tf_buffer.hpp"
cras::NodeletWithSharedTfBuffer::NodeletWithSharedTfBuffer
NodeletWithSharedTfBuffer()
cras::NodeletWithSharedTfBufferInterface::usesSharedBuffer
virtual bool usesSharedBuffer() const =0
Whether the buffer set using setBuffer() is used or a standalone buffer has been automatically create...
cras
Definition: any.hpp:15
cras::NodeletWithSharedTfBufferInterface::setBuffer
virtual void setBuffer(const ::std::shared_ptr<::tf2_ros::Buffer > &buffer)=0
Set the TF buffer to be used by the nodelet. If this method is not called, a standalone buffer is cre...
cras::NodeletWithSharedTfBuffer::reset
void reset() override
Reset the TF buffer. If a shared buffer is used, it is not reset by this call and its owner is respon...
buffer.h
cras::NodeletWithSharedTfBufferInterface::getBuffer
virtual ::cras::NodeletAwareTFBuffer & getBuffer() const =0
Get the TF buffer used by the nodelet. If none has been set by setBuffer(), a buffer is automatically...
cras::NodeletWithSharedTfBuffer::onInit
virtual void onInit()
cras::NodeletWithSharedTfBuffer::getBuffer
::cras::NodeletAwareTFBuffer & getBuffer() const override
Get the TF buffer used by the nodelet. If none has been set by setBuffer(), a buffer is automatically...
nodelet_aware_tf_buffer.h
TF buffer that can be correctly interrupted by nodelet unload.
cras::NodeletWithSharedTfBuffer::data
::std::unique_ptr<::cras::impl::NodeletWithSharedTfBufferPrivate > data
PIMPL.
Definition: nodelet_with_shared_tf_buffer.hpp:95
cras::NodeletWithSharedTfBufferInterface
Public non-template API of NodeletWithSharedTfBuffer. Dynamic_cast a nodelet to this type if you need...
Definition: nodelet_with_shared_tf_buffer.hpp:35
cras::NodeletWithSharedTfBuffer::usesSharedBuffer
bool usesSharedBuffer() const override
Whether the buffer set using setBuffer() is used or a standalone buffer has been automatically create...
transform_listener.h
macros_generated.h
cras::NodeletAwareTFBuffer
Definition: nodelet_aware_tf_buffer.h:27
cras::TimeJumpResettable
Interface for resettable nodes and nodelets. Automatic reset on time jumps.
Definition: resettable.h:78
cras::NodeletWithSharedTfBuffer::setBuffer
void setBuffer(const ::std::shared_ptr<::tf2_ros::Buffer > &buffer) override
Set the TF buffer to be used by the nodelet. If this method is not called, a standalone buffer is cre...
cras::NodeletWithSharedTfBuffer::~NodeletWithSharedTfBuffer
virtual ~NodeletWithSharedTfBuffer()
nodelet.h
cras::NodeletWithSharedTfBuffer
A nodelet mixin that allows to use a tf2_ros::Buffer provided by the nodelet manager (which should sa...
Definition: nodelet_with_shared_tf_buffer.hpp:75
resettable.h
Interface for resettable nodes and nodelets. Automatic reset on time jumps.
cras::NodeletWithSharedTfBufferInterface::reset
virtual void reset()=0
Reset the TF buffer. If a shared buffer is used, it is not reset by this call and its owner is respon...


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Tue Nov 26 2024 03:49:04