Skip to content
Snippets Groups Projects
Commit 9c393997 authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

Merge branch 'armem/dev' of https://gitlab.com/ArmarX/RobotAPI into armem/robotstatememory_updates

parents 65976bbc c24d100f
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
......@@ -128,7 +124,7 @@ namespace armarx::armem
ARMARX_WARNING << "No entities!";
}
const auto convert = [](const aron::LaserScanStamped & aronLaserScanStamped, const EntityInstance & ei) -> LaserScanStamped
const auto convert = [](const arondto::LaserScanStamped & aronLaserScanStamped, const EntityInstance & ei) -> LaserScanStamped
{
LaserScanStamped laserScanStamped;
fromAron(aronLaserScanStamped, laserScanStamped);
......@@ -159,7 +155,7 @@ namespace armarx::armem
{
for (const auto& entityInstance : entitySnapshot.instances)
{
const auto o = tryCast<aron::LaserScanStamped>(entityInstance);
const auto o = tryCast<arondto::LaserScanStamped>(entityInstance);
if (o)
{
......
......@@ -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 =
......@@ -73,9 +73,9 @@ namespace armarx::armem
update.entityID = entityID;
update.timeCreated = armem::Time::now();
aron::LaserScanStamped aronSensorData;
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));
......
......@@ -8,7 +8,7 @@
<GenerateTypes>
<Object name='armarx::aron::LaserScannerInfo'>
<Object name='armarx::arondto::LaserScannerInfo'>
<ObjectChild key='device'>
<string />
</ObjectChild>
......@@ -26,7 +26,7 @@
</ObjectChild>
</Object>
<Object name="armarx::aron::SensorHeader">
<Object name="armarx::arondto::SensorHeader">
<ObjectChild key="agent">
<string/>
</ObjectChild>
......@@ -39,9 +39,9 @@
</Object>
<Object name='armarx::aron::LaserScanStamped'>
<Object name='armarx::arondto::LaserScanStamped'>
<ObjectChild key="header">
<armarx::aron::SensorHeader />
<armarx::arondto::SensorHeader />
</ObjectChild>
<!--
......
#include "aron_conversions.h"
#include <algorithm>
#include <cstdint>
#include <iterator>
#include <RobotAPI/interface/units/LaserScannerUnit.h>
......@@ -16,21 +17,27 @@ namespace armarx
/************ fromAron ************/
SensorHeader fromAron(const aron::SensorHeader& aronSensorHeader)
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 aron::LaserScanStamped& aronLaserScan,
void fromAron(const arondto::LaserScanStamped& aronLaserScan,
LaserScanStamped& laserScan)
{
laserScan.header = fromAron(aronLaserScan.header);
// laserScan.data = fromAron(aronLaserScan.data);
}
void fromAron(const aron::LaserScanStamped& aronLaserScan, LaserScan& laserScan,
void fromAron(const arondto::LaserScanStamped& aronLaserScan, LaserScan& laserScan,
std::int64_t& timestamp, std::string& frame,
std::string& agentName)
{
......@@ -38,7 +45,7 @@ namespace armarx
// laserScan = fromAron(aronLaserScan.data);
timestamp = header.timestamp;
timestamp = header.timestamp.toMicroSeconds();
frame = header.frame;
agentName = header.agent;
}
......@@ -52,29 +59,34 @@ namespace armarx
// aronLaserScan.scan = toAron(laserScan);
// }
aron::SensorHeader toAron(const SensorHeader& sensorHeader)
int64_t toAron(const armem::Time& timestamp)
{
return timestamp.toMicroSeconds();
}
arondto::SensorHeader toAron(const SensorHeader& sensorHeader)
{
aron::SensorHeader aronSensorHeader;
arondto::SensorHeader aronSensorHeader;
aronSensorHeader.agent = sensorHeader.agent;
aronSensorHeader.frame = sensorHeader.frame;
aronSensorHeader.timestamp = sensorHeader.timestamp;
aronSensorHeader.timestamp = toAron(sensorHeader.timestamp);
return aronSensorHeader;
}
void toAron(const LaserScanStamped& laserScanStamped,
aron::LaserScanStamped& aronLaserScanStamped)
arondto::LaserScanStamped& aronLaserScanStamped)
{
aronLaserScanStamped.header = toAron(laserScanStamped.header);
// toAron(laserScanStamped.data, aronLaserScanStamped.data);
}
void toAron(const LaserScan& laserScan,
const std::int64_t& timestamp,
const armem::Time& timestamp,
const std::string& frame,
const std::string& agentName,
aron::LaserScanStamped& aronLaserScanStamped)
arondto::LaserScanStamped& aronLaserScanStamped)
{
const SensorHeader header
{
......
......@@ -25,11 +25,12 @@
#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
{
namespace aron
namespace arondto
{
struct LaserScanStamped;
} // namespace aron
......@@ -38,7 +39,7 @@ namespace armarx
struct LaserScanStamped;
void fromAron(
const aron::LaserScanStamped& aronLaserScan,
const arondto::LaserScanStamped& aronLaserScan,
LaserScan& laserScan,
std::int64_t& timestamp,
std::string& frame,
......@@ -51,14 +52,14 @@ namespace armarx
return aron::converter::AronVectorConverter::ConvertToVector<T>(navigator);
}
void fromAron(const aron::LaserScanStamped& aronLaserScan, LaserScanStamped& laserScan);
void fromAron(const arondto::LaserScanStamped& aronLaserScan, LaserScanStamped& laserScan);
void toAron(
const LaserScan& laserScan,
const std::int64_t& timestamp,
const armem::Time& timestamp,
const std::string& frame,
const std::string& agentName,
aron::LaserScanStamped& aronLaserScan);
arondto::LaserScanStamped& aronLaserScan);
inline aron::datanavigator::NDArrayNavigatorPtr toAron(const LaserScan& laserScan)
{
......
......@@ -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