Skip to content
Snippets Groups Projects
Commit 9cbf7d8d authored by Manfred Kröhnert's avatar Manfred Kröhnert
Browse files

Merge branch 'timeserver' into 'master'

Timeserver

Adds support for synchronised virtual time (see https://i61wiki.itec.uka.de/redmine/issues/348)

Makes the KinematicUnitSimulation use virtual time if available

Depends on https://gitlab.com/ArmarX/ArmarXCore/merge_requests/12

See merge request !4
parents a6ba3ad3 cb8b672b
No related branches found
No related tags found
1 merge request!4Timeserver
......@@ -30,6 +30,7 @@
#include <VirtualRobot/VirtualRobotException.h>
#include <VirtualRobot/RuntimeEnvironment.h>
#include <ArmarXCore/core/system/ArmarXDataPath.h>
#include <ArmarXCore/core/time/TimeUtil.h>
#include <algorithm>
......@@ -91,8 +92,8 @@ void KinematicUnitSimulation::onExitKinematicUnit()
void KinematicUnitSimulation::simulationFunction()
{
// the time it took until this method was called again
double timeDeltaInSeconds = (IceUtil::Time::now() - lastExecutionTime).toMilliSecondsDouble() / 1000.0;
lastExecutionTime = IceUtil::Time::now();
double timeDeltaInSeconds = (TimeUtil::GetTime() - lastExecutionTime).toMilliSecondsDouble() / 1000.0;
lastExecutionTime = TimeUtil::GetTime();
// name value maps for reporting
NameValueMap actualJointAngles;
NameValueMap actualJointVelocities;
......
......@@ -23,6 +23,7 @@
#include "ArmarXPlotter.h"
#include "ArmarXPlotterDialog.h"
#include <ArmarXCore/core/time/TimeUtil.h>
#include <ArmarXCore/observers/ObserverObjectFactories.h>
#include <ArmarXCore/observers/variant/DataFieldIdentifier.h>
#include <ArmarXCore/observers/exceptions/local/InvalidChannelException.h>
......@@ -293,7 +294,7 @@ namespace armarx
// int size = shownInterval*1000/updateInterval;
GraphDataMap::iterator it = dataMap.begin();
IceUtil::Time curTime = IceUtil::Time::now();
IceUtil::Time curTime = TimeUtil::GetTime();
for (; it != dataMap.end(); ++it)
{
......@@ -452,7 +453,7 @@ namespace armarx
}
else
{
pollingTask = new PeriodicTask<ArmarXPlotter>(this, & ArmarXPlotter::pollingExec, pollingInterval, false, "DataPollingTask");
pollingTask = new PeriodicTask<ArmarXPlotter>(this, & ArmarXPlotter::pollingExec, pollingInterval, false, "DataPollingTask", false);
pollingTask->start();
timer->start();
}
......@@ -585,7 +586,7 @@ namespace armarx
pollingTask->stop();
}
pollingTask = new PeriodicTask<ArmarXPlotter>(this, & ArmarXPlotter::pollingExec, pollingInterval, false, "DataPollingTask");
pollingTask = new PeriodicTask<ArmarXPlotter>(this, & ArmarXPlotter::pollingExec, pollingInterval, false, "DataPollingTask", false);
pollingTask->start();
}
......@@ -618,7 +619,7 @@ namespace armarx
std::map<std::string, VariantPtr> newData;
// first clear to old entries
auto now = IceUtil::Time::now();
auto now = TimeUtil::GetTime();
GraphDataMap::iterator itmap = dataMaptoAppend.begin();
for (; itmap != dataMaptoAppend.end(); ++itmap)
......@@ -664,7 +665,7 @@ namespace armarx
}
// now get new data
IceUtil::Time time = IceUtil::Time::now();
IceUtil::Time time = TimeUtil::GetTime();
map<string, DataFieldIdentifierBaseList >::iterator it = channelsSplittedByObserver.begin();
try
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment