diff --git a/source/RobotAPI/components/RobotState/RobotStateComponent.cpp b/source/RobotAPI/components/RobotState/RobotStateComponent.cpp index a17005e6d573ff98accd7b40e9c45376ed8e85c4..d646b7ae3a9d5a6224b25470d10bba6ecff0fadc 100644 --- a/source/RobotAPI/components/RobotState/RobotStateComponent.cpp +++ b/source/RobotAPI/components/RobotState/RobotStateComponent.cpp @@ -37,6 +37,8 @@ #include <ArmarXCore/core/rapidxml/wrapper/RapidXmlReader.h> #include <ArmarXCore/core/system/ArmarXDataPath.h> #include <ArmarXCore/core/time/TimeUtil.h> +#include <RobotAPI/components/units/RobotUnit/util/RtTiming.h> +#include <RobotAPI/components/units/RobotUnit/util/NonRtTiming.h> using namespace Eigen; @@ -296,10 +298,10 @@ namespace armarx { if (timestamp <= 0) { - timestamp = IceUtil::Time::now().toMicroSeconds(); + timestamp = armarx::rtNow().toMicroSeconds(); } - IceUtil::Time time = IceUtil::Time::microSeconds(timestamp); + IceUtil::Time time = mapRtTimestampToNonRtTimestamp(IceUtil::Time::microSeconds(timestamp)); ARMARX_DEBUG << deactivateSpam(1) << "Got new jointangles: " << jointAngles << " from timestamp " << time.toDateTime()