Skip to content

Commit

Permalink
dflnl
Browse files Browse the repository at this point in the history
  • Loading branch information
I Heart Robotics committed Mar 19, 2012
1 parent 3fe79c0 commit eb37b8b
Showing 1 changed file with 6 additions and 1 deletion.
@@ -1,6 +1,7 @@
#ifndef RANDOM_TESTBENCH_RANDOM_TESTBENCH_PLUGIN_H_ #ifndef RANDOM_TESTBENCH_RANDOM_TESTBENCH_PLUGIN_H_
#define RANDOM_TESTBENCH_RANDOM_TESTBENCH_PLUGIN_H_ #define RANDOM_TESTBENCH_RANDOM_TESTBENCH_PLUGIN_H_
#include <testbench/test_base.h> #include <testbench/test_base.h>
#include "ros/ros.h"
#include <cmath> #include <cmath>
#include <stdlib.h> #include <stdlib.h>


Expand All @@ -13,14 +14,18 @@ namespace test_plugins


void initialize() void initialize()
{ {
srand((unsigned)time(0)); random_seed += (unsigned int)time(0);
srand(random_seed);
} }


double run() double run()
{ {
return (double)rand()/(double)RAND_MAX; return (double)rand()/(double)RAND_MAX;
} }


private:
unsigned int random_seed;

}; };
}; };
#endif #endif

0 comments on commit eb37b8b

Please sign in to comment.