Main Page
+
Namespaces
Namespace List
+
Namespace Members
All
Functions
Variables
+
Classes
Class List
Class Hierarchy
+
Class Members
+
All
_
b
e
f
g
i
l
m
n
o
p
r
s
t
u
Functions
+
Variables
_
b
f
i
l
m
n
p
r
s
t
Typedefs
+
Files
File List
+
File Members
All
Functions
Macros
test
tf2_server_early_initial_params_nodelet.cpp
Go to the documentation of this file.
1
#include <
ros/ros.h
>
2
#include <
nodelet/nodelet.h
>
3
#include <tf2_msgs/TFMessage.h>
4
#include <
pluginlib/class_list_macros.h
>
5
6
namespace
tf2_server
7
{
8
16
class
Tf2ServerEarlyInitialParamsNodelet
:
public
nodelet::Nodelet
17
{
18
protected
:
19
void
onInit
()
override
20
{
21
this->
sub
= this->
getNodeHandle
().
subscribe
(
"/tf"
, 10, &
Tf2ServerEarlyInitialParamsNodelet::onMessage
,
this
);
22
}
23
24
void
onMessage
(
const
tf2_msgs::TFMessageConstPtr& msg)
25
{
26
if
(!this->
pub
)
27
{
28
this->
pub
= this->
getNodeHandle
().
advertise
<tf2_msgs::TFMessage>(
"/test"
, 10);
29
ros::WallDuration
(0.01).
sleep
();
30
}
31
this->
pub
.
publish
(msg);
32
}
33
34
private
:
35
ros::Subscriber
sub
;
36
ros::Publisher
pub
;
37
};
38
39
}
40
41
PLUGINLIB_EXPORT_CLASS
(
tf2_server::Tf2ServerEarlyInitialParamsNodelet
,
nodelet::Nodelet
)
tf2_server::Tf2ServerEarlyInitialParamsNodelet::pub
ros::Publisher pub
Definition:
tf2_server_early_initial_params_nodelet.cpp:36
ros::NodeHandle::subscribe
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
nodelet::Nodelet::getNodeHandle
ros::NodeHandle & getNodeHandle() const
ros::WallDuration
tf2_server::Tf2ServerEarlyInitialParamsNodelet
Definition:
tf2_server_early_initial_params_nodelet.cpp:16
ros::Publisher::publish
void publish(const boost::shared_ptr< M > &message) const
nodelet.h
nodelet::Nodelet
class_list_macros.h
ros::Subscriber
tf2_server::Tf2ServerEarlyInitialParamsNodelet::sub
ros::Subscriber sub
Definition:
tf2_server_early_initial_params_nodelet.cpp:35
ros::NodeHandle::advertise
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::WallDuration::sleep
bool sleep() const
ros.h
tf2_server
Definition:
tf2_server.h:14
tf2_server::Tf2ServerEarlyInitialParamsNodelet::onInit
void onInit() override
Definition:
tf2_server_early_initial_params_nodelet.cpp:19
tf2_server::Tf2ServerEarlyInitialParamsNodelet::onMessage
void onMessage(const tf2_msgs::TFMessageConstPtr &msg)
Definition:
tf2_server_early_initial_params_nodelet.cpp:24
ros::Publisher
PLUGINLIB_EXPORT_CLASS
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
tf2_server
Author(s): Martin Pecka
autogenerated on Sun Jun 12 2022 02:10:45