mirror of
https://github.com/nasa/trick.git
synced 2024-12-26 08:11:07 +00:00
22 lines
387 B
C++
22 lines
387 B
C++
|
|
||
|
#include "std_msgs/String.h"
|
||
|
#include "ros_subscribe.hh"
|
||
|
#include "Num.h"
|
||
|
|
||
|
void numchatterCallback(const trick_msgs::Num::ConstPtr& msg) {
|
||
|
std::cout << *msg << std::endl ;
|
||
|
}
|
||
|
|
||
|
RosSubscribe::RosSubscribe() {}
|
||
|
|
||
|
int RosSubscribe::init() {
|
||
|
sub = n.subscribe("num_chatter", 1000, numchatterCallback) ;
|
||
|
return 0 ;
|
||
|
}
|
||
|
|
||
|
int RosSubscribe::process() {
|
||
|
ros::spin() ;
|
||
|
return 0 ;
|
||
|
}
|
||
|
|