Go to the documentation of this file.
36 properties(properties), services(services)
87 template <
class ValueT>
107 std::stringstream log;
110 std::map<MemoryID, std::vector<const MemoryValueID*>> valuesPerProviderSegment;
116 for (
const auto& [providerSegmentID,
values] : valuesPerProviderSegment)
121 reader = getReader(providerSegmentID);
125 log <<
"\n" << e.what();
133 log <<
"Query to provider segment " << providerSegmentID
141 if (entity ==
nullptr)
143 log <<
"\nDid not find entity " << valueId->
entityID <<
" in provider segment "
144 << providerSegmentID <<
".";
151 if (not valueVariant)
154 <<
" in entity instance " << instance.
id() <<
".";
167 if (not log.str().empty())
170 <<
"Encountered issues while sending memory values to the debug observer "
179 return simox::alg::replace_all(
memoryID.
str(),
"/",
">");
183 MemoryToDebugObserver::makeDatafieldName(
const aron::Path& path)
195 auto it = memoryReaders.find(
memoryID);
196 if (it != memoryReaders.end())
204 auto [it, _] = memoryReaders.emplace(
memoryID, reader);
217 j[
"entityID"] =
id.entityID.getItems();
218 j[
"aronPath"] =
id.aronPath.getPath();
225 id.aronPath = {j.at(
"aronPath").get<std::vector<std::string>>()};
std::string datafieldName
Reads data from a memory server.
MemoryToDebugObserver(const Properties &properties, const Services &services)
Constructor.
wm::Memory memory
The slice of the memory that matched the query.
QueryResult getLatestSnapshotsIn(const MemoryID &id, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const
Get the latest snapshots under the given memory ID.
MemoryNameSystem & memoryNameSystem
auto & getLatestInstance(int instanceIndex=0)
Retrieve the latest entity instance.
Client-side working entity instance.
#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 visitAronVariant(const aron::data::FloatPtr &v) override
void sendDebugObserverBatch()
std::string getDelimeter() const
std::string str(bool escapeDelimiters=true) const
Get a string representation of this memory ID.
std::vector< MemoryValueID > plottedValues
std::shared_ptr< Long > LongPtr
This file is part of ArmarX.
std::shared_ptr< Double > DoublePtr
void to_json(simox::json::json &j, const MemoryValueID &id)
void visitAronVariant(const aron::data::StringPtr &v) override
void visitAronVariant(const aron::data::DoublePtr &v) override
ID of an ARON value in the memory.
void setDebugObserverBatchModeEnabled(bool enable)
auto * findEntity(const MemoryID &entityID)
Find an entity.
std::shared_ptr< Variant > VariantPtr
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
void visitAronVariant(const aron::data::BoolPtr &v) override
std::shared_ptr< Value > value()
void visitAronVariant(const aron::data::IntPtr &v) override
void setDatafield(const ValueT &value)
armarx::DebugObserverHelper & debugObserver
static MemoryID fromItems(const std::vector< std::string > &items)
Constructor memory ID from items as returned by getItems().
void from_json(const simox::json::json &j, MemoryValueID &id)
void pollOnce()
Query values from the memory and send them to the debug observer.
MemoryID getProviderSegmentID() const
armarx::DebugObserverHelper & debugObserver
void visitAronVariant(const aron::data::LongPtr &v) override
double v(double t, double v0, double a0, double j)
void setDebugObserverDatafield(const std::string &channelName, const std::string &datafieldName, const TimedVariantPtr &value) const
Visitor(armarx::DebugObserverHelper &debugObserver)
requires isVisitor< VisitorImplementation, typename VisitorImplementation::Input > void visit(VisitorImplementation &v, typename VisitorImplementation::Input &o)
std::shared_ptr< Float > FloatPtr
Indicates that a query to the Memory Name System failed.
std::shared_ptr< String > StringPtr
std::string getRootIdentifier() const
std::shared_ptr< Int > IntPtr
Reader getReader(const MemoryID &memoryID)
Get a reader to the given memory name.
const DataT & data() const
Brief description of class DebugObserverHelper.
std::string toString() const
std::shared_ptr< Bool > BoolPtr