25#include <Eigen/Geometry>
35#include <Calibration/Calibration.h>
36#include <Image/ImageProcessor.h>
37#include <Image/IplImageAdaptor.h>
38#include <Image/PrimitivesDrawer.h>
39#include <Image/PrimitivesDrawerCV.h>
46using namespace std::filesystem;
68 if (!debugDrawerTopicPrx)
76 robotStateComponent, VirtualRobot::RobotIO::RobotDescription::eFull);
86 memoryx::ObjectLocalizationResultList
88 const memoryx::ObjectClassNameList& classes,
98 std::map<std::string, int> nameIdMap;
99 for (
auto entry : mapping)
109 memoryx::ObjectLocalizationResultList result;
110 for (
auto className : classes)
114 auto id = nameIdMap[className];
115 auto regResult = prx->getObjectPose(
id);
116 if (regResult.confidence <= 0)
121 memoryx::ObjectLocalizationResult r;
122 r.instanceName = className;
123 r.objectClassName = className;
124 r.recognitionCertainty = regResult.confidence * 0.2;
126 Eigen::Matrix4f pose =
127 Eigen::Map<Eigen::Matrix4f>(regResult.matrix4x4.data()).transpose();
128 pose.block<3, 1>(0, 3) *= 1000.0;
135 const Eigen::Matrix4f gpose =
136 localRobot->getRobotNode(cameraFrame)->getGlobalPose() * pose;
137 debugDrawerTopicPrx->setPoseVisu(
getName(), className +
"_global",
new Pose{gpose});
168 Eigen::Vector3f cov(10, 10, 10000);
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Property< PropertyType > getProperty(const std::string &name)
The FramedOrientation class.
The FramedPosition class.
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
TopicProxyType getTopic(const std::string &name)
Returns a proxy of the specified topic.
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
std::string getName() const
Retrieve name of object.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
static VirtualRobot::RobotPtr createLocalCloneFromFile(RobotStateComponentInterfacePrx robotStatePrx, VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
This is a convenience function for createLocalClone, which automatically gets the filename from the R...
static bool synchronizeLocalClone(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx)
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
Implements a Variant type for timestamps.
The MultivariateNormalDistribution class.
void onInitComponent() override
Pure virtual hook for the subclass.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList &classes, const Ice::Current &) override
void onConnectComponent() override
Pure virtual hook for the subclass.
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
#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...
#define ARMARX_INFO
The normal logging level.
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_VERBOSE
The logging level for verbose information.
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)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
float toFloat(const std::string &input)
Converts a string to float and uses always dot as seperator.