Skip to content

Commit

Permalink
Setup tracing after blackboard (#314)
Browse files Browse the repository at this point in the history
* Setup tracing after blackboard

Setup the blackboard before tracing so that blackboard values can be
used in settup up custom tracing

* Fix flaky test
  • Loading branch information
veerajsk authored and Prajapati-Pawan committed Aug 19, 2022
1 parent 2d9519e commit 74e1c7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions alica_engine/src/engine/RunnableObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ void RunnableObject::stop()

stopRunCalls();
doTerminate();
cleanupBlackboard();
_runnableObjectTracer.cleanupTraceContext();
cleanupBlackboard();

_started = false;
}
Expand All @@ -70,9 +70,10 @@ void RunnableObject::start(RunningPlan* rp)

_runningplanContext = rp;

setupBlackboard();
// setup the trace context after setting up the blackboard so that the blackboard can be used for setting up custom tracing
// TODO cleanup: pass trace factory in constructor. can't do now as _engine isn't available
_runnableObjectTracer.setupTraceContext(_name, _runningplanContext, _engine->getTraceFactory());
setupBlackboard();
doInit();
scheduleRunCalls();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TEST(SyncStopTimerRosTest, CbFrequencyCheck)
double period = i / 1000.0, totDuration = 1.1, sleepBuffer = 0.1 * totDuration;
int expCbCnt = totDuration / period;
expCbCnt = expCbCnt - 0.2 * expCbCnt;
double periodUpperLimit = 0.3 * period + period, periodLowerLimit = period - 0.1 * period;
double periodUpperLimit = 0.3 * period + period, periodLowerLimit = period - 0.2 * period;

ros::Time lastCbTime;
bool freqLess = false, freqMore = false;
Expand Down

0 comments on commit 74e1c7d

Please sign in to comment.