Permalink
Browse files

dflnl

  • Loading branch information...
1 parent 3fe79c0 commit eb37b8bc8e3d82d0aa81ea16ca72658c51f0c532 I Heart Robotics committed Mar 19, 2012
@@ -1,6 +1,7 @@
#ifndef RANDOM_TESTBENCH_RANDOM_TESTBENCH_PLUGIN_H_
#define RANDOM_TESTBENCH_RANDOM_TESTBENCH_PLUGIN_H_
#include <testbench/test_base.h>
+#include "ros/ros.h"
#include <cmath>
#include <stdlib.h>
@@ -13,14 +14,18 @@ namespace test_plugins
void initialize()
{
- srand((unsigned)time(0));
+ random_seed += (unsigned int)time(0);
+ srand(random_seed);
}
double run()
{
return (double)rand()/(double)RAND_MAX;
}
+ private:
+ unsigned int random_seed;
+
};
};
#endif

0 comments on commit eb37b8b

Please sign in to comment.