26 #include <Eigen/Geometry>
28 #include <IceUtil/Time.h>
30 #include <SimoxUtility/math/pose/pose.h>
31 #include <VirtualRobot/Robot.h>
32 #include <VirtualRobot/VirtualRobot.h>
33 #include <VirtualRobot/XML/RobotIO.h>
65 defs->optional(p.updateFrequency,
"updateFrequency",
"Memory update frequency (write).");
66 defs->optional(p.robot.package,
"robot.package",
"");
67 defs->optional(p.robot.path,
"robot.path",
"");
75 return "VirtualRobotWriterExample";
106 VirtualRobotWriterExample::loadRobot()
const
110 VirtualRobot::RobotIO::eStructure);
118 if (robot ==
nullptr)
122 if (robot ==
nullptr)
130 ARMARX_CHECK(virtualRobotWriterPlugin->get().storeDescription(*robot));
133 const float t =
float((now - start).toSecondsDouble());
136 const float m = (1 + std::sin(t / (M_2_PI * 10))) / 2;
138 auto jointValues = robot->getJointValues();
139 for (
auto& [k,
v] : jointValues)
141 const auto node = robot->getRobotNode(k);
143 if (node->isLimitless())
148 v = node->getJointLimitLow() +
149 (node->getJointLimitHigh() - node->getJointLimitLow()) * m;
152 robot->setGlobalPose(simox::math::pose(Eigen::Vector3f(1000, 0, 0)));
153 robot->setJointValues(jointValues);