Go to the documentation of this file.
3 #include <VirtualRobot/RuntimeEnvironment.h>
26 const PriorKnowledgeInterfacePrx& priorKnowledge,
27 const WorkingMemoryInterfacePrx& workingMemory,
29 const std::vector<std::string>& datasets)
39 this->robotStateComponent = robotStateComponent;
41 VirtualRobot::RobotIO::RobotDescription::eStructure);
42 this->objectInstanceSegment = workingMemory->getObjectInstancesSegment();
65 std::vector<ObjectInstancePtr> objectInstances = attachments.
queryObjects();
74 for (
const auto&
object : objectInstances)
78 layer.
add(*vizObject);
90 .
color(simox::Color::gray(200));
105 VirtualRobot::RuntimeEnvironment::getDataFileAbsolute(
filename);
113 std::string objectName =
object->getName();
114 const std::string className =
object->getMostProbableClass();
115 const std::string vizName = objectName +
"_" +
object->getId();
117 if (objectClassBlackWhitelist.
isExcluded(className))
123 std::string
filename = getClassFilename(className);
127 <<
"Skipping object '" <<
object->getName() <<
"'.";
140 std::string ObjectInstancesToArViz::getClassFilename(
const std::string& className)
143 if (
auto it = classFilenameCache.find(className); it != classFilenameCache.end())
151 std::optional<ObjectClassWrapper> objectClass = objectClassSegment.
getClass(className);
157 objectClass->classInMemory->getWrapper<EntityWrappers::SimoxObjectWrapper>();
159 std::string
filename = wrapper->getManipulationObjectFileName();
162 classFilenameCache[className] =
filename;
173 ARMARX_VERBOSE <<
"Updated object class black-whitelist: \n" << objectClassBlackWhitelist;
void setArViz(armarx::viz::Client arviz)
Set the ArViz client.
CommitResult commit(StagedCommit const &commit)
void attachObjectToRobotNode(const memoryx::AttachObjectToRobotNodeInput &attachment)
void updateBlackWhitelist(StringBlackWhitelist &bw, const armarx::BlackWhitelistUpdate &update)
std::string floorObjectFilename
void attachObjectToRobotNode(const memoryx::AttachObjectToRobotNodeInput &attachment)
#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)
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)
Polygon & plane(Eigen::Hyperplane3f plane, Eigen::Vector3f at, Eigen::Vector2f size)
Add points representing a plane as rectangle.
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)
armarx::viz::Polygon makeFloorPolygon(const Eigen::Vector2f &extents={ 10000, 10000 }, float height=0)
Make a polygon representing the floor.
MatrixXX< 4, 4, float > Matrix4f
DerivedT & pose(Eigen::Matrix4f const &pose)
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
DerivedT & color(Color color)
Eigen::Matrix4f getObjectPoseInFrame(ObjectInstancePtr object, const std::string &frame)
std::string layerNameFloor
void updateObjectClassBlackWhitelist(const armarx::BlackWhitelistUpdate &update)
std::string layerNameObjects
void updateFloorPolygon(const Eigen::Vector2f &extents={ 10000, 10000 }, float height=0)
Draw a the floor as a polygon.
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.