Go to the documentation of this file.
27 #include <qnamespace.h>
29 #include <SimoxUtility/algorithm/apply.hpp>
30 #include <VirtualRobot/VirtualRobot.h>
36 #include <RobotAPI/interface/armem/commit.h>
43 #include <VisionX/libraries/armem_human/aron/HumanPose.aron.generated.h>
66 profileSegment(iceAdapter()),
67 personInstanceSegment(iceAdapter()),
68 poseSegment(iceAdapter()),
69 faceRecognitionSegment(iceAdapter()),
70 identificationSegment(iceAdapter()),
71 visu(poseSegment, faceRecognitionSegment, personInstanceSegment)
85 profileSegment.
init();
86 personInstanceSegment.
init();
88 faceRecognitionSegment.
init();
89 identificationSegment.
init();
119 if (robots.count(robotName) == 0)
121 auto newRobot = virtualRobotReaderPlugin->get().getRobot(robotName);
123 <<
"Failed to obtain robot with name `" << robotName <<
"`.";
125 robots[robotName] = newRobot;
128 return robots.at(robotName);
132 bool const success = virtualRobotReaderPlugin->get().synchronizeRobot(*robot, timestamp);
148 const ::armarx::aron::data::dto::AronDictSeq& dictSeq,
149 const ::std::string& providerName,
150 const ::armarx::core::time::dto::DateTime& iceTimestamp,
151 const ::Ice::Current& )
160 fromIce(iceTimestamp, timestamp);
164 {
return armarx::human::arondto::HumanPose::FromAron(dict); };
166 std::vector<armarx::human::arondto::HumanPose> humanPoses =
167 simox::alg::apply(dictSeq, toHumanPose);
170 const std::string robotName =
171 humanPoses.front().keypoints.begin()->second.positionCamera.header.agent;
178 <<
"`. Won't commit poses";
186 for (armarx::human::arondto::HumanPose& humanPose : humanPoses)
188 for (
auto& [_, keyPoint] : humanPose.keypoints)
190 const auto& cameraFrame = keyPoint.positionCamera.header.frame;
191 const auto& agent = keyPoint.positionCamera.header.agent;
194 keyPoint.positionCamera.position, cameraFrame, agent);
211 robot->getRootNode()->getName(),
216 if (keyPoint.orientationCamera.has_value())
219 keyPoint.positionCamera.header.frame);
222 keyPoint.orientationCamera->orientation.toRotationMatrix(),
223 keyPoint.positionCamera.position,
229 const Eigen::Isometry3f global_T_human(
235 keyPoint.orientationGlobal.value(),
243 const Eigen::Isometry3f robot_root_T_human(
252 robot->getRootNode()->getName(),
266 const std::vector<::armarx::human::arondto::HumanPose>& humanPoses,
267 const std::string& providerName,
274 const auto entityID = providerId.withEntityName(
"human_poses").withTimestamp(timestamp);
277 update.entityID = entityID;
278 update.sentTime = timestamp;
279 update.referencedTime = timestamp;
284 std::back_inserter(
update.instancesData),
286 { return humanPose.toAron(); });
virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
void connect(const viz::Client &arviz, DebugObserverInterfacePrx debugObserver=nullptr)
A bundle of updates to be sent to the memory.
static const std::string CORE_SEGMENT_NAME
#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...
const std::string GlobalFrame
std::string getDefaultName() const override
Retrieve default name of component.
void setMemoryName(const std::string &memoryName)
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
const DebugObserverInterfacePrx & getDebugObserver() const
Eigen::Vector3f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
server::wm::Memory & workingMemory()
Eigen::Vector3f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
void onExitComponent() override
Hook for subclass.
VirtualRobot::RobotPtr getSynchronizedRobot(const std::string &robotName, const armarx::DateTime ×tamp)
Eigen::Matrix4f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
virtual void init() override
The FramedPosition class.
An update of an entity for a specific point in time.
CoreSegmentT & addCoreSegment(const std::string &name, aron::type::ObjectPtr coreSegmentType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
Add an empty core segment with the given name, type and prediction engines.
MemoryToIceAdapter & iceAdapter()
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
The FramedOrientation class.
void onInitComponent() override
Pure virtual hook for the subclass.
void fromIce(const data::MemoryID &ice, MemoryID &id)
virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Eigen::Matrix4f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT >>
Convenience function (with less typing) to transform a container of type InputT into the same contain...
virtual data::CommitResult commit(const data::Commit &commit, const Ice::Current &=Ice::emptyCurrent) override
Represents a point in time.
std::shared_ptr< Dict > DictPtr
void onDisconnectComponent() override
Hook for subclass.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
const VariantTypeId FramedOrientation
Default component property definition container.
armarx::viz::Client arviz
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
void toAron(arondto::PackagePath &dto, const PackageFileLocation &bo)
MatrixXX< 3, 3, float > Matrix3f
const VariantTypeId FramedPosition
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
void onConnectComponent() override
Pure virtual hook for the subclass.
data::CommitResult commitLocking(const data::Commit &commitIce, Time timeArrived)
std::shared_ptr< class Robot > RobotPtr
void commitHumanPoses(const std::vector<::armarx::human::arondto::HumanPose > &humanPoses, const std::string &providerName, const armarx::DateTime ×tamp)
void commitHumanPosesInCameraFrame(const ::armarx::aron::data::dto::AronDictSeq &dictSeq, const ::std::string &providerName, const ::armarx::core::time::dto::DateTime ×tamp, const ::Ice::Current &=::Ice::emptyCurrent) override
const armem::MemoryID MemoryID