27#include <VirtualRobot/math/Helpers.h>
28#include <VirtualRobot/math/Line.h>
29#include <VirtualRobot/math/LinearInterpolatedOrientation.h>
40 MyTrajectory(std::vector<Eigen::Matrix4f> poses,
float duration) : duration(duration)
42 for (
size_t i = 0; i < poses.size(); i++)
44 posFuncts.emplace_back(
45 math::Line::FromPoses(poses.at(i), poses.at((i + 1) % poses.size())));
46 oriFuncts.emplace_back(math::LinearInterpolatedOrientation(
47 math::Helpers::GetOrientation(poses.at(i)),
48 math::Helpers::GetOrientation(poses.at((i + 1) % poses.size())),
58 t = fmod(t / duration, 1.0f) * posFuncts.size();
59 int i = std::min((
int)t, (
int)posFuncts.size() - 1);
61 return posFuncts.at(i).Get(f);
67 t = fmod(t / duration, 1.0f) * posFuncts.size();
68 int i = std::min((
int)t, (
int)posFuncts.size() - 1);
70 return oriFuncts.at(i).Get(f);
74 std::vector<math::Line> posFuncts;
75 std::vector<math::LinearInterpolatedOrientation> oriFuncts;
85 Eigen::Vector3f p1(470, 723, 991);
86 Eigen::Vector3f p2(100, 0, 0);
87 Eigen::Vector3f p3(100, 0, 100);
88 Eigen::Vector3f p4(0, 0, 100);
89 float duration = 10.0f;
90 std::vector<Eigen::Matrix4f> poses;
92 poses.emplace_back(math::Helpers::CreatePose(p1, Eigen::Matrix3f::Identity()));
93 poses.emplace_back(math::Helpers::CreatePose(
95 Eigen::Matrix3f::Identity() * Eigen::AngleAxisf(-0.25 *
M_PI, Eigen::Vector3f::UnitY())));
96 poses.emplace_back(math::Helpers::CreatePose(
98 Eigen::Matrix3f::Identity() * Eigen::AngleAxisf(-0.5 *
M_PI, Eigen::Vector3f::UnitY())));
99 poses.emplace_back(math::Helpers::CreatePose(
101 Eigen::Matrix3f::Identity() * Eigen::AngleAxisf(-0.75 *
M_PI, Eigen::Vector3f::UnitY())));
132 ARMARX_WARNING <<
"This is not a real image processor. Ignoring any input image!";
135ArMarkerLocalizationResultList
138 ArMarkerLocalizationResultList result;
139 ArMarkerLocalizationResult marker;
146 result.push_back(marker);
150ArMarkerLocalizationResultList
160 return "DummyArMarkerLocalizer";
#define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName)
Eigen::Vector3f GetPosition(float t) override
Eigen::Quaternionf GetOrientation(float t) override
MyTrajectory(std::vector< Eigen::Matrix4f > poses, float duration)
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Property< PropertyType > getProperty(const std::string &name)
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
Brief description of class DummyArMarkerLocalizer.
void onInitComponent() override
void reportImageAvailable(const std::string &, const Ice::Current &) override
void onDisconnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
math::SimpleAbstractFunctionR1R6Ptr trajectory
void onConnectComponent() override
ArMarkerLocalizationResultList GetLatestLocalizationResult(const Ice::Current &) override
static std::string GetDefaultName()
void onExitComponent() override
ArMarkerLocalizationResultList LocalizeAllMarkersNow(const Ice::Current &) override
std::string getDefaultName() const override
Retrieve default name of component.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Quaternion< float, 0 > Quaternionf
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.