long_delay_low_short.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 "TestLongDelay.h"
00027 #include "TestShortMultipleDelay.h"
00028 
00029 
00030 
00031 using namespace std;
00032 using namespace ros;
00033 using namespace socrob::multicast;
00034 
00035 
00036 
00037 int main (int argc, char** argv)
00038 {
00039   init (argc, argv, "long_delay_low_short");
00040   
00041   ros::NodeHandle nh;
00042   
00043   int sid;
00044   if (! ros::param::getCached ("robot_number", sid)) {
00045     ROS_FATAL ("Could not get robot_number param");
00046     abort();
00047   }
00048   sid -= 1;
00049   
00050   TestLongDelay test_long (sid, "LowShort");
00051   TestShortMultipleDelay short_low_loader (sid, "DUMMY");
00052   
00053   {
00054     Manager srmm (ManagerOptions (sid, 5, "239.255.1.1")
00055                   .bandwidth_bps (57671) // 2.2*1024*1024/8/5
00056                   .ports (2000, 2001)
00057                   .tup_ms (100)
00058                   .long_marshall (boost::bind (&TestLongDelay::long_marshall, boost::ref (test_long), _1))
00059                   .long_unmarshall (boost::bind (&TestLongDelay::long_unmarshall, boost::ref (test_long), _1, _2))
00060                   .short_handler (boost::bind (&TestShortMultipleDelay::short_handler, boost::ref (short_low_loader), _1, _2, _3)));
00061                   
00062     Rate loop_rate (10);
00063     while (ok()) {
00064       short_low_loader.timer (srmm);
00065       loop_rate.sleep();
00066     }
00067   }
00068   
00069   test_long.statistics();
00070 }


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