5 #define TIMEDTRAJECTORY_PROBEFACTOR 100
7 #define TIMEDTRAJECTORY_FPS 100
17 throw InvalidArgumentException(
"Rns is null");
20 if (rns->getAllRobotNodes().size() == 0)
23 throw InvalidArgumentException(
"Rns is empty");
29 timestep = (timestep > 0) ? timestep : 0.01;
32 if (trajectory.getDuration() < 1)
37 std::vector<double> timestamps;
41 std::vector<std::vector<double>> nodeData;
42 std::vector<std::vector<double>> nodeData2;
45 timestamps.push_back(0);
47 for (
unsigned int i = 0; i < rns->getSize(); i++)
49 nodeData.push_back({trajectory.getPosition(0)[i]});
53 for (
double t = timestep; t < trajectory.getDuration(); t += timestep)
55 Eigen::VectorXd positions = trajectory.getPosition(t);
57 for (
unsigned int i = 0; i < positions.size(); i++)
59 nodeData[i].push_back(positions[i]);
63 timestamps.push_back(t);
66 LimitlessStateSeq state;
67 for (VirtualRobot::RobotNodePtr node : rns->getAllRobotNodes())
69 LimitlessState current;
70 current.enabled = node->isLimitless();
71 current.limitLo = node->getJointLimitLow();
72 current.limitHi = node->getJointLimitHigh();
73 state.push_back(current);
76 Ice::StringSeq dimensionNames = rns->getNodeNames();
82 traj->setLimitless(state);
119 for (pass = 1; pass < 10; pass ++)
122 std::vector<double> times;
132 Eigen::VectorXd pointJointAngles = trajectory.getPosition(t);
149 if (i >= userPoints.size())
155 times.push_back(trajectory.getDuration());
163 if (times.size() < userPoints.size())
173 pass == 1 ?
ARMARX_INFO << pass <<
" pass needed to find mapping" :
ARMARX_INFO << pass <<
" passes needed to find mapping";
176 ARMARX_INFO <<
"More than" << pass <<
"passes needed for calculation";
178 throw InvalidArgumentException(
"No TimedTrajectory could be created");