30 TestVstig::TestVstig() {}
32 TestVstig::~TestVstig() {}
34 void TestVstig::init() {}
36 void TestVstig::stop() {}
40 std::string robot_id_string =
"robot_"+boost::lexical_cast<std::string>(get_id());
43 pval.data = get_id() + count;
44 vs.puts(robot_id_string, pval);
46 std::cout<<robot_id_string<<
": "<<vs.size()<<std::endl;
60 std::string robot_id_string =
"robot_" + boost::lexical_cast<std::string>(get_id());
61 std_msgs::Int32 gval = vs.gets(robot_id_string);
62 std::cout << robot_id_string <<
": " << vs.size() <<
", " << gval.data << std::endl;
68 std::string robot_id_string =
"robot_"+boost::lexical_cast<std::string>(get_id());
71 pval.data = get_id() + count;
72 vs.put(robot_id_string, pval);
74 std::cout<<robot_id_string<<
": "<<vs.size()<<std::endl;
81 std::string robot_id_string =
"robot_" + boost::lexical_cast<std::string>(get_id());
82 std_msgs::Int32 gval = vs.get(robot_id_string);
83 std::cout << robot_id_string <<
": " << vs.size() <<
", " << gval.data << std::endl;
91 pval.data = get_id() + count;
93 std::string cur_string=
"robot_"+boost::lexical_cast<std::string>(get_id())+
"/"+boost::lexical_cast<std::string>(count);
94 std::string front_string=
"robot_"+boost::lexical_cast<std::string>(get_id())+
"/"+boost::lexical_cast<std::string>(count-1);
95 vs.put(cur_string, pval);
98 std::cout<<cur_string<<
": "<<vs.size()<<std::endl;
106 std::string cur_string =
"tuple/" + boost::lexical_cast<std::string>(i);
107 std_msgs::Int32 gval = vs.get(cur_string);
108 std::cout << cur_string <<
": " << vs.size() <<
", " << gval.data << std::endl;
112 void TestVstig::baseCallback(
const nav_msgs::Odometry& lmsg)
114 static int msg_count = 0;
115 float x=lmsg.pose.pose.position.x;
116 float y=lmsg.pose.pose.position.y;
118 float vx=lmsg.twist.twist.linear.x;
119 float vy=lmsg.twist.twist.linear.y;
126 std::cout<<
"shutdown sub"<<std::endl;
132 void TestVstig::start()
174 for(
int i = 0; i < 2048; i++){
175 std::string cur_string=
"tuple/"+boost::lexical_cast<std::string>(i);
176 std_msgs::Int32 pval;
178 vs.put(cur_string, pval);
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
int random_int(int min, int max)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)