Main Page
Namespaces
Classes
Files
File List
src
testnc.cpp
Go to the documentation of this file.
1
23
#include "
testnc/testnc.h
"
24
25
// Register the application
26
PLUGINLIB_EXPORT_CLASS
(
testnc::TestNC
,
micros_swarm::Application
)
27
28
namespace
testnc
{
29
30
TestNC::TestNC() {}
31
32
TestNC::~TestNC() {}
33
34
void
TestNC::init() {}
35
36
void
TestNC::stop() {}
37
38
void
TestNC::callback(
const
std_msgs::Float32& value)
39
{
40
//ROS_INFO("I received the value: %f.", value);
41
}
42
43
void
TestNC::start()
44
{
45
std::cout<<
"TestNC step into start..."
<<std::endl;
46
micros_swarm::Broadcaster<std_msgs::Float32>
bc(
"testkey"
);
47
boost::function<void(const std_msgs::Float32&)> cb=boost::bind(&TestNC::callback,
this
, _1);
48
micros_swarm::Listener<std_msgs::Float32>
ls(
"testkey"
, cb);
49
//ls.ignore();
50
51
for
(
int
i = 0; i < 10; i++) {
52
std_msgs::Float32 val;
53
val.data = 3.141;
54
bc.
broadcast
(val);
55
ros::Duration
(1).
sleep
();
56
}
57
}
58
};
59
micros_swarm::Broadcaster
micros_swarm::Listener
ros::Duration::sleep
bool sleep() const
testnc::TestNC
Definition:
testnc.h:35
testnc
Definition:
testnc.h:33
testnc.h
micros_swarm::Application
ros::Duration
micros_swarm::Broadcaster::broadcast
void broadcast(const Type &value)
PLUGINLIB_EXPORT_CLASS
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
testnc
Author(s):
autogenerated on Mon Jun 10 2019 14:02:33