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