File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -86,14 +86,22 @@ void workThreadLoader(SotLoader *aSotLoader)
86
86
}
87
87
88
88
struct timeval start, stop;
89
+ ros::NodeHandle nh (" /geometric_simu" );
90
+ bool paused;
91
+ unsigned long long dt;
89
92
while (!aSotLoader->isDynamicGraphStopped ())
90
93
{
91
- gettimeofday (&start,0 );
92
- aSotLoader->oneIteration ();
93
- gettimeofday (&stop,0 );
94
+ nh.param <bool > (" paused" , paused, false );
94
95
95
- unsigned long long dt = 1000000 * (stop.tv_sec - start.tv_sec ) + (stop.tv_usec - start.tv_usec );
96
- dataToLog.record ((double )dt * 1e-6 );
96
+ if (!paused) {
97
+ gettimeofday (&start,0 );
98
+ aSotLoader->oneIteration ();
99
+ gettimeofday (&stop,0 );
100
+
101
+ dt = 1000000 * (stop.tv_sec - start.tv_sec ) + (stop.tv_usec - start.tv_usec );
102
+ dataToLog.record ((double )dt * 1e-6 );
103
+ } else
104
+ dt = 0 ;
97
105
if (period > dt) {
98
106
usleep (period - (unsigned )dt);
99
107
}
You can’t perform that action at this time.
0 commit comments