DesignerTrajectoryCalculator.h
Go to the documentation of this file.
1 #ifndef DESIGNERTRAJECTORYCALCULATOR_H
2 #define DESIGNERTRAJECTORYCALCULATOR_H
3 
4 #include <Eigen/Core>
5 
6 #include <VirtualRobot/Robot.h>
7 
8 #include "../Environment.h"
9 #include "TimedTrajectory.h"
10 
11 namespace armarx
12 {
13  class DesignerTrajectoryCalculator;
14 
15  /**
16  * @class DesignerTrajectoryCalculator
17  * @brief Offers functionality to create TimedTrajectories from supplied Trajectories and points set by the user.
18  */
20  {
21  private:
22  EnvironmentPtr environment;
23 
24  public:
25  //TimedTrajectory calculateTimeOptimalTrajectory(std::vector<Eigen::VectorXf>& trajectory, std::vector<Eigen::VectorXf>& userPoints, double maxDeviation);
26  /*
27  * HOW TO CONVERT vector<vector<double>> to vector<Eigen::VectorXf>
28  *
29  // convert ikSolutions from vector<vector<double>> to vector<Eigen::VectorXf>
30  std::vector<Eigen::VectorXf> ikSolutionsEigen;
31  for (std::vector<double> ikSolution : ikSolutions)
32  {
33  std::vector<float> ikSolutionFloat(ikSolution.begin(), ikSolution.end());
34  ikSolutionsEigen.push_back(
35  Eigen::VectorXf::Map(ikSolutionFloat.data(), ikSolutionFloat.size()));
36  }
37  *
38  */
39 
41  /**
42  * @brief Calculates a TimedTrajectory from the supplied trajectory and points set by user.
43  * @param trajectory A vector of floats representing the trajectory.
44  * @param userPoints The set of points defined by the user.
45  * @param rns The RobotNodeSet used by the trajectory.
46  * @param maxDeviation The maximum deviation of the points along the trajectory.
47  * @param accuracyFactor The factor with which to scale the accuracy of the time optimal trajectory.
48  * @return The created TimedTrajectory.
49  */
50  TimedTrajectory calculateTimeOptimalTrajectory(std::vector<std::vector<double>>& trajectory,
51  std::vector<std::vector<double>>& userPoints,
52  VirtualRobot::RobotNodeSetPtr rns,
53  double maxDeviation,
54  double accuracyFactor = 1.0);
55  };
56 } // namespace armarx
57 #endif // DESIGNERTRAJECTORYCALCULATOR_H
armarx::DesignerTrajectoryCalculator::DesignerTrajectoryCalculator
DesignerTrajectoryCalculator(EnvironmentPtr environment)
Definition: DesignerTrajectoryCalculator.cpp:12
armarx::DesignerTrajectoryCalculator
Offers functionality to create TimedTrajectories from supplied Trajectories and points set by the use...
Definition: DesignerTrajectoryCalculator.h:19
armarx::EnvironmentPtr
std::shared_ptr< Environment > EnvironmentPtr
Definition: Environment.h:29
armarx::DesignerTrajectoryCalculator::calculateTimeOptimalTrajectory
TimedTrajectory calculateTimeOptimalTrajectory(std::vector< std::vector< double >> &trajectory, std::vector< std::vector< double >> &userPoints, VirtualRobot::RobotNodeSetPtr rns, double maxDeviation, double accuracyFactor=1.0)
Calculates a TimedTrajectory from the supplied trajectory and points set by user.
Definition: DesignerTrajectoryCalculator.cpp:18
TimedTrajectory.h
armarx::TimedTrajectory
A container for a Trajectory and a set of timestamps, representing the arrival of the Trajectory at u...
Definition: TimedTrajectory.h:14
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27