GraspTrajectory.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
5  * Karlsruhe Institute of Technology (KIT), all rights reserved.
6  *
7  * ArmarX is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * ArmarX is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * @author Simon Ottenhaus (simon dot ottenhaus at kit dot edu)
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 #include "GraspTrajectory.h"
25 
26 #include <VirtualRobot/math/AbstractFunctionR1R6.h>
27 #include <VirtualRobot/math/Helpers.h>
28 
30 
31 using namespace armarx;
32 
34  const Eigen::VectorXf& handJointsTarget) :
35  tcpTarget(tcpTarget),
36  handJointsTarget(handJointsTarget),
37  dt(0),
38  feedForwardPosVelocity(0, 0, 0),
39  feedForwardOriVelocity(0, 0, 0),
40  feedForwardHandJointsVelocity(Eigen::VectorXf::Zero(handJointsTarget.rows()))
41 {
42 }
43 
45  const Eigen::VectorXf& handJointsTarget,
46  float dt,
47  const Eigen::Vector3f& feedForwardPosVelocity,
48  const Eigen::Vector3f& feedForwardOriVelocity,
49  const Eigen::VectorXf& feedForwardHandJointsVelocity) :
50  tcpTarget(tcpTarget),
51  handJointsTarget(handJointsTarget),
52  dt(dt),
53  feedForwardPosVelocity(feedForwardPosVelocity),
54  feedForwardOriVelocity(feedForwardOriVelocity),
55  feedForwardHandJointsVelocity(feedForwardHandJointsVelocity)
56 {
57 }
58 
59 Eigen::Vector3f
61 {
62  return ::math::Helpers::GetPosition(tcpTarget);
63 }
64 
67 {
68  return ::math::Helpers::GetOrientation(tcpTarget);
69 }
70 
73 {
74  return tcpTarget;
75 }
76 
77 void
79 {
80  Eigen::Vector3f pos0 = ::math::Helpers::GetPosition(prev->tcpTarget);
81  Eigen::Matrix3f ori0 = ::math::Helpers::GetOrientation(prev->tcpTarget);
82  Eigen::VectorXf hnd0 = prev->handJointsTarget;
83 
84  Eigen::Vector3f pos1 = ::math::Helpers::GetPosition(tcpTarget);
85  Eigen::Matrix3f ori1 = ::math::Helpers::GetOrientation(tcpTarget);
86  Eigen::VectorXf hnd1 = handJointsTarget;
87 
88  Eigen::Vector3f dpos = pos1 - pos0;
89  Eigen::Vector3f dori = ::math::Helpers::GetRotationVector(ori0, ori1);
90  Eigen::VectorXf dhnd = hnd1 - hnd0;
91 
92  this->dt = dt;
93  feedForwardPosVelocity = dpos / dt;
94  feedForwardOriVelocity = dori / dt;
95  feedForwardHandJointsVelocity = dhnd / dt;
96 }
97 
99  const Eigen::VectorXf& handJointsStart)
100 {
101  KeypointPtr keypoint(new Keypoint(tcpStart, handJointsStart));
102  keypointMap[0] = keypoints.size();
103  keypoints.push_back(keypoint);
104 }
105 
106 void
108  const Eigen::VectorXf& handJointsTarget,
109  float dt)
110 {
111  ARMARX_CHECK_EQUAL(GetHandJointCount(), handJointsTarget.rows());
112  KeypointPtr prev = lastKeypoint();
113  KeypointPtr keypoint(new Keypoint(tcpTarget, handJointsTarget));
114  keypoint->updateVelocities(prev, dt);
115  float t = getDuration() + dt;
116  keypointMap[t] = keypoints.size();
117  keypoints.push_back(keypoint);
118 }
119 
120 size_t
122 {
123  return keypoints.size();
124 }
125 
126 void
128  const Eigen::Matrix4f& tcpTarget,
129  const Eigen::VectorXf& handJointsTarget,
130  float dt)
131 {
132  ARMARX_CHECK_EQUAL(GetHandJointCount(), handJointsTarget.rows());
133  if (index <= 0 || index > keypoints.size())
134  {
135  throw LocalException("Index out of range" + std::to_string(index));
136  }
137  KeypointPtr prev = keypoints.at(index - 1);
138  KeypointPtr keypoint(new Keypoint(tcpTarget, handJointsTarget));
139  keypoint->updateVelocities(prev, dt);
140  if (index < keypoints.size())
141  {
142  KeypointPtr next = keypoints.at(index);
143  next->updateVelocities(keypoint, next->dt);
144  }
145  keypoints.insert(keypoints.begin() + index, keypoint);
146  updateKeypointMap();
147 }
148 
149 void
151 {
152  if (index <= 0 || index >= keypoints.size())
153  {
154  throw LocalException("Index out of range" + std::to_string(index));
155  }
156  keypoints.erase(keypoints.begin() + index);
157  if (index < keypoints.size())
158  {
159  KeypointPtr prev = keypoints.at(index - 1);
160  KeypointPtr next = keypoints.at(index);
161  next->updateVelocities(prev, next->dt);
162  }
163  updateKeypointMap();
164 }
165 
166 void
168  const Eigen::Matrix4f& tcpTarget,
169  const Eigen::VectorXf& handJointsTarget,
170  float dt)
171 {
172  ARMARX_CHECK_EQUAL(GetHandJointCount(), handJointsTarget.rows());
173  if (index <= 0 || index >= keypoints.size())
174  {
175  throw LocalException("Index out of range" + std::to_string(index));
176  }
177  KeypointPtr prev = keypoints.at(index - 1);
178  KeypointPtr keypoint(new Keypoint(tcpTarget, handJointsTarget));
179  keypoint->updateVelocities(prev, dt);
180  keypoints.at(index) = keypoint;
181  updateKeypointMap();
182 }
183 
184 void
186 {
187  if (index <= 0 || index >= keypoints.size())
188  {
189  throw LocalException("Index out of range" + std::to_string(index));
190  }
191  KeypointPtr prev = keypoints.at(index - 1);
192  KeypointPtr& keypoint = keypoints.at(index);
193  keypoint->updateVelocities(prev, dt);
194  updateKeypointMap();
195 }
196 
199 {
200  return keypoints.at(keypoints.size() - 1);
201 }
202 
205 {
206  return keypoints.at(i);
207 }
208 
211 {
212  return getKeypoint(0)->getTargetPose();
213 }
214 
215 void
216 GraspTrajectory::getIndex(float t, int& i1, int& i2, float& f)
217 {
218  if (t <= 0)
219  {
220  i1 = 0;
221  i2 = 0;
222  f = 0;
223  return;
224  }
225  std::map<float, size_t>::const_iterator it, prev;
226  it = keypointMap.upper_bound(t);
227  if (it == keypointMap.end())
228  {
229  i1 = keypoints.size() - 1;
230  i2 = keypoints.size() - 1;
231  f = 0;
232  return;
233  }
234  prev = std::prev(it);
235  i1 = prev->second;
236  i2 = it->second;
237  f = ::math::Helpers::ILerp(prev->first, it->first, t);
238 }
239 
240 Eigen::Vector3f
242 {
243  int i1, i2;
244  float f;
245  getIndex(t, i1, i2, f);
246  return ::math::Helpers::Lerp(
247  getKeypoint(i1)->getTargetPosition(), getKeypoint(i2)->getTargetPosition(), f);
248 }
249 
252 {
253  int i1, i2;
254  float f;
255  getIndex(t, i1, i2, f);
256  Eigen::Vector3f oriVel = GetOrientationDerivative(t);
257  if (oriVel.squaredNorm() == 0)
258  {
259  return getKeypoint(i1)->getTargetOrientation();
260  }
261  Eigen::AngleAxisf aa(oriVel.norm(), oriVel.normalized());
262  aa.angle() = aa.angle() * f * getKeypoint(i2)->dt;
263  return aa.toRotationMatrix() * getKeypoint(i1)->getTargetOrientation();
264 }
265 
268 {
269  return ::math::Helpers::CreatePose(GetPosition(t), GetOrientation(t));
270 }
271 
272 std::vector<Eigen::Matrix4f>
274 {
275  std::vector<Eigen::Matrix4f> res;
276  for (const KeypointPtr& keypoint : keypoints)
277  {
278  res.emplace_back(keypoint->getTargetPose());
279  }
280  return res;
281 }
282 
283 std::vector<Eigen::Vector3f>
285 {
286  std::vector<Eigen::Vector3f> res;
287  for (const KeypointPtr& keypoint : keypoints)
288  {
289  res.emplace_back(keypoint->getTargetPosition());
290  }
291  return res;
292 }
293 
294 std::vector<Eigen::Matrix3f>
296 {
297  std::vector<Eigen::Matrix3f> res;
298  for (const KeypointPtr& keypoint : keypoints)
299  {
300  res.emplace_back(keypoint->getTargetOrientation());
301  }
302  return res;
303 }
304 
305 Eigen::VectorXf
307 {
308  int i1, i2;
309  float f;
310  getIndex(t, i1, i2, f);
311 
312  return getKeypoint(i1)->handJointsTarget * (1 - f) + getKeypoint(i2)->handJointsTarget * f;
313 }
314 
315 Eigen::Vector3f
317 {
318  int i1, i2;
319  float f;
320  getIndex(t, i1, i2, f);
321  return getKeypoint(i2)->feedForwardPosVelocity;
322 }
323 
324 Eigen::Vector3f
326 {
327  int i1, i2;
328  float f;
329  getIndex(t, i1, i2, f);
330  return getKeypoint(i2)->feedForwardOriVelocity;
331 }
332 
335 {
336  Eigen::Vector6f ffVel;
337  ffVel.block<3, 1>(0, 0) = GetPositionDerivative(t);
338  ffVel.block<3, 1>(3, 0) = GetOrientationDerivative(t);
339  return ffVel;
340 }
341 
342 Eigen::VectorXf
344 {
345  int i1, i2;
346  float f;
347  getIndex(t, i1, i2, f);
348  return getKeypoint(i2)->feedForwardHandJointsVelocity;
349 }
350 
351 float
353 {
354  return keypointMap.rbegin()->first;
355 }
356 
359 {
360  Length l;
361  for (size_t i = 1; i < keypoints.size(); i++)
362  {
363  KeypointPtr k0 = keypoints.at(i - 1);
364  KeypointPtr k1 = keypoints.at(i);
365 
366  Eigen::Vector3f pos0 = ::math::Helpers::GetPosition(k0->tcpTarget);
367  Eigen::Matrix3f ori0 = ::math::Helpers::GetOrientation(k0->tcpTarget);
368 
369  Eigen::Vector3f pos1 = ::math::Helpers::GetPosition(k1->tcpTarget);
370  Eigen::Matrix3f ori1 = ::math::Helpers::GetOrientation(k1->tcpTarget);
371 
372  l.pos += (pos1 - pos0).norm();
373  l.ori += fabs(::math::Helpers::GetAngleAxisFromTo(ori0, ori1).angle());
374  }
375  return l;
376 }
377 
378 int
380 {
381  return keypoints.at(0)->handJointsTarget.rows();
382 }
383 
385 GraspTrajectory::getTranslatedAndRotated(const Eigen::Vector3f& translation,
386  const Eigen::Matrix3f& rotation)
387 {
388  GraspTrajectoryPtr traj(
389  new GraspTrajectory(::math::Helpers::TranslateAndRotatePose(
390  getKeypoint(0)->getTargetPose(), translation, rotation),
391  getKeypoint(0)->handJointsTarget));
392  for (size_t i = 1; i < keypoints.size(); i++)
393  {
394  KeypointPtr& kp = keypoints.at(i);
395  traj->addKeypoint(
396  ::math::Helpers::TranslateAndRotatePose(kp->getTargetPose(), translation, rotation),
397  kp->handJointsTarget,
398  kp->dt);
399  }
400  return traj;
401 }
402 
405 {
406  GraspTrajectoryPtr traj(
407  new GraspTrajectory(transform * getStartPose(), getKeypoint(0)->handJointsTarget));
408  for (size_t i = 1; i < keypoints.size(); i++)
409  {
410  KeypointPtr& kp = keypoints.at(i);
411  traj->addKeypoint(transform * kp->getTargetPose(), kp->handJointsTarget, kp->dt);
412  }
413  return traj;
414 }
415 
418 {
420 }
421 
424  const Eigen::Vector3f& handForward)
425 {
426  Eigen::Matrix4f startPose = getStartPose();
427  Eigen::Vector3f targetHandForward = ::math::Helpers::TransformDirection(target, handForward);
428  Eigen::Vector3f trajHandForward = ::math::Helpers::TransformDirection(startPose, handForward);
429  Eigen::Vector3f up(0, 0, 1);
430 
431  float angle = ::math::Helpers::Angle(targetHandForward, trajHandForward, up);
432  Eigen::AngleAxisf aa(angle, up);
433 
434  Eigen::Matrix4f transform = ::math::Helpers::CreateTranslationRotationTranslationPose(
435  -::math::Helpers::GetPosition(startPose),
436  aa.toRotationMatrix(),
437  ::math::Helpers::GetPosition(target));
438  return getTransformed(transform);
439 }
440 
442 GraspTrajectory::calculateReachability(VirtualRobot::RobotNodeSetPtr rns,
443  VirtualRobot::RobotNodePtr tcp,
445 {
447  getAllKeypointPoses(), Eigen::VectorXf::Zero(rns->getSize()), rns, tcp, params);
448 }
449 
450 void
452 {
453  RapidXmlWriter writer;
454  RapidXmlWriterNode root = writer.createRootNode("GraspTrajectory");
455  for (const KeypointPtr& keypoint : keypoints)
456  {
458  e.Add("dt", keypoint->dt);
459  e.AddAsArr("Pose", keypoint->tcpTarget);
460  e.AddAsArr("HandValues", keypoint->handJointsTarget);
461  root.append_string_node("Keypoint", e.obj->toJsonString(0, "", true));
462  }
463  writer.saveToFile(filename, true);
464 }
465 
467 GraspTrajectory::ReadFromFile(const grasping::GraspCandidatePtr& cnd)
468 {
469  std::string packageName = "armar6_skills"; // cnd->executionHints->graspTrajectoryPackage;
470  armarx::CMakePackageFinder finder(packageName);
471  std::string dataDir = finder.getDataDir() + "/" + packageName;
472  return GraspTrajectory::ReadFromFile(dataDir + "/motions/grasps/" +
473  cnd->executionHints->graspTrajectoryName + ".xml");
474 }
475 
478 {
479  RapidXmlReaderNode root = reader->getRoot("GraspTrajectory");
480  GraspTrajectoryPtr traj;
481  for (const RapidXmlReaderNode& kpNode : root.nodes("Keypoint"))
482  {
483  StructuralJsonParser p(kpNode.value());
484  p.parse();
485  JPathNavigator nav(p.parsedJson);
486  float dt = nav.selectSingleNode("dt").asFloat();
487 
488  Eigen::Matrix4f pose;
489  std::vector<JPathNavigator> rows = nav.select("Pose/*");
490  for (int i = 0; i < 4; i++)
491  {
492  std::vector<JPathNavigator> cells = rows.at(i).select("*");
493  for (int j = 0; j < 4; j++)
494  {
495  pose(i, j) = cells.at(j).asFloat();
496  }
497  }
498 
499  Eigen::Vector3f handValues;
500  std::vector<JPathNavigator> cells = nav.select("HandValues/*");
501  for (int j = 0; j < 3; j++)
502  {
503  handValues(j) = cells.at(j).asFloat();
504  }
505 
506  if (!traj)
507  {
508  traj = GraspTrajectoryPtr(new GraspTrajectory(pose, handValues));
509  }
510  else
511  {
512  traj->addKeypoint(pose, handValues, dt);
513  }
514  }
515  return traj;
516 }
517 
520 {
522 }
523 
525 GraspTrajectory::ReadFromString(const std::string& xml)
526 {
528 }
529 
530 void
531 GraspTrajectory::updateKeypointMap()
532 {
533  keypointMap.clear();
534  float t = 0;
535  for (size_t i = 0; i < keypoints.size(); i++)
536  {
537  t += getKeypoint(i)->dt;
538  keypointMap[t] = i;
539  }
540 }
armarx::RapidXmlReaderPtr
std::shared_ptr< RapidXmlReader > RapidXmlReaderPtr
Definition: RapidXmlReader.h:67
armarx::RapidXmlReader::FromFile
static RapidXmlReaderPtr FromFile(const std::string &path)
Definition: RapidXmlReader.h:573
armarx::GraspTrajectory::GetPosition
Eigen::Vector3f GetPosition(float t)
Definition: GraspTrajectory.cpp:241
armarx::GraspTrajectory::getAllKeypointPositions
std::vector< Eigen::Vector3f > getAllKeypointPositions()
Definition: GraspTrajectory.cpp:284
Eigen
Definition: Elements.h:32
armarx::GraspTrajectory::getAllKeypointOrientations
std::vector< Eigen::Matrix3f > getAllKeypointOrientations()
Definition: GraspTrajectory.cpp:295
armarx::RapidXmlWriter
Definition: RapidXmlWriter.h:122
armarx::GraspTrajectory::calculateReachability
SimpleDiffIK::Reachability calculateReachability(VirtualRobot::RobotNodeSetPtr rns, VirtualRobot::RobotNodePtr tcp=VirtualRobot::RobotNodePtr(), SimpleDiffIK::Parameters params=SimpleDiffIK::Parameters())
Definition: GraspTrajectory.cpp:442
armarx::SimpleJsonLoggerEntry::AddAsArr
void AddAsArr(const std::string &key, const Eigen::Vector3f &vec)
Definition: SimpleJsonLoggerEntry.cpp:35
armarx::SimpleDiffIK::Parameters
Definition: SimpleDiffIK.h:39
armarx::GraspTrajectory::ReadFromFile
static GraspTrajectoryPtr ReadFromFile(const grasping::GraspCandidatePtr &cnd)
Definition: GraspTrajectory.cpp:467
armarx::GraspTrajectory::insertKeypoint
void insertKeypoint(size_t index, const Eigen::Matrix4f &tcpTarget, const Eigen::VectorXf &handJointsTarget, float dt)
Definition: GraspTrajectory.cpp:127
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::RapidXmlReader::FromXmlString
static RapidXmlReaderPtr FromXmlString(const std::string &xml)
Definition: RapidXmlReader.h:566
armarx::GraspTrajectory::getTranslatedAndRotated
GraspTrajectoryPtr getTranslatedAndRotated(const Eigen::Vector3f &translation, const Eigen::Matrix3f &rotation)
Definition: GraspTrajectory.cpp:385
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
armarx::GraspTrajectory::getStartPose
Eigen::Matrix4f getStartPose()
Definition: GraspTrajectory.cpp:210
armarx::SimpleDiffIK::Reachability
Definition: SimpleDiffIK.h:83
armarx::GraspTrajectory::KeypointPtr
std::shared_ptr< Keypoint > KeypointPtr
Definition: GraspTrajectory.h:52
boost::target
Vertex target(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:668
armarx::CMakePackageFinder
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
Definition: CMakePackageFinder.h:52
armarx::GraspTrajectory::Length::pos
float pos
Definition: GraspTrajectory.h:80
armarx::JPathNavigator
Definition: JPathNavigator.h:35
armarx::GraspTrajectory::GetTcpDerivative
Eigen::Vector6f GetTcpDerivative(float t)
Definition: GraspTrajectory.cpp:334
armarx::GraspTrajectory::Keypoint::getTargetOrientation
Eigen::Matrix3f getTargetOrientation() const
Definition: GraspTrajectory.cpp:66
armarx::GraspTrajectory::ReadFromReader
static GraspTrajectoryPtr ReadFromReader(const RapidXmlReaderPtr &reader)
Definition: GraspTrajectory.cpp:477
armarx::GraspTrajectory::Keypoint
GraspTrajectoryKeypoint Keypoint
Definition: GraspTrajectory.h:81
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:570
armarx::GraspTrajectory::getAllKeypointPoses
std::vector< Eigen::Matrix4f > getAllKeypointPoses()
Definition: GraspTrajectory.cpp:273
armarx::GraspTrajectoryPtr
std::shared_ptr< class GraspTrajectory > GraspTrajectoryPtr
Definition: GraspTrajectory.h:47
armarx::GraspTrajectory::GraspTrajectory
GraspTrajectory()=default
armarx::JPathNavigator::select
std::vector< JPathNavigator > select(const std::string &expr, bool limitToOne=false) const
Definition: JPathNavigator.cpp:112
armarx::GraspTrajectory::GetPositionDerivative
Eigen::Vector3f GetPositionDerivative(float t)
Definition: GraspTrajectory.cpp:316
armarx::GraspTrajectory::removeKeypoint
void removeKeypoint(size_t index)
Definition: GraspTrajectory.cpp:150
armarx::SimpleJsonLoggerEntry::obj
JsonObjectPtr obj
Definition: SimpleJsonLoggerEntry.h:61
armarx::GraspTrajectory::GetHandValues
Eigen::VectorXf GetHandValues(float t)
Definition: GraspTrajectory.cpp:306
armarx::GraspTrajectory::calculateLength
Length calculateLength() const
Definition: GraspTrajectory.cpp:358
armarx::CMakePackageFinder::getDataDir
std::string getDataDir() const
Definition: CMakePackageFinder.h:194
armarx::GraspTrajectory::setKeypointDt
void setKeypointDt(size_t index, float dt)
Definition: GraspTrajectory.cpp:185
armarx::GraspTrajectory::Keypoint::getTargetPosition
Eigen::Vector3f getTargetPosition() const
Definition: GraspTrajectory.cpp:60
armarx::SimpleJsonLoggerEntry::Add
void Add(const std::string &key, const std::string &value)
Definition: SimpleJsonLoggerEntry.cpp:65
armarx::GraspTrajectory::getTransformed
GraspTrajectoryPtr getTransformed(const Eigen::Matrix4f &transform)
Definition: GraspTrajectory.cpp:404
filename
std::string filename
Definition: VisualizationRobot.cpp:86
armarx::GraspTrajectory::getIndex
void getIndex(float t, int &i1, int &i2, float &f)
Definition: GraspTrajectory.cpp:216
armarx::RapidXmlReaderNode
Definition: RapidXmlReader.h:69
armarx::GraspTrajectory::GetHandJointsDerivative
Eigen::VectorXf GetHandJointsDerivative(float t)
Definition: GraspTrajectory.cpp:343
armarx::to_string
const std::string & to_string(const std::string &s)
Definition: StringHelpers.h:41
armarx::GraspTrajectory::GetOrientationDerivative
Eigen::Vector3f GetOrientationDerivative(float t)
Definition: GraspTrajectory.cpp:325
armarx::GraspTrajectory::ReadFromString
static GraspTrajectoryPtr ReadFromString(const std::string &xml)
Definition: GraspTrajectory.cpp:525
armarx::GraspTrajectory::Length::ori
float ori
Definition: GraspTrajectory.h:81
armarx::transform
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT >>
Convenience function (with less typing) to transform a container of type InputT into the same contain...
Definition: algorithm.h:351
armarx::GraspTrajectory::getTransformedToGraspPose
GraspTrajectoryPtr getTransformedToGraspPose(const Eigen::Matrix4f &target, const Eigen::Vector3f &handForward=Eigen::Vector3f::UnitZ())
Definition: GraspTrajectory.cpp:423
armarx::GraspTrajectory::Length
Definition: GraspTrajectory.h:78
ExpressionException.h
armarx::StructuralJsonParser::parse
void parse()
Definition: StructuralJsonParser.cpp:60
armarx::GraspTrajectory::GetHandJointCount
int GetHandJointCount() const
Definition: GraspTrajectory.cpp:379
armarx::GraspTrajectory::lastKeypoint
KeypointPtr & lastKeypoint()
Definition: GraspTrajectory.cpp:198
armarx::SimpleDiffIK::CalculateReachability
static Reachability CalculateReachability(const std::vector< Eigen::Matrix4f > targets, const Eigen::VectorXf &initialJV, VirtualRobot::RobotNodeSetPtr rns, VirtualRobot::RobotNodePtr tcp=VirtualRobot::RobotNodePtr(), Parameters params=Parameters())
Use this to check a trajectory of waypoints.
Definition: SimpleDiffIK.cpp:140
armarx::RapidXmlWriter::saveToFile
void saveToFile(const std::string &path, bool indent)
Definition: RapidXmlWriter.h:154
armarx::GraspTrajectory::getKeypoint
KeypointPtr & getKeypoint(int i)
Definition: GraspTrajectory.cpp:204
armarx::GraspTrajectory::Keypoint::Keypoint
Keypoint(const Eigen::Matrix4f &tcpTarget, const Eigen::VectorXf &handJointsTarget)
Definition: GraspTrajectory.cpp:33
armarx::RapidXmlReaderNode::nodes
std::vector< RapidXmlReaderNode > nodes(const char *name=nullptr) const
Definition: RapidXmlReader.h:181
armarx::GraspTrajectory::GetOrientation
Eigen::Matrix3f GetOrientation(float t)
Definition: GraspTrajectory.cpp:251
armarx::RapidXmlWriter::createRootNode
RapidXmlWriterNode createRootNode(const std::string &name)
Definition: RapidXmlWriter.h:137
armarx::RapidXmlWriterNode::append_string_node
RapidXmlWriterNode & append_string_node(const std::string &name, const std::string &value)
Definition: RapidXmlWriter.h:107
angle
double angle(const Point &a, const Point &b, const Point &c)
Definition: point.hpp:109
GraspTrajectory.h
Eigen::Matrix< float, 6, 1 >
armarx::GraspTrajectory::replaceKeypoint
void replaceKeypoint(size_t index, const Eigen::Matrix4f &tcpTarget, const Eigen::VectorXf &handJointsTarget, float dt)
Definition: GraspTrajectory.cpp:167
armarx::GraspTrajectory::writeToFile
void writeToFile(const std::string &filename)
Definition: GraspTrajectory.cpp:451
armarx::JPathNavigator::selectSingleNode
JPathNavigator selectSingleNode(const std::string &expr) const
Definition: JPathNavigator.cpp:122
armarx::GraspTrajectory::Keypoint::getTargetPose
Eigen::Matrix4f getTargetPose() const
Definition: GraspTrajectory.cpp:72
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:649
armarx::GraspTrajectory::GetPose
Eigen::Matrix4f GetPose(float t)
Definition: GraspTrajectory.cpp:267
armarx::JPathNavigator::asFloat
float asFloat() const
Definition: JPathNavigator.cpp:230
ARMARX_CHECK_EQUAL
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
Definition: ExpressionException.h:130
armarx::SimpleJsonLoggerEntry
Definition: SimpleJsonLoggerEntry.h:37
armarx::GraspTrajectory::getClone
GraspTrajectoryPtr getClone()
Definition: GraspTrajectory.cpp:417
armarx::RapidXmlWriterNode
Definition: RapidXmlWriter.h:35
armarx::StructuralJsonParser
Definition: StructuralJsonParser.h:35
armarx::StructuralJsonParser::parsedJson
JsonDataPtr parsedJson
Definition: StructuralJsonParser.h:62
armarx::GraspTrajectory::getDuration
float getDuration() const
Definition: GraspTrajectory.cpp:352
armarx::GraspTrajectory::Keypoint::updateVelocities
void updateVelocities(const KeypointPtr &prev, float dt)
Definition: GraspTrajectory.cpp:78
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::GraspTrajectory::getKeypointCount
size_t getKeypointCount() const
Definition: GraspTrajectory.cpp:121
dt
constexpr T dt
Definition: UnscentedKalmanFilterTest.cpp:45
armarx::GraspTrajectory::addKeypoint
void addKeypoint(const Eigen::Matrix4f &tcpTarget, const Eigen::VectorXf &handJointsTarget, float dt)
Definition: GraspTrajectory.cpp:107
norm
double norm(const Point &a)
Definition: point.hpp:102