Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <iostream>
00021
00022 #include <ros/console.h>
00023
00024 #include <socrob/multicast.h>
00025
00026 #include "TestLongDelay.h"
00027 #include "ShortHeavyLoader.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_heavy_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, "HeavyShort");
00051 ShortHeavyLoader short_heavy_loader (sid);
00052
00053 {
00054 Manager srmm (ManagerOptions (sid, 5, "239.255.1.1")
00055 .bandwidth_bps (57671)
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 (&ShortHeavyLoader::short_handler, boost::ref (short_heavy_loader), _1, _2, _3)));
00061
00062 Rate loop_rate (10);
00063 while (ok()) {
00064 short_heavy_loader.timer (srmm);
00065 loop_rate.sleep();
00066 }
00067 }
00068
00069 test_long.statistics();
00070 short_heavy_loader.statistics();
00071 }