25 #include <VirtualRobot/math/Helpers.h>
26 #include <VirtualRobot/math/Line.h>
27 #include <VirtualRobot/math/LinearInterpolatedOrientation.h>
38 MyTrajectory(std::vector<Eigen::Matrix4f> poses,
float duration) : duration(duration)
40 for (
size_t i = 0; i < poses.size(); i++)
42 posFuncts.emplace_back(
43 math::Line::FromPoses(poses.at(i), poses.at((i + 1) % poses.size())));
44 oriFuncts.emplace_back(math::LinearInterpolatedOrientation(
45 math::Helpers::GetOrientation(poses.at(i)),
46 math::Helpers::GetOrientation(poses.at((i + 1) % poses.size())),
56 t = fmod(t / duration, 1.0f) * posFuncts.size();
57 int i =
std::min((
int)t, (
int)posFuncts.size() - 1);
59 return posFuncts.at(i).Get(f);
65 t = fmod(t / duration, 1.0f) * posFuncts.size();
66 int i =
std::min((
int)t, (
int)posFuncts.size() - 1);
68 return oriFuncts.at(i).Get(f);
72 std::vector<math::Line> posFuncts;
73 std::vector<math::LinearInterpolatedOrientation> oriFuncts;
78 DummyArMarkerLocalizer::onInitComponent()
80 agentName = getProperty<std::string>(
"AgentName").getValue();
81 frameName = getProperty<std::string>(
"FrameName").getValue();
83 Eigen::Vector3f p1(470, 723, 991);
84 Eigen::Vector3f p2(100, 0, 0);
85 Eigen::Vector3f p3(100, 0, 100);
86 Eigen::Vector3f p4(0, 0, 100);
87 float duration = 10.0f;
88 std::vector<Eigen::Matrix4f> poses;
91 poses.emplace_back(math::Helpers::CreatePose(
94 poses.emplace_back(math::Helpers::CreatePose(
97 poses.emplace_back(math::Helpers::CreatePose(
105 DummyArMarkerLocalizer::onConnectComponent()
111 DummyArMarkerLocalizer::onDisconnectComponent()
116 DummyArMarkerLocalizer::onExitComponent()
121 DummyArMarkerLocalizer::createPropertyDefinitions()
130 ARMARX_WARNING <<
"This is not a real image processor. Ignoring any input image!";
133 ArMarkerLocalizationResultList
136 ArMarkerLocalizationResultList result;
137 ArMarkerLocalizationResult marker;
141 math::Helpers::CreatePose(trajectory->GetPosition(t), trajectory->GetOrientation(t)),
144 result.push_back(marker);
148 ArMarkerLocalizationResultList
149 DummyArMarkerLocalizer::GetLatestLocalizationResult(
const Ice::Current&)
151 return LocalizeAllMarkersNow(Ice::emptyCurrent);