Skip to content
Snippets Groups Projects
Commit c24d100f authored by Fabian Reister's avatar Fabian Reister
Browse files

using armem::Time instead of int64

parent 59327922
No related branches found
No related tags found
1 merge request!137Armem/dev
......@@ -34,4 +34,4 @@ namespace armarx::armem
*/
Time timeFromStringMicroSeconds(const std::string& microSeconds);
}
} // namespace armarx::armem
......@@ -97,9 +97,7 @@ namespace armarx::armem
.coreSegments().withName(properties.mappingMemoryName)
.providerSegments().withName(query.agent)
.entities().all()
.snapshots().timeRange(
IceUtil::Time::microSeconds(query.timeRange.min),
IceUtil::Time::microSeconds(query.timeRange.max));
.snapshots().timeRange(query.timeRange.min, query.timeRange.max);
// clang-format on
}
else
......@@ -109,9 +107,7 @@ namespace armarx::armem
.coreSegments().withName(properties.mappingMemoryName)
.providerSegments().withName(query.agent)
.entities().withNames(query.sensorList)
.snapshots().timeRange(
IceUtil::Time::microSeconds(query.timeRange.min),
IceUtil::Time::microSeconds(query.timeRange.max));
.snapshots().timeRange(query.timeRange.min,query.timeRange.max);
// clang-format on
}
......
......@@ -45,8 +45,8 @@ namespace armarx::armem
struct TimeRange
{
std::int64_t min;
std::int64_t max;
Time min;
Time max;
};
/**
......
......@@ -63,7 +63,7 @@ namespace armarx::armem
return false;
}
const auto iceTimestamp = IceUtil::Time::microSeconds(timestamp);
const auto iceTimestamp = Time::microSeconds(timestamp);
const auto providerId = armem::MemoryID(result.segmentID);
const auto entityID =
......@@ -75,7 +75,7 @@ namespace armarx::armem
arondto::LaserScanStamped aronSensorData;
// currently only sets the header
toAron(laserScan, timestamp, frame, agentName, aronSensorData);
toAron(laserScan, iceTimestamp, frame, agentName, aronSensorData);
auto dict = aronSensorData.toAron();
dict->addElement("scan", toAron(laserScan));
......
#include "aron_conversions.h"
#include <algorithm>
#include <cstdint>
#include <iterator>
#include <RobotAPI/interface/units/LaserScannerUnit.h>
......@@ -16,11 +17,17 @@ namespace armarx
/************ fromAron ************/
armem::Time timeFromAron(const int64_t timestamp)
{
return armem::Time::microSeconds(timestamp);
}
SensorHeader fromAron(const arondto::SensorHeader& aronSensorHeader)
{
return {.agent = aronSensorHeader.agent,
.frame = aronSensorHeader.frame,
.timestamp = aronSensorHeader.timestamp};
.timestamp = timeFromAron(aronSensorHeader.timestamp)};
}
void fromAron(const arondto::LaserScanStamped& aronLaserScan,
......@@ -38,7 +45,7 @@ namespace armarx
// laserScan = fromAron(aronLaserScan.data);
timestamp = header.timestamp;
timestamp = header.timestamp.toMicroSeconds();
frame = header.frame;
agentName = header.agent;
}
......@@ -52,13 +59,18 @@ namespace armarx
// aronLaserScan.scan = toAron(laserScan);
// }
int64_t toAron(const armem::Time& timestamp)
{
return timestamp.toMicroSeconds();
}
arondto::SensorHeader toAron(const SensorHeader& sensorHeader)
{
arondto::SensorHeader aronSensorHeader;
aronSensorHeader.agent = sensorHeader.agent;
aronSensorHeader.frame = sensorHeader.frame;
aronSensorHeader.timestamp = sensorHeader.timestamp;
aronSensorHeader.timestamp = toAron(sensorHeader.timestamp);
return aronSensorHeader;
}
......@@ -71,7 +83,7 @@ namespace armarx
}
void toAron(const LaserScan& laserScan,
const std::int64_t& timestamp,
const armem::Time& timestamp,
const std::string& frame,
const std::string& agentName,
arondto::LaserScanStamped& aronLaserScanStamped)
......
......@@ -25,6 +25,7 @@
#include <RobotAPI/interface/units/LaserScannerUnit.h>
#include <RobotAPI/libraries/aron/converter/common/VectorConverter.h>
#include <RobotAPI/libraries/aron/core/navigator/data/complex/NDArray.h>
#include <RobotAPI/libraries/armem/core/Time.h>
namespace armarx
{
......@@ -55,7 +56,7 @@ namespace armarx
void toAron(
const LaserScan& laserScan,
const std::int64_t& timestamp,
const armem::Time& timestamp,
const std::string& frame,
const std::string& agentName,
arondto::LaserScanStamped& aronLaserScan);
......
......@@ -21,6 +21,7 @@
#pragma once
#include <RobotAPI/libraries/armem/core/Time.h>
#include <RobotAPI/interface/units/LaserScannerUnit.h>
namespace armarx
......@@ -30,7 +31,7 @@ namespace armarx
{
std::string agent;
std::string frame;
std::int64_t timestamp;
armem::Time timestamp;
};
struct LaserScanStamped
......
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