-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_new_node1.cc
43 lines (32 loc) · 1.2 KB
/
test_new_node1.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<iostream>
#include"hansolo_node_new.h"
#include"hansolo_std_msg.h"
#include"stdMsg.pb.h"
#include"hansolo_publisher.h"
void sub_callback(const hansolo_stdMsg &msg)
{
hDebug(Color::FG_DEFAULT)<<msg.getHour()<<'-'<<msg.getMinute()<<'-'<<msg.getSecond()<<" test_node recevie data "<< msg.data<<' ';
// std::cout << "node1 recevie data " << msg.data << std::endl;
// sleep(1);
}
void sub_callback1(const hansolo_stdMsg &msg)
{
hDebug(Color::FG_DEFAULT)<<msg.getHour()<<'-'<<msg.getMinute()<<'-'<<msg.getSecond()<<" test_node11 recevie data "<< msg.data<<' ';
// std::cout << "node1 recevie data " << msg.data << std::endl;
// sleep(2);
}
int main(int argc,char **argv)
{
// absl::ParseCommandLine(argc, argv);
hansolo_node client{"hansolo node1",argc,argv};
auto sub = client.create_subscriber<hansolo_stdMsg>("/test_node", sub_callback);
// auto sub1 = client.create_subscriber<hansolo_stdMsg>("/test_node11", sub_callback1);
// HansoloPublisher<hansolo_stdMsg> pub= client.create_publisher<hansolo_stdMsg>("/test_node1");
while(1){
// hansolo_stdMsg msg;
// msg.data = 1222;
// sleep(1);
// pub.publish(msg);
}
return 0;
}