Skip to content
Snippets Groups Projects
Commit ce41cd3a authored by ARMAR-7a User's avatar ARMAR-7a User
Browse files

Merge branch 'master' of git.h1t.iar.kit.edu:sw/armarx/robot-api

parents 8c17000e 65027c47
No related branches found
No related tags found
No related merge requests found
......@@ -24,18 +24,25 @@
#pragma once
#include <chrono>
//#include <ArmarXCore/core/time/TimeUtil.h>
#include "ControlThreadOutputBuffer.h"
namespace armarx
{
namespace rt_timing::constants
{
inline constexpr const std::int64_t seconds2MicroSeconds = 1e6;
static constexpr const std::int64_t nanoSeconds2MicroSeconds = 1000;
} // namespace rt_timing::constants
inline IceUtil::Time
rtNow()
{
using namespace rt_timing::constants;
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return IceUtil::Time::microSeconds(ts.tv_sec * 1e6 + ts.tv_nsec / 1000);
return IceUtil::Time::microSeconds(ts.tv_sec * seconds2MicroSeconds +
ts.tv_nsec / nanoSeconds2MicroSeconds);
}
} // namespace armarx
......@@ -52,7 +59,7 @@ namespace armarx
//! \ingroup VirtualTime
//! Prints duration with comment in front of it if it took longer than threshold
#define RT_TIMING_CEND_COMMENT(name, comment, thresholdMs) \
if ((armarx::rtNow() - name).toMilliSeconds() >= thresholdMs) \
if ((armarx::rtNow() - name).toMilliSecondsDouble() >= thresholdMs) \
RT_TIMING_END_COMMENT(name, comment)
//! \ingroup VirtualTime
//! Prints duration if it took longer than thresholdMs
......
......@@ -97,6 +97,12 @@ namespace armarx::aron
type::IntEnumPtr enumType = type::IntEnum::DynamicCast(type);
data::IntPtr enumData = data::Int::DynamicCast(data);
if (enumType == nullptr or enumData == nullptr)
{
ARMARX_WARNING << "Enum Type or Data is NULL";
return;
}
std::string name = enumType->getValueName(enumData->getValue());
value << name;
}
......
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