Go to the documentation of this file.
14 #include <IceUtil/Handle.h>
15 #include <IceUtil/Time.h>
18 #include <SimoxUtility/algorithm/get_map_keys_values.h>
27 #include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
28 #include <RobotAPI/interface/armem/server/ReadingMemoryInterface.h>
29 #include <RobotAPI/interface/units/LaserScannerUnit.h>
43 #include <RobotAPI/libraries/armem_laser_scans/aron/LaserScan.aron.generated.h>
59 ARMARX_DEBUG <<
"TransformReader: registerPropertyDefinitions";
61 const std::string prefix = propertyPrefix;
132 std::vector<LaserScanStamped>
135 std::vector<LaserScanStamped> outV;
136 if (providerSegment.
empty())
141 const auto convert = [](
const auto& aronLaserScanStamped,
145 fromAron(aronLaserScanStamped, laserScanStamped);
147 const auto ndArrayNavigator =
152 laserScanStamped.
data = fromAron<LaserScanStep>(ndArrayNavigator);
154 return laserScanStamped;
164 ARMARX_WARNING <<
"Empty history for " << entity.id();
171 if (const auto o = tryCast<arondto::LaserScanStamped>(entityInstance))
173 outV.push_back(convert(*o, entityInstance));
184 Reader::queryData(
const Query& query)
const
186 const auto qb = buildQuery(query);
192 ARMARX_DEBUG <<
"[MappingDataReader] result: " << qResult;
194 if (not qResult.success)
196 ARMARX_WARNING <<
"Failed to query data from memory: " << qResult.errorMessage;
197 return {.laserScans = {},
199 .status = Result::Status::Error,
200 .errorMessage = qResult.errorMessage};
208 std::vector<std::string> sensors;
212 sensors.push_back(entity.
name());
216 return {.laserScans = laserScans,
218 .status = Result::Status::Success,
EntitySelector & all() override
SnapshotSelector & latest()
EntitySelector & entities()
Start specifying entities.
SnapshotSelector & timeRange(Time min, Time max)
Client-side working entity instance.
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
std::vector< LaserScanStamped > asLaserScans(const wm::ProviderSegment &providerSegment)
SnapshotSelector & snapshots()
Start specifying entity snapshots.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
armem::articulated_object::ArticulatedObject convert(const VirtualRobot::Robot &obj, const armem::Time ×tamp)
static PointerType DynamicCast(const VariantPtr &n)
CoreSegmentSelector & coreSegments()
Start specifying core segments.
SensorHeader fromAron(const arondto::SensorHeader &aronSensorHeader)
CoreSegmentSelector & withName(const std::string &name) override
Reader useReader(const MemoryID &memoryID)
Use a memory server and get a reader for it.
armarx::armem::client::query::Builder buildQuery(const Query &query) const
virtual DerivedT & withNames(const std::vector< std::string > &names)
std::vector< std::string > sensorList
ProviderSegmentSelector & withName(const std::string &name) override
bool forEachEntity(EntityFunctionT &&func)
const std::string memoryName
bool forEachInstance(InstanceFunctionT &&func)
The memory name system (MNS) client.
Indicates that a query to the Memory Name System failed.
The query::Builder class provides a fluent-style specification of hierarchical queries.
ProviderSegmentSelector & providerSegments()
Start specifying provider segments.
std::optional< TimeRange > timeRange
const armem::MemoryID MemoryID