short_multiple_delay.cpp
Go to the documentation of this file.
00001 /*
00002  * Copyright 2012, 2013 Instituto de Sistemas e Robotica, Instituto Superior Tecnico
00003  *
00004  * This file is part of SocRob Multicast.
00005  *
00006  * SocRob Multicast is free software: you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation, either version 3 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * SocRob Multicast is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with SocRob Multicast.  If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 #include <iostream>
00021 
00022 #include <ros/console.h>
00023 
00024 #include <socrob/multicast.h>
00025 
00026 #include "TestShortMultipleDelay.h"
00027 
00028 
00029 
00030 using namespace std;
00031 using namespace ros;
00032 using namespace socrob::multicast;
00033 
00034 
00035 
00036 int main (int argc, char** argv)
00037 {
00038   init (argc, argv, "short_multiple_delay");
00039   
00040   ros::NodeHandle nh;
00041   
00042   int sid;
00043   if (! ros::param::getCached ("robot_number", sid)) {
00044     ROS_FATAL ("Could not get robot_number param");
00045     abort();
00046   }
00047   sid -= 1;
00048   
00049   TestShortMultipleDelay test_short (sid, "Normal");
00050   
00051   {
00052     Manager srmm (ManagerOptions (sid, 5, "239.255.1.1")
00053                   .bandwidth_bps (57671) // 2.2*1024*1024/8/5
00054                   .ports (2000, 2001)
00055                   .tup_ms (100)
00056                   .short_handler (boost::bind (&TestShortMultipleDelay::short_handler, boost::ref (test_short), _1, _2, _3)));
00057                   
00058     ros::Rate loop_rate (10);
00059     while (ros::ok()) {
00060       test_short.timer (srmm);
00061       loop_rate.sleep();
00062     }
00063   }
00064   
00065   test_short.statistics();
00066 }


socrob_multicast
Author(s): Joao Reis/jreis@isr.ist.utl.pt
autogenerated on Mon Jan 6 2014 11:47:49