26 #include <VirtualRobot/math/Helpers.h>
27 #include <VirtualRobot/math/Line.h>
28 #include <VirtualRobot/math/LinearInterpolatedOrientation.h>
42 for (
size_t i = 0 ; i < poses.size(); i++)
44 posFuncts.emplace_back(math::Line::FromPoses(poses.at(i), poses.at((i + 1) % poses.size())));
45 oriFuncts.emplace_back(math::LinearInterpolatedOrientation(math::Helpers::GetOrientation(poses.at(i)), math::Helpers::GetOrientation(poses.at((i + 1) % poses.size())), 0, 1,
true));
51 t = fmod(t / duration, 1.0f) * posFuncts.size();
52 int i =
std::min((
int)t, (
int)posFuncts.size() - 1);
54 return posFuncts.at(i).Get(f);
58 t = fmod(t / duration, 1.0f) * posFuncts.size();
59 int i =
std::min((
int)t, (
int)posFuncts.size() - 1);
61 return oriFuncts.at(i).Get(f);
65 std::vector<math::Line> posFuncts;
66 std::vector<math::LinearInterpolatedOrientation> oriFuncts;
73 void DummyArMarkerLocalizer::onInitComponent()
75 agentName = getProperty<std::string>(
"AgentName").getValue();
76 frameName = getProperty<std::string>(
"FrameName").getValue();
78 Eigen::Vector3f p1(470, 723, 991);
79 Eigen::Vector3f p2(100, 0, 0);
80 Eigen::Vector3f p3(100, 0, 100);
81 Eigen::Vector3f p4(0, 0, 100);
82 float duration = 10.0f;
83 std::vector<Eigen::Matrix4f> poses;
86 poses.emplace_back(math::Helpers::CreatePose(p1 + p2,
Eigen::Matrix3f::Identity()*Eigen::AngleAxisf(-0.25 *
M_PI, Eigen::Vector3f::UnitY())));
88 poses.emplace_back(math::Helpers::CreatePose(p1 + p4,
Eigen::Matrix3f::Identity()*Eigen::AngleAxisf(-0.75 *
M_PI, Eigen::Vector3f::UnitY())));
95 void DummyArMarkerLocalizer::onConnectComponent()
101 void DummyArMarkerLocalizer::onDisconnectComponent()
107 void DummyArMarkerLocalizer::onExitComponent()
115 getConfigIdentifier()));
122 ARMARX_WARNING <<
"This is not a real image processor. Ignoring any input image!";
127 ArMarkerLocalizationResultList result;
128 ArMarkerLocalizationResult marker;
131 marker.pose =
new FramedPose(math::Helpers::CreatePose(trajectory->GetPosition(t), trajectory->GetOrientation(t)), frameName, agentName);
132 result.push_back(marker);
136 ArMarkerLocalizationResultList DummyArMarkerLocalizer::GetLatestLocalizationResult(
const Ice::Current&)
138 return LocalizeAllMarkersNow(Ice::emptyCurrent);