Go to the documentation of this file.
26 #include <SimoxUtility/algorithm/string.h>
41 defs->defineOptionalProperty<std::string>(
"PriorKnowledgeName",
"PriorKnowledge",
"Prior knowledge name.");
42 defs->defineOptionalProperty<std::string>(
"WorkingMemoryName",
"WorkingMemory",
"Working memory name.");
43 defs->defineOptionalProperty<std::string>(
"RobotStateComponentName",
"RobotStateComponent",
"Robot state component name.");
46 defs->defineOptionalProperty<std::string>(
47 "ObjectClassBlackWhitelistTopic",
"WorkingMemoryToArVizObjectClassBlackWhitelistUpdates",
48 "The topic where updates to the object class black-whitelist are published.");
49 defs->defineOptionalProperty<std::vector<std::string>>(
"ObjectClassWhitelist", {},
50 "If not empty, only these object classes are shown (comma separated list).")
51 .map(
"[empty whitelist]", {});
52 defs->defineOptionalProperty<std::vector<std::string>>(
"ObjectClassBlacklist", {},
53 "These object classes will never be shown (comma separated list).")
54 .map(
"[empty blacklist]", {});
57 defs->optional(p.updateFrequency,
"p.UpdateFrequency",
"Target number of updates per second.");
59 defs->optional(p.floor.show,
"p.floor.Show",
"Whether to show the floor.");
60 defs->optional(p.floor.height,
"p.floor.Height",
61 "Height (z) of the floor plane. \n"
62 "Set slightly below 0 to avoid z-fighting when drawing planes on the ground.");
63 defs->optional(p.loadObjectDatasetsStr,
"p.loadDatasets",
"Only load the files for the following datasets, separated by ;. Load all if input is empty.");
72 return "WorkingMemoryToArViz";
97 drawer.
initFromProxies(priorKnowledge, workingMemory, robotStateComponent, datasets);
100 armarx::BlackWhitelistUpdate
update;
106 if (p.floor.show > 0)
116 CycleUtil cycle(
int(1000 / p.updateFrequency));
118 while (task && !task->isStopped())
121 std::scoped_lock lock(drawerMutex);
151 std::scoped_lock lock(drawerMutex);
156 const memoryx::AttachObjectToRobotNodeInput&
input,
const Ice::Current&)
159 std::scoped_lock lock(drawerMutex);
164 const memoryx::DetachObjectFromRobotNodeInput&
input,
const Ice::Current&)
167 std::scoped_lock lock(drawerMutex);
void setArViz(armarx::viz::Client arviz)
Set the ArViz client.
void updateBlackWhitelist(const BlackWhitelistUpdate &update, const Ice::Current &=Ice::emptyCurrent) override
void attachObjectToRobotNode(const memoryx::AttachObjectToRobotNodeInput &attachment)
WorkingMemoryToArVizPropertyDefinitions(std::string prefix)
void updateFloorObject(float height=0)
Draw a the floor as a simox object.
This util class helps with keeping a cycle time during a control cycle.
std::string getDefaultName() const override
bool usingProxyFromProperty(const std::string &propertyName, const std::string &endpoints="")
Use a proxy whose name is specified by the given property.
void onInitComponent() override
Pure virtual hook for the subclass.
void initFromProxies(const PriorKnowledgeInterfacePrx &priorKnowledge, const WorkingMemoryInterfacePrx &workingMemory, const armarx::RobotStateComponentInterfacePrx &robotStateComponent, const std::vector< std::string > &datasets)
Set the proxies.
#define ARMARX_TRACE_LITE
ProxyType getProxyFromProperty(const std::string &propertyName, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true)
Get a proxy whose name is specified by the given property.
void onExitComponent() override
Hook for subclass.
void onDisconnectComponent() override
Hook for subclass.
ReaderT::InputType & input
void usingTopicFromProperty(const std::string &propertyName, bool orderedPublishing=false)
Use a topic whose name is specified by the given property.
void detachObjectFromRobotNode(const memoryx::DetachObjectFromRobotNodeInput &detachment)
Property definitions of WorkingMemoryToArViz.
void detachObjectFromRobotNode(const memoryx::DetachObjectFromRobotNodeInput &input, const Ice::Current &=Ice::emptyCurrent) override
IceUtil::Time waitForCycleDuration()
This function will wait (virtual or system time) until the cycle time is reached.
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Default component property definition container.
armarx::viz::Client arviz
Property< PropertyType > getProperty(const std::string &name)
Property creation and retrieval.
void onConnectComponent() override
Pure virtual hook for the subclass.
void updateObjectClassBlackWhitelist(const armarx::BlackWhitelistUpdate &update)
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void updateObjects()
Query object instances and update their visualization.
void attachObjectToRobotNode(const memoryx::AttachObjectToRobotNodeInput &input, const Ice::Current &=Ice::emptyCurrent) override
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)