18#include <RobotAPI/interface/units/LaserScannerUnit.h>
25#include <RobotAPI/libraries/armem_laser_scans/aron/LaserScan.aron.generated.h>
42 ARMARX_DEBUG <<
"TransformReader: registerPropertyDefinitions";
44 const std::string prefix = propertyPrefix;
75 if (
query.sensorList.empty())
84 if (
query.timeRange.has_value())
86 snapshots.timeRange(
query.timeRange->min,
query.timeRange->max);
102 if (
query.timeRange.has_value())
104 snapshots.timeRange(
query.timeRange->min,
query.timeRange->max);
115 std::vector<LaserScanStamped>
118 std::vector<LaserScanStamped> outV;
120 if (providerSegment.
empty())
125 const auto convert = [](
const auto& aronLaserScanStamped,
129 fromAron(aronLaserScanStamped, laserScanStamped);
131 const auto ndArrayNavigator =
138 return laserScanStamped;
157 outV.push_back(
convert(*o, entityInstance));
176 ARMARX_DEBUG <<
"[MappingDataReader] result: " << qResult;
181 return {.laserScans = {},
190 return {.laserScans = {},
198 .hasProviderSegment(
query.agent))
201 return {.laserScans = {},
204 .errorMessage =
"No provider segment `" +
query.agent +
"`found in memory!"};
213 std::set<std::string> sensors;
217 sensors.insert(entity.
name());
221 return {.laserScans = laserScans,
bool hasCoreSegment(const std::string &name) const
CoreSegmentT & getCoreSegment(const std::string &name)
bool forEachEntity(EntityFunctionT &&func)
The memory name system (MNS) client.
Reader useReader(const MemoryID &memoryID)
Use a memory server and get a reader for it.
The query::Builder class provides a fluent-style specification of hierarchical queries.
CoreSegmentSelector & coreSegments()
Start specifying core segments.
CoreSegmentSelector & withName(const std::string &name) override
ProviderSegmentSelector & providerSegments()
Start specifying provider segments.
EntitySelector & all() override
SnapshotSelector & snapshots()
Start specifying entity snapshots.
ProviderSegmentSelector & withName(const std::string &name) override
EntitySelector & entities()
Start specifying entities.
virtual DerivedT & withNames(const std::vector< std::string > &names)
Indicates that a query to the Memory Name System failed.
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
armarx::armem::client::query::Builder buildQuery(const Query &query) const
Result queryData(const Query &query) const
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
static PointerType DynamicCast(const VariantPtr &n)
#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...
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
#define ARMARX_VERBOSE
The logging level for verbose information.
std::vector< LaserScanStamped > asLaserScans(const wm::ProviderSegment &providerSegment)
const std::string memoryName
SensorHeader fromAron(const arondto::SensorHeader &aronSensorHeader)
armem::wm::EntityInstance EntityInstance
std::optional< AronClass > tryCast(const wm::EntityInstance &item)
Tries to cast a armem::EntityInstance to AronClass.
armem::articulated_object::ArticulatedObject convert(const VirtualRobot::Robot &obj, const armem::Time ×tamp)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
bool forEachInstance(InstanceFunctionT &&func)
wm::Memory memory
The slice of the memory that matched the query.