Go to the documentation of this file.
3 #include <VirtualRobot/RuntimeEnvironment.h>
25 const PriorKnowledgeInterfacePrx& priorKnowledge,
26 const WorkingMemoryInterfacePrx& workingMemory,
28 const std::vector<std::string>& datasets)
38 this->robotStateComponent = robotStateComponent;
40 robotStateComponent,
"", {}, VirtualRobot::RobotIO::RobotDescription::eStructure);
41 this->objectInstanceSegment = workingMemory->getObjectInstancesSegment();
66 std::vector<ObjectInstancePtr> objectInstances = attachments.
queryObjects();
76 for (
const auto&
object : objectInstances)
80 layer.
add(*vizObject);
92 .color(simox::Color::gray(200));
107 VirtualRobot::RuntimeEnvironment::getDataFileAbsolute(
filename);
111 std::optional<armarx::viz::Object>
115 std::string objectName =
object->getName();
116 const std::string className =
object->getMostProbableClass();
117 const std::string vizName = objectName +
"_" +
object->getId();
119 if (objectClassBlackWhitelist.
isExcluded(className))
125 std::string
filename = getClassFilename(className);
130 <<
"Skipping object '" <<
object->getName() <<
"'.";
141 ObjectInstancesToArViz::getClassFilename(
const std::string& className)
144 if (
auto it = classFilenameCache.find(className); it != classFilenameCache.end())
152 std::optional<ObjectClassWrapper> objectClass = objectClassSegment.
getClass(className);
158 objectClass->classInMemory->getWrapper<EntityWrappers::SimoxObjectWrapper>();
160 std::string
filename = wrapper->getManipulationObjectFileName();
163 classFilenameCache[className] =
filename;
171 const armarx::BlackWhitelistUpdate&
update)
175 ARMARX_VERBOSE <<
"Updated object class black-whitelist: \n" << objectClassBlackWhitelist;
187 const DetachObjectFromRobotNodeInput& detachment)
void setArViz(armarx::viz::Client arviz)
Set the ArViz client.
armarx::viz::Polygon makeFloorPolygon(const Eigen::Vector2f &extents={10000, 10000}, float height=0)
Make a polygon representing the floor.
CommitResult commit(StagedCommit const &commit)
void updateFloorPolygon(const Eigen::Vector2f &extents={10000, 10000}, float height=0)
Draw a the floor as a polygon.
void attachObjectToRobotNode(const memoryx::AttachObjectToRobotNodeInput &attachment)
void updateBlackWhitelist(StringBlackWhitelist &bw, const armarx::BlackWhitelistUpdate &update)
std::string floorObjectFilename
void attachObjectToRobotNode(const memoryx::AttachObjectToRobotNodeInput &attachment)
MatrixXX< 4, 4, float > Matrix4f
#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...
Object & file(std::string const &project, std::string const &filename)
void updateFloorObject(float height=0)
Draw a the floor as a simox object.
const std::string GlobalFrame
std::optional< ObjectClassWrapper > getClass(std::string const &className) const
std::string getFloorObjectFile()
void initFromProxies(const PriorKnowledgeInterfacePrx &priorKnowledge, const WorkingMemoryInterfacePrx &workingMemory, const armarx::RobotStateComponentInterfacePrx &robotStateComponent, const std::vector< std::string > &datasets)
Set the proxies.
void add(ElementT const &element)
void detachObjectFromRobotNode(const memoryx::DetachObjectFromRobotNodeInput &detachment)
bool isExcluded(const Key &element) const
An element is excluded if (1) it is in the blacklist, or (2) it is not in the non-empty whitelist.
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
void Identity(MatrixXX< N, N, T > *a)
::wykobi::polygon< float, 2 > Polygon
armarx::viz::Object makeFloorObject(const std::string &name="Floor")
void initFromProxy(memoryx::PriorKnowledgeInterfacePrx const &priorKnowledge, const std::vector< std::string > &datasets)
void detachObjectFromRobotNode(const memoryx::DetachObjectFromRobotNodeInput &detachment)
void initFromProxies(const WorkingMemoryInterfacePrx &workingMemory, const armarx::RobotStateComponentInterfacePrx &robotStateComponent)
Set the proxies.
IceInternal::Handle< SimoxObjectWrapper > SimoxObjectWrapperPtr
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
DerivedT & pose(Eigen::Matrix4f const &pose)
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
Eigen::Matrix4f getObjectPoseInFrame(ObjectInstancePtr object, const std::string &frame)
std::string layerNameFloor
void updateObjectClassBlackWhitelist(const armarx::BlackWhitelistUpdate &update)
std::string layerNameObjects
std::vector< ObjectInstancePtr > queryObjects()
Get all entities from objectInstanceSegment and cast them to ObjectInstance.
Layer layer(std::string const &name) const
void updateObjects()
Query object instances and update their visualization.
void commitLayerContaining(std::string const &name)
std::optional< armarx::viz::Object > makeObject(const ObjectInstancePtr &object)
Make a armarx::viz::Object from a memoryx::ObjectInstance.